#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 */
scalar_t__ EOF;
scalar_t__ fscanf(int /*<<< orphan*/, char *, int *, int *);
int max_collatz(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ stdin;
int main() {
  int a, b;
  while (fscanf(stdin, "%d %d", &a, &b) != EOF) {
    printf("%d %d %d\n", a, b, max_collatz(a, b));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <fscanf@plt>
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
je     119c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <max_collatz@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ea6(%rip),%r14
mov    (%r14),%edi
lea    0xeb4(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <fscanf@plt>
mov    0x2e80(%rip),%r15
cmp    (%r15),%rax
je     11ac <main+0x7c>
lea    0x4(%rsp),%r12
mov    %rsp,%r13
nopl   (%rax)
mov    0x4(%rsp),%ebp
mov    (%rsp),%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <max_collatz@plt>
lea    0xe7f(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    (%r14),%edi
lea    0xe64(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1050 <fscanf@plt>
cmp    (%r15),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* @stdin
%6 = call i64 @fscanf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @max_collatz(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i64 @fscanf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %18, label %9
9: ; preds = %0, %9
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @max_collatz(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* @stdin
%15 = call i64 @fscanf(i32 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %9
18: ; preds = %9, %0
ret i32 0
}