xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int main() {
  int n, sum, i;
  while (scanf("%d", &n) == 1 && n != 0) {
    printf("1/2\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x11(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1169 <main+0x49>
jmp    117a <main+0x5a>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    117f <main+0x5f>
cmpl   $0x0,0xc(%rsp)
je     117f <main+0x5f>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    117f <main+0x5f>
cmpl   $0x0,0xc(%rsp)
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [4 x i8] c"1/2\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %8, label %15
8: ; preds = %0, %8
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = icmp eq i32 %10, 1
%12 = load i32, i32* %1
%13 = icmp ne i32 %12, 0
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %8, label %15
15: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(float);
int main() {
  foo(2000.0f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(float 2.000000e+03)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(float 2.000000e+03)
ret i32 0
}
double fmod(double x, double y) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  (void)(y);
  return 0;
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.fmod = [5 x i8] c"fmod\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fmod, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%9 = load double, double* %3
%10 = load double, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.fmod = [5 x i8] c"fmod\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @fmod(double %0, double %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fmod, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
void link_error5() {}


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

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

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

LLVM IR (-O2):
define void @link_error5() {
ret void
}
int valueOf_char(char c) {
  switch (c) {
  case '1':
    return 1;
  case '2':
    return 2;
  case '3':
    return 3;
  case '4':
    return 4;
  case '5':
    return 5;
  case '6':
    return 6;
  case '7':
    return 7;
  case '8':
    return 8;
  case '9':
    return 9;
  case '0':
    return 0;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<valueOf_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <valueOf_char+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x5,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x6,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x7,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x8,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x9,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0x0,-0x4(%rbp)
jmp    11b3 <valueOf_char+0xb3>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueOf_char>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @valueOf_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 49, label %6
i32 50, label %7
i32 51, label %8
i32 52, label %9
i32 53, label %10
i32 54, label %11
i32 55, label %12
i32 56, label %13
i32 57, label %14
i32 48, label %15
]
6: ; preds = %1
store i32 1, i32* %2
br label %17
7: ; preds = %1
store i32 2, i32* %2
br label %17
8: ; preds = %1
store i32 3, i32* %2
br label %17
9: ; preds = %1
store i32 4, i32* %2
br label %17
10: ; preds = %1
store i32 5, i32* %2
br label %17
11: ; preds = %1
store i32 6, i32* %2
br label %17
12: ; preds = %1
store i32 7, i32* %2
br label %17
13: ; preds = %1
store i32 8, i32* %2
br label %17
14: ; preds = %1
store i32 9, i32* %2
br label %17
15: ; preds = %1
store i32 0, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @valueOf_char(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_1() {
  char *x = "abc";
  char *y = "aBdef";
  clang_analyzer_eval(strncasecmp(x, y, 5) == -1);
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_diff_length_1>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"aBdef\00"
define void @strncasecmp_diff_length_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 5)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"aBdef\00"
define void @strncasecmp_diff_length_1() {
%1 = tail call i32 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int c1_f2() { printf("This is native call c1_f2()\n"); }


x86 assembly (clang, -O0):
<c1_f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is native call c1_f2()\0A\00"
define i32 @c1_f2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [28 x i8] c"This is native call c1_f2()\00"
define i32 @c1_f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ parallel_merge(char *, int);
void test_main(void) { parallel_merge("child-sort", 123); }


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7b,%esi
call   1030 <parallel_merge@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
lea    0xee9(%rip),%rdi
mov    $0x7b,%esi
jmp    1030 <parallel_merge@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"child-sort\00"
define void @test_main() {
%1 = call i32 @parallel_merge(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 123)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"child-sort\00"
define void @test_main() {
%1 = tail call i32 @parallel_merge(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 123)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Tool for packing system firmware.\n"
                  "Usage: syspack -k <kernel> -i <romfs image>\n"
                  "\t-k <kernel> a path to a kernel file to pack\n"
                  "\t-i <romfs image> a path to romfs image\n"
                  "\t-o <output file> output file name\n"
                  "\t-h prints this message\n");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [223 x i8] c"Tool for packing system firmware.\0AUsage: syspack -k <kernel> -i <romfs image>\0A\09-k <kernel> a path to a kernel file to pack\0A\09-i <romfs image> a path to romfs image\0A\09-o <output file> output file name\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [223 x i8] c"Tool for packing system firmware.\0AUsage: syspack -k <kernel> -i <romfs image>\0A\09-k <kernel> a path to a kernel file to pack\0A\09-i <romfs image> a path to romfs image\0A\09-o <output file> output file name\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UTF8Increment(char const *, size_t *);
size_t UTF8Length(const char *s) {
  size_t i = 0, length = 0;
  while (s[i] != '\0') {
    UTF8Increment(s, &i);
    length++;
  }
  return (length);
}


x86 assembly (clang, -O0):
<UTF8Length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <UTF8Length+0x4f>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <UTF8Increment@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <UTF8Length+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8Length>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
cmpb   $0x0,(%rdi)
je     115d <UTF8Length+0x4d>
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <UTF8Increment@plt>
add    $0x1,%rbx
mov    0x8(%rsp),%rax
cmpb   $0x0,(%r14,%rax,1)
jne    1140 <UTF8Length+0x30>
jmp    115f <UTF8Length+0x4f>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @UTF8Length(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %12, %1
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = call i32 @UTF8Increment(i8* %13, i64* %3)
%15 = load i64, i64* %4
%16 = add i64 %15, 1
store i64 %16, i64* %4
br label %5
17: ; preds = %5
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
define i64 @UTF8Length(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 0, %1 ]
%8 = call i32 @UTF8Increment(i8* %0, i64* %2)
%9 = add i64 %7, 1
%10 = load i64, i64* %2
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
%15 = phi i64 [ 0, %1 ], [ %9, %6 ]
ret i64 %15
}
void PtrMap_Append(void *ptrMap, void *key, void *ptr) {}


x86 assembly (clang, -O0):
<PtrMap_Append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PtrMap_Append(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PtrMap_Append(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
long check_val_ATTRlong(long v) { return v; }


x86 assembly (clang, -O0):
<check_val_ATTRlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_val_ATTRlong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @check_val_ATTRlong(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @check_val_ATTRlong(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
void *__dlsym(void *, char const *, int /*<<< orphan*/);
void *dlsym(void *p, const char *s) { return __dlsym(p, s, 0); }


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

x86 assembly (clang, -O2):
<dlsym>:
xor    %edx,%edx
jmp    1030 <__dlsym@plt>

LLVM IR (-O0):
define i8* @dlsym(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 i8* @__dlsym(i8* %5, i8* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @dlsym(i8* %0, i8* %1) {
%3 = tail call i8* @__dlsym(i8* %0, i8* %1, i32 0)
ret i8* %3
}
char get_char_from_digit(unsigned char digit) {
  switch (digit) {
  case 0:
    return '0';
    break;
  case 1:
    return '1';
    break;
  case 2:
    return '2';
    break;
  case 3:
    return '3';
    break;
  case 4:
    return '4';
    break;
  case 5:
    return '5';
    break;
  case 6:
    return '6';
    break;
  case 7:
    return '7';
    break;
  case 8:
    return '8';
    break;
  case 9:
    return '9';
    break;
  default:
    return '\0';
    break;
  }
}


x86 assembly (clang, -O0):
<get_char_from_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     118a <get_char_from_digit+0x8a>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x30,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x31,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x32,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x33,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x34,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x35,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x36,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x37,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x38,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x39,-0x1(%rbp)
jmp    118e <get_char_from_digit+0x8e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_from_digit>:
lea    0x30(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @get_char_from_digit(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %16 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
]
6: ; preds = %1
store i8 48, i8* %2
br label %17
7: ; preds = %1
store i8 49, i8* %2
br label %17
8: ; preds = %1
store i8 50, i8* %2
br label %17
9: ; preds = %1
store i8 51, i8* %2
br label %17
10: ; preds = %1
store i8 52, i8* %2
br label %17
11: ; preds = %1
store i8 53, i8* %2
br label %17
12: ; preds = %1
store i8 54, i8* %2
br label %17
13: ; preds = %1
store i8 55, i8* %2
br label %17
14: ; preds = %1
store i8 56, i8* %2
br label %17
15: ; preds = %1
store i8 57, i8* %2
br label %17
16: ; preds = %1
store i8 0, i8* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @get_char_from_digit(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = select i1 %2, i8 %3, i8 0
ret i8 %4
}
void rop3_200_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_200_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_200_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
int foo(int *restrict a, int *restrict b) {
  (void)a;
  (void)b;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i32* noalias nocapture readnone %0, i32* noalias nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cm_mask_interrupts(int /*<<< orphan*/);
uint32_t __cm_atomic_set(uint32_t *val) { return cm_mask_interrupts(*val); }


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

x86 assembly (clang, -O2):
<__cm_atomic_set>:
mov    (%rdi),%edi
jmp    1030 <cm_mask_interrupts@plt>

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

LLVM IR (-O2):
define i32 @__cm_atomic_set(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @cm_mask_interrupts(i32 %2)
ret i32 %3
}
int test_imm_7Fuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x7f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Fuint64_highword_mem>:
testb  $0x7f,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 127
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_7Fuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 545460846592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ptrarg(int *x) { return *x + 1; }


x86 assembly (clang, -O0):
<ptrarg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrarg>:
mov    (%rdi),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ptrarg(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
ret i32 %3
}
void gtk_file_chooser_select_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_select_all() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<ADCIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <ADCIntDisableEx+0x2d>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntDisableEx>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
not    %ebx
movslq %ebp,%rax
and    %ebx,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCIntDisableEx(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 eq i32 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = xor i32 %14, -1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 8
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, %15
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @ADCIntDisableEx(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = xor i32 %1, -1
%8 = add nsw i32 %0, 8
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, %7
store volatile i32 %12, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fixup();
scalar_t__ owner();
__attribute__((always_)) void slowtrylock(void) {
  if (owner())
    fixup();
}


x86 assembly (clang, -O0):
<slowtrylock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <owner@plt>
cmp    $0x0,%rax
je     113c <slowtrylock+0x1c>
mov    $0x0,%al
call   1040 <fixup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<slowtrylock>:
push   %rax
xor    %eax,%eax
call   1030 <owner@plt>
test   %rax,%rax
je     1135 <slowtrylock+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fixup@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @slowtrylock() {
%1 = call i64 (...) @owner()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @fixup()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @slowtrylock() {
%1 = tail call i64 (...) @owner()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @fixup()
br label %5
5: ; preds = %3, %0
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels24_8_sse4() {
ret void
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int iRet = 0;
  int m = 137;
  iRet = foo(m);
  printf("iRet = %d\n", iRet);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x89,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x89,%edi
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"iRet = %d\0A\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
store i32 0, i32* %6
store i32 137, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @foo(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"iRet = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 137)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void foo449(int p) {}


x86 assembly (clang, -O0):
<foo449>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo449(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo449(i32 %0) {
ret void
}
int cairo_code_draw_lushFreqLabel_get_width() { return 42; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushFreqLabel_get_width() {
ret i32 42
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushFreqLabel_get_width() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void m3_FreeImpl(void *io_ptr) { free(io_ptr); }


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

x86 assembly (clang, -O2):
<m3_FreeImpl>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @m3_FreeImpl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @m3_FreeImpl(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void imul_reg32(unsigned long reg32) {
  put8(0xF7);
  put8(0xE8 + reg32);
}


x86 assembly (clang, -O0):
<imul_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xe8,%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imul_reg32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xe8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @imul_reg32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 247)
%4 = load i64, i64* %2
%5 = add i64 232, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @imul_reg32(i64 %0) {
%2 = tail call i32 @put8(i32 247)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 232
%5 = tail call i32 @put8(i32 %4)
ret void
}
test() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
int phy_set_channel(unsigned int n) { return 0; }


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

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

LLVM IR (-O0):
define i32 @phy_set_channel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @phy_set_channel(i32 %0) {
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double polar(double a, double b) { return sqrt(a * a + b * b); }


x86 assembly (clang, -O0):
<polar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polar>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <polar+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @polar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @polar(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
void xfs_init_procfs(void) {}


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

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

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

LLVM IR (-O2):
define void @xfs_init_procfs() {
ret void
}
/* Variables and functions */
unsigned int M_PI;
float sqrtf(unsigned int);
float calc_radius(unsigned int mass) { return sqrtf(mass / M_PI); }


x86 assembly (clang, -O0):
<calc_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    %eax,%edi
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_radius>:
mov    %edi,%eax
mov    0x2ecf(%rip),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    %eax,%edi
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define float @calc_radius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @M_PI
%5 = udiv i32 %3, %4
%6 = call float @sqrtf(i32 %5)
ret float %6
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @calc_radius(i32 %0) {
%2 = load i32, i32* @M_PI
%3 = udiv i32 %0, %2
%4 = tail call float @sqrtf(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ LcdWrite(int /*<<< orphan*/, int);
void gotoXY(int x, int y) {
  LcdWrite(0, 0x80 | x);
  LcdWrite(0, 0x40 | y);
}


x86 assembly (clang, -O0):
<gotoXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
or     $0x80,%esi
xor    %edi,%edi
call   1030 <LcdWrite@plt>
mov    -0x8(%rbp),%esi
or     $0x40,%esi
xor    %edi,%edi
call   1030 <LcdWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoXY>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
or     $0x80,%esi
xor    %edi,%edi
call   1030 <LcdWrite@plt>
or     $0x40,%ebx
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <LcdWrite@plt>

LLVM IR (-O0):
define void @gotoXY(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 = or i32 128, %5
%7 = call i32 @LcdWrite(i32 0, i32 %6)
%8 = load i32, i32* %4
%9 = or i32 64, %8
%10 = call i32 @LcdWrite(i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @gotoXY(i32 %0, i32 %1) {
%3 = or i32 %0, 128
%4 = tail call i32 @LcdWrite(i32 0, i32 %3)
%5 = or i32 %1, 64
%6 = tail call i32 @LcdWrite(i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void init_thread(void *targ, void *(*thdrtn)(void *)) {
  fprintf(stderr, "[LDM] ");
  fprintf(stderr, "Running the No-Op Thread Constructor!\n");
}


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

x86 assembly (clang, -O2):
<init_thread>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed8(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"[LDM] \00"
@.str.1 = [39 x i8] c"Running the No-Op Thread Constructor!\0A\00"
define void @init_thread(i8* %0, i8* (i8*)* %1) {
%3 = alloca i8*
%4 = alloca i8* (i8*)*
store i8* %0, i8** %3
store i8* (i8*)* %1, i8* (i8*)** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"[LDM] \00"
@.str.1 = [39 x i8] c"Running the No-Op Thread Constructor!\0A\00"
define void @init_thread(i8* nocapture readnone %0, i8* (i8*)* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float metros;
  printf("Insira a quantidade de metros: \n");
  scanf("%f", &metros);
  printf("O valor em milimentros é: %.2f\n", (metros * 1000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xea4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Insira a quantidade de metros: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"O valor em milimentros \C3\A9: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fmul float %5, 1.000000e+03
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"O valor em milimentros \C3\A9: %.2f\0A\00"
@str = [32 x i8] c"Insira a quantidade de metros: \00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 1.000000e+03
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
void PITCH_LockEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @PITCH_LockEnd() {
ret void
}
char opponent(char color) {
  switch (color) {
  case (0):
    return (1 << 3);
  case (1 << 3):
    return (0);
  }
  return -1;
}


x86 assembly (clang, -O0):
<opponent>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112f <opponent+0x2f>
jmp    111e <opponent+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     1138 <opponent+0x38>
jmp    1141 <opponent+0x41>
movb   $0x8,-0x1(%rbp)
jmp    1145 <opponent+0x45>
movb   $0x0,-0x1(%rbp)
jmp    1145 <opponent+0x45>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opponent>:
cmp    $0x8,%dil
setne  %al
neg    %al
test   %dil,%dil
movzbl %al,%ecx
mov    $0x8,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @opponent(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 0, label %6
i32 8, label %7
]
6: ; preds = %1
store i8 8, i8* %2
br label %9
7: ; preds = %1
store i8 0, i8* %2
br label %9
8: ; preds = %1
store i8 -1, i8* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @opponent(i8 signext %0) {
%2 = icmp ne i8 %0, 8
%3 = sext i1 %2 to i8
%4 = icmp eq i8 %0, 0
%5 = select i1 %4, i8 8, i8 %3
ret i8 %5
}
void foo_2_2_1_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_2_2_2_1() {
ret void
}
float f1(float x) { return 1 / x; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @f1(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ OutputByte(unsigned char);
void OutputWord(int value) {
  OutputByte((unsigned char)(value % 0x100));
  OutputByte((unsigned char)(value / 0x100));
}


x86 assembly (clang, -O0):
<OutputWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movzbl %al,%edi
call   1030 <OutputByte@plt>
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
movzbl %al,%edi
call   1030 <OutputByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutputWord>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <OutputByte@plt>
lea    0xff(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
movzbl %ah,%edi
pop    %rbx
jmp    1030 <OutputByte@plt>

LLVM IR (-O0):
define void @OutputWord(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 256
%5 = trunc i32 %4 to i8
%6 = call i32 @OutputByte(i8 zeroext %5)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 256
%9 = trunc i32 %8 to i8
%10 = call i32 @OutputByte(i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @OutputWord(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @OutputByte(i8 zeroext %2)
%4 = sdiv i32 %0, 256
%5 = trunc i32 %4 to i8
%6 = tail call i32 @OutputByte(i8 zeroext %5)
ret void
}
int h(int a[100][1000], float b[][222]) {}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @h([1000 x i32]* %0, [222 x float]* %1) {
%3 = alloca i32
%4 = alloca [1000 x i32]*
%5 = alloca [222 x float]*
store [1000 x i32]* %0, [1000 x i32]** %4
store [222 x float]* %1, [222 x float]** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @h([1000 x i32]* nocapture readnone %0, [222 x float]* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
unsigned long timer_end(struct timespec start_time) { return 0; }


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

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @timer_end(i32 %0) {
%2 = alloca %struct.timespec
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %0, i32* %3
ret i64 0
}

LLVM IR (-O2):
define i64 @timer_end(i32 %0) {
ret i64 0
}