#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 convert(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int i;
  for (i = 2; i <= 10; ++i)
    printf("%d is %d base(%d)\n", 100, convert(100, i), i);
  int x = 3 * (3 % 2);
  printf("%i\n", x);
  int y = 3 % 2;
  printf("%i\n", y);
  for (int j = 0; j < 10; j++) {
    printf("hackspree..... %i\n", j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1173 <main+0x53>
mov    -0x8(%rbp),%esi
mov    $0x64,%edi
call   1030 <convert@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
lea    0xea7(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11d3 <main+0xb3>
mov    -0x14(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11aa <main+0x8a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
mov    $0x2,%esi
call   1030 <convert@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x3,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x4,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x5,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x6,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x6,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x7,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x7,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x8,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x8,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x9,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0x9,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0xa,%esi
call   1030 <convert@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%edx
mov    $0xa,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd72(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"%d is %d base(%d)\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [19 x i8] c"hackspree..... %i\0A\00"
define i32 @main() {
%1 = tail call i32 @convert(i32 100, i32 2)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %1, i32 2)
%3 = tail call i32 @convert(i32 100, i32 3)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %3, i32 3)
%5 = tail call i32 @convert(i32 100, i32 4)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %5, i32 4)
%7 = tail call i32 @convert(i32 100, i32 5)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %7, i32 5)
%9 = tail call i32 @convert(i32 100, i32 6)
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %9, i32 6)
%11 = tail call i32 @convert(i32 100, i32 7)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %11, i32 7)
%13 = tail call i32 @convert(i32 100, i32 8)
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %13, i32 8)
%15 = tail call i32 @convert(i32 100, i32 9)
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %15, i32 9)
%17 = tail call i32 @convert(i32 100, i32 10)
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 %17, i32 10)
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 0)
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1)
%23 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2)
%24 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 3)
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 4)
%26 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 5)
%27 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 6)
%28 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 7)
%29 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 8)
%30 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 9)
ret i32 0
}