This is asm code for phase_6
Dump of assembler code for function phase_6:
=> 0x000055555555551b <+0>: push %r13
0x000055555555551d <+2>: push %r12
0x000055555555551f <+4>: push %rbp
0x0000555555555520 <+5>: push %rbx
0x0000555555555521 <+6>: sub $0x68,%rsp
0x0000555555555525 <+10>: mov %fs:0x28,%rax
0x000055555555552e <+19>: mov %rax,0x58(%rsp)
0x0000555555555533 <+24>: xor %eax,%eax
0x0000555555555535 <+26>: mov %rsp,%r12
0x0000555555555538 <+29>: mov %r12,%rsi
0x000055555555553b <+32>: callq 0x555555555ab3 <read_six_numbers>
0x0000555555555540 <+37>: mov $0x0,%r13d
0x0000555555555546 <+43>: jmp 0x55555555556d <phase_6+82>
0x0000555555555548 <+45>: callq 0x555555555a77 <explode_bomb>
0x000055555555554d <+50>: jmp 0x55555555557c <phase_6+97>
0x000055555555554f <+52>: add $0x1,%ebx
0x0000555555555552 <+55>: cmp $0x5,%ebx
0x0000555555555555 <+58>: jg 0x555555555569 <phase_6+78>
0x0000555555555557 <+60>: movslq %ebx,%rax
0x000055555555555a <+63>: mov (%rsp,%rax,4),%eax
0x000055555555555d <+66>: cmp %eax,0x0(%rbp)
0x0000555555555560 <+69>: jne 0x55555555554f <phase_6+52>
0x0000555555555562 <+71>: callq 0x555555555a77 <explode_bomb>
0x0000555555555567 <+76>: jmp 0x55555555554f <phase_6+52>
0x0000555555555569 <+78>: add $0x4,%r12
0x000055555555556d <+82>: mov %r12,%rbp
0x0000555555555570 <+85>: mov (%r12),%eax
0x0000555555555574 <+89>: sub $0x1,%eax
0x0000555555555577 <+92>: cmp $0x5,%eax
0x000055555555557a <+95>: ja 0x555555555548 <phase_6+45>
---Type <return> to continue, or q <return> to quit---
0x000055555555557c <+97>: add $0x1,%r13d
0x0000555555555580 <+101>: cmp $0x6,%r13d
0x0000555555555584 <+105>: je 0x5555555555bb <phase_6+160>
0x0000555555555586 <+107>: mov %r13d,%ebx
0x0000555555555589 <+110>: jmp 0x555555555557 <phase_6+60>
0x000055555555558b <+112>: mov 0x8(%rdx),%rdx
0x000055555555558f <+116>: add $0x1,%eax
0x0000555555555592 <+119>: cmp %ecx,%eax
0x0000555555555594 <+121>: jne 0x55555555558b <phase_6+112>
0x0000555555555596 <+123>: mov %rdx,0x20(%rsp,%rsi,8)
0x000055555555559b <+128>: add $0x1,%rsi
0x000055555555559f <+132>: cmp $0x6,%rsi
0x00005555555555a3 <+136>: je 0x5555555555c2 <phase_6+167>
0x00005555555555a5 <+138>: mov (%rsp,%rsi,4),%ecx
0x00005555555555a8 <+141>: mov $0x1,%eax
0x00005555555555ad <+146>: lea 0x202c7c(%rip),%rdx # 0x555555758230 <node1>
0x00005555555555b4 <+153>: cmp $0x1,%ecx
0x00005555555555b7 <+156>: jg 0x55555555558b <phase_6+112>
0x00005555555555b9 <+158>: jmp 0x555555555596 <phase_6+123>
0x00005555555555bb <+160>: mov $0x0,%esi
0x00005555555555c0 <+165>: jmp 0x5555555555a5 <phase_6+138>
0x00005555555555c2 <+167>: mov 0x20(%rsp),%rbx
0x00005555555555c7 <+172>: mov 0x28(%rsp),%rax
0x00005555555555cc <+177>: mov %rax,0x8(%rbx)
0x00005555555555d0 <+181>: mov 0x30(%rsp),%rdx
0x00005555555555d5 <+186>: mov %rdx,0x8(%rax)
0x00005555555555d9 <+190>: mov 0x38(%rsp),%rax
0x00005555555555de <+195>: mov %rax,0x8(%rdx)
0x00005555555555e2 <+199>: mov 0x40(%rsp),%rdx
0x00005555555555e7 <+204>: mov %rdx,0x8(%rax)
0x00005555555555eb <+208>: mov 0x48(%rsp),%rax
---Type <return> to continue, or q <return> to quit---
0x00005555555555f0 <+213>: mov %rax,0x8(%rdx)
0x00005555555555f4 <+217>: movq $0x0,0x8(%rax)
0x00005555555555fc <+225>: mov $0x5,%ebp
0x0000555555555601 <+230>: jmp 0x55555555560c <phase_6+241>
0x0000555555555603 <+232>: mov 0x8(%rbx),%rbx
0x0000555555555607 <+236>: sub $0x1,%ebp
0x000055555555560a <+239>: je 0x55555555561d <phase_6+258>
0x000055555555560c <+241>: mov 0x8(%rbx),%rax
0x0000555555555610 <+245>: mov (%rax),%eax
0x0000555555555612 <+247>: cmp %eax,(%rbx)
0x0000555555555614 <+249>: jle 0x555555555603 <phase_6+232>
0x0000555555555616 <+251>: callq 0x555555555a77 <explode_bomb>
0x000055555555561b <+256>: jmp 0x555555555603 <phase_6+232>
0x000055555555561d <+258>: mov 0x58(%rsp),%rax
0x0000555555555622 <+263>: xor %fs:0x28,%rax
0x000055555555562b <+272>: jne 0x555555555638 <phase_6+285>
0x000055555555562d <+274>: add $0x68,%rsp
0x0000555555555631 <+278>: pop %rbx
0x0000555555555632 <+279>: pop %rbp
0x0000555555555633 <+280>: pop %r12
0x0000555555555635 <+282>: pop %r13
0x0000555555555637 <+284>: retq
0x0000555555555638 <+285>: callq 0x555555554f00 <__stack_chk_fail@plt>
By analysing, i have to input 6 non identical digits and are less than 6 and should separated by space. That looks like a linked list, so every node links to the next node which should be bigger than previous node. So randomly entered 1 2 3 4 5 6. As I understand they should be in ascending order, so everything should work well, but i keep getting exploded. Where am i doing it wrong?
I tried to understand and analyze the diassemblied code. I have an idea that this is a linked list that should contain 6 elements that point to the next node which should be bigger than the previous node. Elements should not be less than 0 and greater than 6. So orderdered answer 1 2 3 4 5 6 should be a correct answer but i keep getting exploded. Where am I doing wrong?