#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 fun(int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
void main() {
  int a, b;
  for (a = 1; a < 10; a++)
    for (b = 0; b < 10; b++)
      if (fun(a, b) == 1)
        printf("%d%d%d%d", a, a, b, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    119d <main+0x7d>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118a <main+0x6a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    1177 <main+0x57>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
jmp    117c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
jmp    118f <main+0x6f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
jmp    114c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0xa,%ebx
je     12dc <main+0x1bc>
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    116b <main+0x4b>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    1193 <main+0x73>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    11bb <main+0x9b>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    11e3 <main+0xc3>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x3,%ecx
mov    $0x3,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    120b <main+0xeb>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    1233 <main+0x113>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x5,%ecx
mov    $0x5,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    125b <main+0x13b>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x6,%ecx
mov    $0x6,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    1283 <main+0x163>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x7,%ecx
mov    $0x7,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    12ab <main+0x18b>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x8,%ecx
mov    $0x8,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x9,%esi
call   1030 <fun@plt>
cmp    $0x1,%eax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    $0x9,%ecx
mov    $0x9,%r8d
call   1040 <printf@plt>
jmp    1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %26, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %29
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %22, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @fun(i32 %11, i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i32, i32* %1
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19)
br label %21
21: ; preds = %15, %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %7
25: ; preds = %7
br label %26
26: ; preds = %25
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %3
29: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%d%d\00"
define void @main() {
br label %1
1: ; preds = %0, %52
%2 = phi i32 [ 1, %0 ], [ %53, %52 ]
%3 = tail call i32 @fun(i32 %2, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 0, i32 0)
br label %7
7: ; preds = %1, %5
%8 = tail call i32 @fun(i32 %2, i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 1, i32 1)
br label %12
12: ; preds = %10, %7
%13 = tail call i32 @fun(i32 %2, i32 2)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 2, i32 2)
br label %17
17: ; preds = %15, %12
%18 = tail call i32 @fun(i32 %2, i32 3)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 3, i32 3)
br label %22
22: ; preds = %20, %17
%23 = tail call i32 @fun(i32 %2, i32 4)
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 4, i32 4)
br label %27
27: ; preds = %25, %22
%28 = tail call i32 @fun(i32 %2, i32 5)
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 5, i32 5)
br label %32
32: ; preds = %30, %27
%33 = tail call i32 @fun(i32 %2, i32 6)
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 6, i32 6)
br label %37
37: ; preds = %35, %32
%38 = tail call i32 @fun(i32 %2, i32 7)
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 7, i32 7)
br label %42
42: ; preds = %40, %37
%43 = tail call i32 @fun(i32 %2, i32 8)
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 8, i32 8)
br label %47
47: ; preds = %45, %42
%48 = tail call i32 @fun(i32 %2, i32 9)
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 9, i32 9)
br label %52
52: ; preds = %50, %47
%53 = add nuw nsw i32 %2, 1
%54 = icmp eq i32 %53, 10
br i1 %54, label %55, label %1
55: ; preds = %52
ret void
}