201036: push %rbp
201037: push %rbx
201038: sub $0x28,%rsp
20103c: mov %rsp,%rsi
20103f: callq 2014a5 <read_input>
201044: cmpl $0x0,(%rsp)
201048: jne 201051 <func_2+0x1b>
20104a: cmpl $0x1,0x4(%rsp)
20104f: je 201056 <func_2+0x20>
201051: callq 20146f <wrong_input>
201056: mov %rsp,%rbp
201059: lea 0x4(%rsp),%rbx
20105e: add $0x18,%rbp
201062: mov -0x2(%rbx),%eax
201065: add -0x4(%rbx),%eax
201068: cmp %eax,(%rbx)
20106a: je 201071 <func_2+0x3b>
20106c: callq 20146f <wrong_input>
201071: add $0x2,%rbx
201075: cmp %rbp,%rbx
201078: jne 201062 <func_2+0x2c>
20107a: add $0x28,%rsp
20107e: pop %rbx
20107f: pop %rbp
201080: retq
Well, if I break it into lines:
mov %rsp,%rbp : puts value of rsp into rbp
lea 0x4(%rsp),%rbx : put "0x4*rsp" into rbx. (*rsp = address of or rsp)
add $0x15,%rbp : adds the integer that at "0x15" to rbp and saves the sum in
rbp.
mov -0x2(%rbx),%eax : moves the value that inside of ??? to eax
add -0x4(%rbx),%eax : adds the value that inside of ??? to eax as saves the sum
in eax.
cmp %eax,(%rbx): compares eax with rbx.
well, I can't really understand what "0x4(%rsp)" means, what the minus in "-0x2(%rbx)" and "-0x4(%rbx)" means..
I am trying to connect the dots here. It seems like a loop, that increases rbx or eax and then compares them.. I don't really get it though.