xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ calc();
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int count;
  scanf("%d", &count);
  int i;
  for (i = 0; i < count; ++i) {
    calc();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116e <main+0x4e>
mov    $0x0,%al
call   1030 <calc@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1150 <main+0x30>
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <calc@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
br label %9
9: ; preds = %15, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = call i32 (...) @calc()
br label %15
15: ; preds = %13
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
br label %9
18: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ 0, %2 ]
%10 = call i32 (...) @calc()
%11 = add nuw nsw i32 %9, 1
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %8, label %14
14: ; preds = %8, %2
ret i32 0
}
void create_session_ocall() {}


x86 assembly (clang, -O0):
<create_session_ocall>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_session_ocall>:
ret

LLVM IR (-O0):
define void @create_session_ocall() {
ret void
}

LLVM IR (-O2):
define void @create_session_ocall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_bts(int, int, int);
void test_bts(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_bts(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_bts(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_bts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_bts+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_bts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_bts+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_bts+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_bts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_bts+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bts>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_bts@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_bts+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_bts@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_bts+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_bts() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_bts(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_bts(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_bts() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_bts(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_bts(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ir_close_port();
void ir_close_port_on_exit(void) { (void)ir_close_port(); }


x86 assembly (clang, -O0):
<ir_close_port_on_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ir_close_port@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_close_port_on_exit>:
xor    %eax,%eax
jmp    1030 <ir_close_port@plt>

LLVM IR (-O0):
define void @ir_close_port_on_exit() {
%1 = call i32 (...) @ir_close_port()
ret void
}

LLVM IR (-O2):
define void @ir_close_port_on_exit() {
%1 = tail call i32 (...) @ir_close_port()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *from = "ial";
  char to[9] = "kolonada";
  memcpy(&to[5], from, 4);
  printf("%s+%s\n", from, to);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    -0x19(%rbp),%rdx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6164616e6f6c6f6b,%rax
61 64 61
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x5(%rsp),%rdi
lea    0xebc(%rip),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    0xeb5(%rip),%rdi
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ial\00"
@__const.main.to = [9 x i8] c"kolonada\00"
@.str.1 = [7 x i8] c"%s+%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [9 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = bitcast [9 x i8]* %3 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 5
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ial\00"
@__const.main.to = [9 x i8] c"kolonada\00"
@.str.1 = [7 x i8] c"%s+%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 5
%4 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int test_heapsort(int, char **);
int main(int argc, char *argv[]) { return test_heapsort(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_heapsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <test_heapsort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_heapsort(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_heapsort(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ myitoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string1[100];
  int number = INT_MIN;
  myitoa(number, string1);
  printf("%s\n", string1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <myitoa@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <myitoa@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = load i32, i32* @INT_MIN
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @myitoa(i32 %4, i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MIN
%4 = call i32 @myitoa(i32 %3, i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func1(void) { printf("Hello world\n"); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define void @func1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ CK_VAR_GetByName(char const *, void *);
const char *CK_VAR_GetString(const char *name, const char *def) {
  return (const char *)CK_VAR_GetByName(name, (void *)def);
}


x86 assembly (clang, -O0):
<CK_VAR_GetString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CK_VAR_GetByName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CK_VAR_GetString>:
jmp    1030 <CK_VAR_GetByName@plt>

LLVM IR (-O0):
define i8* @CK_VAR_GetString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @CK_VAR_GetByName(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @CK_VAR_GetString(i8* %0, i8* %1) {
%3 = tail call i64 @CK_VAR_GetByName(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int createPal(int num) {
  int orig = num;
  int pal = num;
  while (orig != 0) {
    int div = orig % 10;
    pal *= 10;
    pal += div;
    orig = orig / 10;
  }
  return pal;
}


x86 assembly (clang, -O0):
<createPal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <createPal+0x4e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1113 <createPal+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<createPal>:
test   %edi,%edi
je     1140 <createPal+0x40>
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <createPal+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @createPal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %2
store i32 %7, i32* %4
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
store i32 %15, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = add nsw i32 %17, %16
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 10
store i32 %20, i32* %3
br label %8
21: ; preds = %8
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @createPal(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
bool nrf53_errata_91(void) { return false; }


x86 assembly (clang, -O0):
<nrf53_errata_91>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf53_errata_91>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nrf53_errata_91() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_91() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ naive_scanf(char *, int *);
int /*<<< orphan*/ solve();
int program_main() {
  int t;
  naive_scanf("%d", &t);
  while (t--)
    solve();
  return 0;
}


x86 assembly (clang, -O0):
<program_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <naive_scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1158 <program_main+0x38>
mov    $0x0,%al
call   1030 <solve@plt>
jmp    1138 <program_main+0x18>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <naive_scanf@plt>
subl   $0x1,0x4(%rsp)
jb     114e <program_main+0x2e>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <solve@plt>
subl   $0x1,0x4(%rsp)
jae    1140 <program_main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @program_main() {
%1 = alloca i32
%2 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @solve()
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @program_main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = call i32 (...) @solve()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %0
ret i32 0
}
char *skip_token(const char *p, const char *t) {
  while ((*p == *t) && (*t != '\0') && (*p != '\0')) {
    p++;
    t++;
  }
  return (char *)p;
}


x86 assembly (clang, -O0):
<skip_token>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    114c <skip_token+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114c <skip_token+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115c <skip_token+0x5c>
jmp    1179 <skip_token+0x79>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <skip_token+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_token>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     113b <skip_token+0x3b>
mov    (%rsi),%dl
cmp    %dl,%cl
jne    113b <skip_token+0x3b>
test   %dl,%dl
je     113b <skip_token+0x3b>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     113b <skip_token+0x3b>
movzbl (%rsi),%edx
cmp    %dl,%cl
jne    113b <skip_token+0x3b>
add    $0x1,%rsi
test   %dl,%dl
jne    1120 <skip_token+0x20>
ret

LLVM IR (-O0):
define i8* @skip_token(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %25, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %23
13: ; preds = %5
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %18, %13, %5
%24 = phi i1 [ false, %13 ], [ false, %5 ], [ %22, %18 ]
br i1 %24, label %25, label %30
25: ; preds = %23
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
br label %5
30: ; preds = %23
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @skip_token(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %4, 0
%7 = or i1 %5, %6
%8 = icmp eq i8 %3, 0
%9 = or i1 %8, %7
br i1 %9, label %22, label %10
10: ; preds = %2, %10
%11 = phi i8* [ %14, %10 ], [ %1, %2 ]
%12 = phi i8* [ %13, %10 ], [ %0, %2 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i8, i8* %13
%16 = load i8, i8* %14
%17 = icmp ne i8 %15, %16
%18 = icmp eq i8 %16, 0
%19 = or i1 %17, %18
%20 = icmp eq i8 %15, 0
%21 = or i1 %20, %19
br i1 %21, label %22, label %10
22: ; preds = %10, %2
%23 = phi i8* [ %0, %2 ], [ %13, %10 ]
ret i8* %23
}
neg_rhs_1(int i) { return (1 << i); }


x86 assembly (clang, -O0):
<neg_rhs_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_rhs_1>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @neg_rhs_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @neg_rhs_1(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void handle_readv() { errx(EXIT_FAILURE, "sys_readv unimplemented"); }


x86 assembly (clang, -O0):
<handle_readv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_readv>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"sys_readv unimplemented\00"
define void @handle_readv() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @errx(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"sys_readv unimplemented\00"
define void @handle_readv() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @errx(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sched_get_priority_max(int);
int sched_get_priority_min(int);
void get_prio_min_max(int policy, int *min, int *max) {
  *min = sched_get_priority_min(policy);
  *max = sched_get_priority_max(policy);
}


x86 assembly (clang, -O0):
<get_prio_min_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sched_get_priority_min@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
call   1040 <sched_get_priority_max@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_prio_min_max>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <sched_get_priority_min@plt>
mov    %eax,(%rbx)
mov    %ebp,%edi
call   1040 <sched_get_priority_max@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @get_prio_min_max(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = call i32 @sched_get_priority_min(i32 %7)
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = call i32 @sched_get_priority_max(i32 %10)
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @get_prio_min_max(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @sched_get_priority_min(i32 %0)
store i32 %4, i32* %1
%5 = tail call i32 @sched_get_priority_max(i32 %0)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *mymalloc(size_t);
void *mymemdup(void *data, size_t sz) {
  if (data == NULL)
    return (NULL);
  void *new = mymalloc(sz);
  memcpy(new, data, sz);
  return (new);
}


x86 assembly (clang, -O0):
<mymemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <mymemdup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116e <mymemdup+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <mymalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymemdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114b <mymemdup+0x2b>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <mymalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
jmp    114e <mymemdup+0x2e>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mymemdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* null, i8** %3
br label %18
10: ; preds = %2
%11 = load i64, i64* %5
%12 = call i8* @mymalloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %10, %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @mymemdup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @mymalloc(i64 %1)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ reportOob();
int sudirript(int arr, int idx) {
  int size = ((int *)arr)[1];
  if ((idx < 0) || (idx > size)) {
    reportOob();
  } else {
    return (arr + 4 * (idx + 2));
  }
}


x86 assembly (clang, -O0):
<sudirript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113e <sudirript+0x2e>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <sudirript+0x3a>
mov    $0x0,%al
call   1030 <reportOob@plt>
jmp    115b <sudirript+0x4b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudirript>:
push   %rax
test   %esi,%esi
js     111d <sudirript+0xd>
movslq %edi,%rax
cmp    %esi,0x4(%rax)
jge    1126 <sudirript+0x16>
xor    %eax,%eax
call   1030 <reportOob@plt>
pop    %rcx
ret
lea    (%rdi,%rsi,4),%eax
add    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sudirript(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14, %2
%19 = call i32 (...) @reportOob()
br label %26
20: ; preds = %14
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 2
%24 = mul nsw i32 4, %23
%25 = add nsw i32 %21, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %20, %18
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @sudirript(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, %1
br i1 %9, label %10, label %12
10: ; preds = %4, %2
%11 = tail call i32 (...) @reportOob()
br label %16
12: ; preds = %4
%13 = shl i32 %1, 2
%14 = add i32 %0, 8
%15 = add i32 %14, %13
br label %16
16: ; preds = %10, %12
%17 = phi i32 [ undef, %10 ], [ %15, %12 ]
ret i32 %17
}
/* Variables and functions */
int __BNF_trans_string(char *);
int w_(void) {
  int state;
  {
    int firstloop = 1;
    do {
      state = __BNF_trans_string(" ");
      if (firstloop) {
        if (state)
          break;
        firstloop = 0;
      }
    } while (!state);
    state = firstloop;
  }
  state = 0;
  return state;
}


x86 assembly (clang, -O0):
<w_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <w_+0x3e>
cmpl   $0x0,-0x4(%rbp)
je     1147 <w_+0x37>
jmp    1164 <w_+0x54>
movl   $0x0,-0x8(%rbp)
jmp    1153 <w_+0x43>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111f <w_+0xf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     1120 <w_+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @w_() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
br label %3
3: ; preds = %13, %0
%4 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %17
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %3
br label %13
13: ; preds = %12
%14 = load i32, i32* %1
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %3, label %17
17: ; preds = %13, %10
%18 = load i32, i32* %2
store i32 %18, i32* %1
store i32 0, i32* %1
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @w_() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 0
}
void gtk_scale_set_draw_value() {}


x86 assembly (clang, -O0):
<gtk_scale_set_draw_value>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_scale_set_draw_value>:
ret

LLVM IR (-O0):
define void @gtk_scale_set_draw_value() {
ret void
}

LLVM IR (-O2):
define void @gtk_scale_set_draw_value() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 50;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x32,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 50, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 50)
ret i32 0
}
unsigned mod(int a, unsigned b) { return (a >= 0 ? a % b : b - (-a) % b); }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1124 <mod+0x24>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    113c <mod+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
test   %edi,%edi
js     110d <mod+0xd>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret
neg    %eax
xor    %edx,%edx
div    %esi
sub    %edx,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = urem i32 %8, %9
br label %18
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 0, %13
%15 = load i32, i32* %4
%16 = urem i32 %14, %15
%17 = sub i32 %12, %16
br label %18
18: ; preds = %11, %7
%19 = phi i32 [ %10, %7 ], [ %17, %11 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = urem i32 %0, %1
br label %10
6: ; preds = %2
%7 = sub nsw i32 0, %0
%8 = urem i32 %7, %1
%9 = sub i32 %1, %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int key_y() {
  char ch;
  mvprintw(21, 24, "            Y = YES             ");
  mvprintw(22, 24, "              KEY               ");
  ch = getch();
  if (ch == 'y' || ch == 'Y')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<key_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
mov    $0x18,%esi
lea    0xec7(%rip),%rdx
call   1040 <mvprintw@plt>
mov    $0x16,%edi
mov    $0x18,%esi
lea    0xed2(%rip),%rdx
call   1040 <mvprintw@plt>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
je     1178 <key_y+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    1184 <key_y+0x64>
movl   $0x1,-0x4(%rbp)
jmp    118b <key_y+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_y>:
push   %rax
lea    0xed8(%rip),%rdx
mov    $0x15,%edi
mov    $0x18,%esi
call   1040 <mvprintw@plt>
lea    0xee3(%rip),%rdx
mov    $0x16,%edi
mov    $0x18,%esi
call   1040 <mvprintw@plt>
xor    %eax,%eax
call   1030 <getch@plt>
and    $0xdf,%al
xor    %ecx,%ecx
cmp    $0x59,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c" Y = YES \00"
@.str.1 = [33 x i8] c" KEY \00"
define i32 @key_y() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @mvprintw(i32 21, i32 24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @mvprintw(i32 22, i32 24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call signext i8 (...) @getch()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 89
br i1 %12, label %13, label %14
13: ; preds = %9, %0
store i32 1, i32* %1
br label %15
14: ; preds = %9
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [33 x i8] c" Y = YES \00"
@.str.1 = [33 x i8] c" KEY \00"
define i32 @key_y() {
%1 = tail call i32 @mvprintw(i32 21, i32 24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @mvprintw(i32 22, i32 24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call signext i8 (...) @getch()
%4 = and i8 %3, -33
%5 = icmp eq i8 %4, 89
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __tm_to_time(struct tm *);
time_t timegm(struct tm *tm) { return __tm_to_time(tm); }


x86 assembly (clang, -O0):
<timegm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__tm_to_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timegm>:
jmp    1030 <__tm_to_time@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @timegm(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i32 @__tm_to_time(%struct.tm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @timegm(%struct.tm* %0) {
%2 = tail call i32 @__tm_to_time(%struct.tm* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void pusb_check_usage(const char *name) {
  fprintf(stderr,
          "Usage: %s [--help] [--debug] [--config=path] [--service=name] "
          "[--dump] [--quiet] [--debug]"
          " <username>\n",
          name);
}


x86 assembly (clang, -O0):
<pusb_check_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pusb_check_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: %s [--help] [--debug] [--config=path] [--service=name] [--dump] [--quiet] [--debug] <username>\0A\00"
define void @pusb_check_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: %s [--help] [--debug] [--config=path] [--service=name] [--dump] [--quiet] [--debug] <username>\0A\00"
define void @pusb_check_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int re_match(pbufp, string, size, pos, regs)
struct re_pattern_buffer *pbufp;
char *string;
int size, pos;
struct re_registers *regs;
{
  return re_match_2(pbufp, 0, 0, string, size, pos, regs, size);
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <re_match_2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%r10
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
call   1030 <re_match_2@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%11 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load %struct.re_registers*, %struct.re_registers** %10
%16 = load i32, i32* %8
%17 = call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %11, i32 0, i32 0, i8* %12, i32 %13, i32 %14, %struct.re_registers* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
int fun530() { return 530; }


x86 assembly (clang, -O0):
<fun530>:
push   %rbp
mov    %rsp,%rbp
mov    $0x212,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun530>:
mov    $0x212,%eax
ret

LLVM IR (-O0):
define i32 @fun530() {
ret i32 530
}

LLVM IR (-O2):
define i32 @fun530() {
ret i32 530
}
/* Variables and functions */
int /*<<< orphan*/ criaArvore();
int main() { criaArvore(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <criaArvore@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <criaArvore@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @criaArvore()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @criaArvore()
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void led_off(void) { *(volatile uint16_t *)0x40020c14 &= ~0x2000; }


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40020c14,%eax
mov    (%rax),%ecx
and    $0xffffdfff,%ecx
mov    $0x40020c14,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
andl   $0xffffdfff,0x40020c14
ff df ff ff
ret

LLVM IR (-O0):
define void @led_off() {
%1 = load volatile i32, i32* inttoptr (i64 1073875988 to i32*)
%2 = and i32 %1, -8193
store volatile i32 %2, i32* inttoptr (i64 1073875988 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_off() {
%1 = load volatile i32, i32* inttoptr (i64 1073875988 to i32*)
%2 = and i32 %1, -8193
store volatile i32 %2, i32* inttoptr (i64 1073875988 to i32*)
ret void
}
void denormal_kill(float *v) {
  static const float offset = 1e-18f;
  *v += offset;
  *v -= offset;
}


x86 assembly (clang, -O0):
<denormal_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xed4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<denormal_kill>:
movss  (%rdi),%xmm0
addss  0xef4(%rip),%xmm0
addss  0xef0(%rip),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
@denormal_kill.offset = internal constant float 0x3C32725DE0000000
define void @denormal_kill(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fadd float %4, 0x3C32725DE0000000
store float %5, float* %3
%6 = load float*, float** %2
%7 = load float, float* %6
%8 = fsub float %7, 0x3C32725DE0000000
store float %8, float* %6
ret void
}

LLVM IR (-O2):
define void @denormal_kill(float* nocapture %0) {
%2 = load float, float* %0
%3 = fadd float %2, 0x3C32725DE0000000
%4 = fadd float %3, 0xBC32725DE0000000
store float %4, float* %0
ret void
}
/* Variables and functions */
int toupper(int);
__attribute__((__weak__, __always___)) int softboundmpx_toupper(int c) {
  return toupper(c);
}


x86 assembly (clang, -O0):
<softboundmpx_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_toupper>:
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @toupper(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define weak i32 @softboundmpx_toupper(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}
void _start() {}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
ret

LLVM IR (-O0):
define void @_start() {
ret void
}

LLVM IR (-O2):
define void @_start() {
ret void
}
signed short signedshort_ignoring_longlongint(signed short x, long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshort_ignoring_longlongint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_longlongint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_longlongint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
unsigned char answer_4(unsigned char arg0, int arg1) {
  return arg0 & ~(1 << arg1);
}


x86 assembly (clang, -O0):
<answer_4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_4>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @answer_4(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @answer_4(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = xor i8 %4, -1
%6 = and i8 %5, %0
ret i8 %6
}