#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int correct_successor_value(int, int);
int /*<<< orphan*/ goto_successor_of(int, int);
void tremaux_solving(int arg1, int arg2) {
  int current_x = arg1, current_y = arg2;
  int successor_x, successor_y;
  if (!(arg1 == 0 && arg2 == 0)) {
    goto_successor_of(arg1, arg2);
    successor_x = correct_successor_value(current_x, current_y) / 10;
    successor_y = correct_successor_value(current_x, current_y) % 10;
    tremaux_solving(successor_x, successor_y);
  }
}


x86 assembly (clang, -O0):
<tremaux_solving>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    115e <tremaux_solving+0x2e>
cmpl   $0x0,-0x8(%rbp)
je     11a0 <tremaux_solving+0x70>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <goto_successor_of@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <correct_successor_value@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <correct_successor_value@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <tremaux_solving@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tremaux_solving>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%eax
or     %edi,%eax
je     118b <tremaux_solving+0x6b>
mov    %esi,%ebx
mov    %edi,%r14d
nop
mov    %r14d,%edi
mov    %ebx,%esi
call   1040 <goto_successor_of@plt>
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <correct_successor_value@plt>
cltq
imul   $0x66666667,%rax,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x22,%rbp
add    %eax,%ebp
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <correct_successor_value@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %ebx,%eax
or     %ebp,%eax
mov    %ebp,%r14d
jne    1130 <tremaux_solving+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @tremaux_solving(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %4
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %30, label %16
16: ; preds = %13, %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @goto_successor_of(i32 %17, i32 %18)
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @correct_successor_value(i32 %20, i32 %21)
%23 = sdiv i32 %22, 10
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = call i32 @correct_successor_value(i32 %24, i32 %25)
%27 = srem i32 %26, 10
store i32 %27, i32* %8
%28 = load i32, i32* %7
%29 = load i32, i32* %8
br label %30
30: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @tremaux_solving(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ %1, %2 ]
%7 = phi i32 [ %10, %5 ], [ %0, %2 ]
%8 = tail call i32 @goto_successor_of(i32 %7, i32 %6)
%9 = tail call i32 @correct_successor_value(i32 %7, i32 %6)
%10 = sdiv i32 %9, 10
%11 = tail call i32 @correct_successor_value(i32 %7, i32 %6)
%12 = srem i32 %11, 10
%13 = or i32 %12, %10
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}