xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test02(unsigned int a, unsigned int b) {
  unsigned int x = 0x80000000;
  if (a > x)
    if (b < x)
      if (a == b)
        link_error();
}


x86 assembly (clang, -O0):
<test02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x80000000,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    115a <test02+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1155 <test02+0x45>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1150 <test02+0x40>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1155 <test02+0x45>
jmp    115a <test02+0x4a>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test02(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -2147483648, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %5
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (...) @link_error()
br label %19
19: ; preds = %17, %13
br label %20
20: ; preds = %19, %9
br label %21
21: ; preds = %20, %2
ret void
}

LLVM IR (-O2):
define void @test02(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vp8_sub_pixel_variance16x16_c(unsigned char const *, int,
                                                 int, int,
                                                 unsigned char const *, int,
                                                 unsigned int *);
unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char *src_ptr,
                                      int src_pixels_per_line, int xoffset,
                                      int yoffset, const unsigned char *dst_ptr,
                                      int dst_pixels_per_line,
                                      unsigned int *sse) {
  vp8_sub_pixel_variance16x16_c(src_ptr, src_pixels_per_line, xoffset, yoffset,
                                dst_ptr, dst_pixels_per_line, sse);
  return *sse;
}


x86 assembly (clang, -O0):
<vp8_sub_pixel_mse16x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sub_pixel_mse16x16_c>:
push   %rbx
sub    $0x10,%rsp
mov    0x20(%rsp),%rbx
mov    %rbx,(%rsp)
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vp8_sub_pixel_mse16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i8*, i8** %12
%20 = load i32, i32* %13
%21 = load i32*, i32** %14
%22 = call i32 @vp8_sub_pixel_variance16x16_c(i8* %15, i32 %16, i32 %17, i32 %18, i8* %19, i32 %20, i32* %21)
%23 = load i32*, i32** %14
%24 = load i32, i32* %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @vp8_sub_pixel_mse16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6) {
%8 = tail call i32 @vp8_sub_pixel_variance16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6)
%9 = load i32, i32* %6
ret i32 %9
}
/* Variables and functions */
scalar_t__ remquo(double, double, int *);
long double remquol(long double x, long double y, int *quo) {
  return (long double)remquo((double)x, (double)y, quo);
}


x86 assembly (clang, -O0):
<remquol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm1
mov    -0x28(%rbp),%rdi
call   1030 <remquo@plt>
mov    %rax,-0x30(%rbp)
fildll -0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquol>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <remquo@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32*
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store i32* %2, i32** %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = load x86_fp80, x86_fp80* %5
%10 = fptrunc x86_fp80 %9 to double
%11 = load i32*, i32** %6
%12 = call i64 @remquo(double %8, double %10, i32* %11)
%13 = sitofp i64 %12 to x86_fp80
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = fptrunc x86_fp80 %0 to double
%5 = fptrunc x86_fp80 %1 to double
%6 = tail call i64 @remquo(double %4, double %5, i32* %2)
%7 = sitofp i64 %6 to x86_fp80
ret x86_fp80 %7
}
unsigned long CRCdwGetCrc32(unsigned char *pbyData, unsigned int cbByte) {
  return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL);
}


x86 assembly (clang, -O0):
<CRCdwGetCrc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <CRCdwCrc32@plt>
xor    $0xffffffff,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRCdwGetCrc32>:
push   %rax
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <CRCdwCrc32@plt>
not    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @CRCdwGetCrc32(i8* %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 = load i32, i32* %4
%7 = call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @CRCdwCrc32 to i32 (i8*, i32, i64, ...)*)(i8* %5, i32 %6, i64 4294967295)
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @CRCdwGetCrc32(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @CRCdwCrc32 to i32 (i8*, i32, i64, ...)*)(i8* %0, i32 %1, i64 4294967295)
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *copy_string(char *str) {
  int len = strlen(str);
  char *mystr = (char *)malloc(sizeof(char) * (len + 1));
  strcpy(mystr, str);
  return mystr;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @copy_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void strv_print(char **l) {
  char **s;
  for ((s) = (l); (s) && *(s); (s)++)
    puts(*s);
}


x86 assembly (clang, -O0):
<strv_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1142 <strv_print+0x32>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <strv_print+0x42>
jmp    116f <strv_print+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strv_print+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_print>:
push   %rbx
test   %rdi,%rdi
je     1141 <strv_print+0x31>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <strv_print+0x31>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <strv_print+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @strv_print(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
store i8** %4, i8*** %3
br label %5
5: ; preds = %18, %1
%6 = load i8**, i8*** %3
%7 = icmp ne i8** %6, null
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %14
%19 = load i8**, i8*** %3
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %3
br label %5
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @strv_print(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @puts(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("The user logged in is %s\n", getlogin());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getlogin@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"The user logged in is %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @getlogin()
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"The user logged in is %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(2);
  printf("Hello, world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @sleep(i32 2)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void _Jv__mcmp(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv__mcmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_times;
int /*<<< orphan*/ puts(char *);
int syscall(int /*<<< orphan*/, int);
int main(void) {
  if (syscall(__NR_times, 0x42) != -1)
    return 77;
  puts("times(0x42) = -1 EFAULT (Bad address)");
  puts("+++ exited with 0 +++");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    $0x42,%esi
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
je     1157 <main+0x37>
movl   $0x4d,-0x4(%rbp)
jmp    1176 <main+0x56>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    $0x42,%esi
call   1040 <syscall@plt>
mov    %eax,%ecx
mov    $0x4d,%eax
cmp    $0xffffffff,%ecx
je     1142 <main+0x22>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__NR_times = global i32 0
@.str = [38 x i8] c"times(0x42) = -1 EFAULT (Bad address)\00"
@.str.1 = [22 x i8] c"+++ exited with 0 +++\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @__NR_times
%3 = call i32 @syscall(i32 %2, i32 66)
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 77, i32* %1
br label %9
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@__NR_times = global i32 0
@.str = [38 x i8] c"times(0x42) = -1 EFAULT (Bad address)\00"
@.str.1 = [22 x i8] c"+++ exited with 0 +++\00"
define i32 @main() {
%1 = load i32, i32* @__NR_times
%2 = tail call i32 @syscall(i32 %1, i32 66)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 0, %4 ], [ 77, %0 ]
ret i32 %8
}
/* Type definitions */
struct sysrq_key_op {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int unregister_sysrq_key(int key, struct sysrq_key_op *op) { return -EINVAL; }


x86 assembly (clang, -O0):
<unregister_sysrq_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unregister_sysrq_key>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.sysrq_key_op = type { i32 }
@EINVAL = global i32 0
define i32 @unregister_sysrq_key(i32 %0, %struct.sysrq_key_op* %1) {
%3 = alloca i32
%4 = alloca %struct.sysrq_key_op*
store i32 %0, i32* %3
store %struct.sysrq_key_op* %1, %struct.sysrq_key_op** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.sysrq_key_op = type { i32 }
@EINVAL = global i32 0
define i32 @unregister_sysrq_key(i32 %0, %struct.sysrq_key_op* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
char getc_raw();
int /*<<< orphan*/ syscall_write(int, char *, int);
int getc(void) {
  char c = getc_raw();
  syscall_write(1, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getc_raw@plt>
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <syscall_write@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rax
xor    %eax,%eax
call   1040 <getc_raw@plt>
mov    %al,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <syscall_write@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getc() {
%1 = alloca i8
%2 = call signext i8 (...) @getc_raw()
store i8 %2, i8* %1
%3 = call i32 @syscall_write(i32 1, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @getc() {
%1 = alloca i8
%2 = tail call signext i8 (...) @getc_raw()
store i8 %2, i8* %1
%3 = call i32 @syscall_write(i32 1, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega8_PB5_clear__E();
void pollen_hardware_Led_off__E() {
  { atmel_atmega8_PB5_clear__E(); }
}


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

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

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

LLVM IR (-O2):
define void @pollen_hardware_Led_off__E() {
%1 = tail call i32 (...) @atmel_atmega8_PB5_clear__E()
ret void
}
void instruc_23() {}


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

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

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

LLVM IR (-O2):
define void @instruc_23() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doexit(int /*<<< orphan*/);
int /*<<< orphan*/ errpkt(char *);
sigint() {
  errpkt("User typed ^C");
  doexit(0);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <errpkt@plt>
xor    %edi,%edi
call   1040 <doexit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <errpkt@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <doexit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"User typed ^C\00"
define i32 @sigint() {
%1 = alloca i32
%2 = call i32 @errpkt(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @doexit(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"User typed ^C\00"
define i32 @sigint() {
%1 = tail call i32 @errpkt(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @doexit(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int code) {
  printf("Usage: fchk <file>\n");
  exit(code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: fchk <file>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [19 x i8] c"Usage: fchk <file>\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ printf(char *);
void printMessage() {
  printf("That's what it's all about!\n");
  msleep(1000);
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e8,%edi
call   1030 <msleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <msleep@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"That's what it's all about!\0A\00"
define void @printMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @msleep(i32 1000)
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"That's what it's all about!\00"
define void @printMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @msleep(i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *path) {
  printf("Usage: %s path_to_libcrypto\n", path);
  printf("please specify correct path for libcrypto library\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: %s path_to_libcrypto\0A\00"
@.str.1 = [51 x i8] c"please specify correct path for libcrypto library\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: %s path_to_libcrypto\0A\00"
@str = [50 x i8] c"please specify correct path for libcrypto library\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
double sin(double);
double a2r_mirr(double A, double K) { return sin(0.5 * A); }


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

x86 assembly (clang, -O2):
<a2r_mirr>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @a2r_mirr(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 = fmul double 5.000000e-01, %5
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
define double @a2r_mirr(double %0, double %1) {
%3 = fmul double %0, 5.000000e-01
%4 = tail call double @sin(double %3)
ret double %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, char *, char *, char *);
void mumble_version_callback(uint16_t major, uint8_t minor, uint8_t patch,
                             char *release, char *os, char *os_version,
                             void *user_data) {
  printf("Version Callback: v%d.%d.%d. %s/%s/%s\n", major, minor, patch,
         release, os, os_version);
}


x86 assembly (clang, -O0):
<mumble_version_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
lea    0xeb3(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumble_version_callback>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    %r9,(%rsp)
lea    0xed8(%rip),%rdi
mov    %rax,%r9
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Version Callback: v%d.%d.%d. %s/%s/%s\0A\00"
define void @mumble_version_callback(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i8*, i8** %13
%21 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i8* %18, i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Version Callback: v%d.%d.%d. %s/%s/%s\0A\00"
define void @mumble_version_callback(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* nocapture readnone %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5)
ret void
}
int test_imm_20int8_mem(signed char *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %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_20int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 32
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GetIdent(char *);
char *MyStrDup(char *);
char *GetErrId(void) {
  char s[32 + 1];
  GetIdent(s);
  return MyStrDup(s);
}


x86 assembly (clang, -O0):
<GetErrId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <GetIdent@plt>
lea    -0x30(%rbp),%rdi
call   1040 <MyStrDup@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetErrId>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <GetIdent@plt>
mov    %rbx,%rdi
call   1040 <MyStrDup@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @GetErrId() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetIdent(i8* %2)
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%5 = call i8* @MyStrDup(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @GetErrId() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetIdent(i8* %2)
%4 = call i8* @MyStrDup(i8* %2)
ret i8* %4
}
void global_filetable_add(struct file *filp) {}


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

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

LLVM IR (-O0):
%struct.file = type opaque
define void @global_filetable_add(%struct.file* %0) {
%2 = alloca %struct.file*
store %struct.file* %0, %struct.file** %2
ret void
}

LLVM IR (-O2):
%struct.file = type opaque
define void @global_filetable_add(%struct.file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Broadcom Bluetooth firmware converter\n"
         "Usage:\n");
  printf("\thex2hcd [options] <file>\n");
  printf("Options:\n"
         "\t-o, --output <file>    Provide firmware output file\n"
         "\t-h, --help             Show help options\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Broadcom Bluetooth firmware converter\0AUsage:\0A\00"
@.str.1 = [27 x i8] c"\09hex2hcd [options] <file>\0A\00"
@.str.2 = [105 x i8] c"Options:\0A\09-o, --output <file> Provide firmware output file\0A\09-h, --help Show help options\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Broadcom Bluetooth firmware converter\0AUsage:\00"
@str.3 = [26 x i8] c"\09hex2hcd [options] <file>\00"
@str.4 = [104 x i8] c"Options:\0A\09-o, --output <file> Provide firmware output file\0A\09-h, --help Show help options\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RB_HALT_SYSTEM;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
int main(int argc, const char *argv[]) {
  sync();
  reboot(RB_HALT_SYSTEM);
  _exit(errno);
}


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    $0x0,%al
call   1040 <sync@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sync@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <reboot@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@RB_HALT_SYSTEM = global i32 0
@errno = global i32 0
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 = call i32 (...) @sync()
%7 = load i32, i32* @RB_HALT_SYSTEM
%8 = call i32 @reboot(i32 %7)
%9 = load i32, i32* @errno
%10 = call i32 @_exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@RB_HALT_SYSTEM = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
%4 = load i32, i32* @RB_HALT_SYSTEM
%5 = tail call i32 @reboot(i32 %4)
%6 = load i32, i32* @errno
%7 = tail call i32 @_exit(i32 %6)
unreachable
}
void Cyc_Absyndump_ignore(void *x) { ; }


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

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

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

LLVM IR (-O2):
define void @Cyc_Absyndump_ignore(i8* nocapture %0) {
ret void
}
int decode(unsigned int a) {
  int r, m;
  m = 1;
  r = 0;
  if (!a)
    return -1;
  while (1) {
    if (a & m)
      return r;
    r++;
    m <<= 1;
  }
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112b <decode+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <decode+0x61>
jmp    1130 <decode+0x30>
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     114a <decode+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <decode+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <decode+0x30>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
test   %edi,%edi
je     112a <decode+0x2a>
xor    %eax,%eax
test   $0x1,%dil
jne    1129 <decode+0x29>
xor    %eax,%eax
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1120 <decode+0x20>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @decode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ 0, %3 ]
%9 = add nuw nsw i32 %8, 1
%10 = shl i32 %7, 1
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ json_next(int /*<<< orphan*/ *);
int main() {
  FILE *json_input = fopen("example.json", "r");
  if (!json_input)
    return -1;
  json_next(json_input);
  fclose(json_input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <main+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <main+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <json_next@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xece(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1160 <main+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <json_next@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"example.json\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 -1, i32* %1
br label %12
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @json_next(i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @fclose(i32* %10)
store i32 0, i32* %1
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"example.json\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @json_next(i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clock_init();
int /*<<< orphan*/ led_green_init();
int /*<<< orphan*/ led_green_toggle();
int /*<<< orphan*/ pwm_init(int /*<<< orphan*/);
int /*<<< orphan*/ time_delay_ms(int);
int /*<<< orphan*/ time_init();
int main(void) {
  clock_init();
  time_init();
  pwm_init(0);
  led_green_init();
  while (1) {
    time_delay_ms(500);
    led_green_toggle();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <clock_init@plt>
mov    $0x0,%al
call   1050 <time_init@plt>
xor    %edi,%edi
call   1080 <pwm_init@plt>
mov    $0x0,%al
call   1060 <led_green_init@plt>
mov    $0x1f4,%edi
call   1030 <time_delay_ms@plt>
mov    $0x0,%al
call   1040 <led_green_toggle@plt>
jmp    118b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <clock_init@plt>
xor    %eax,%eax
call   1050 <time_init@plt>
xor    %edi,%edi
call   1080 <pwm_init@plt>
xor    %eax,%eax
call   1060 <led_green_init@plt>
nopl   (%rax)
mov    $0x1f4,%edi
call   1030 <time_delay_ms@plt>
xor    %eax,%eax
call   1040 <led_green_toggle@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @clock_init()
%3 = call i32 (...) @time_init()
%4 = call i32 @pwm_init(i32 0)
%5 = call i32 (...) @led_green_init()
br label %6
6: ; preds = %0, %6
%7 = call i32 @time_delay_ms(i32 500)
%8 = call i32 (...) @led_green_toggle()
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @clock_init()
%2 = tail call i32 (...) @time_init()
%3 = tail call i32 @pwm_init(i32 0)
%4 = tail call i32 (...) @led_green_init()
br label %5
5: ; preds = %0, %5
%6 = tail call i32 @time_delay_ms(i32 500)
%7 = tail call i32 (...) @led_green_toggle()
br label %5
}
/* Variables and functions */
double asin(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_asin(void) {
  lua_pushnumber(((asin(luaL_check_number(1))) *
                  (180.0 / ((double)3.14159265358979323846))));
}


x86 assembly (clang, -O0):
<math_asin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <asin@plt>
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_asin>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <asin@plt>
mulsd  0xeb6(%rip),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_asin() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call double @asin(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = call i32 @lua_pushnumber(double %3)
ret void
}

LLVM IR (-O2):
define void @math_asin() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call double @asin(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = tail call i32 @lua_pushnumber(double %3)
ret void
}
/* Type definitions */
struct custat {
  int dummy;
};

/* Variables and functions */
int __custom_stat(int, char const *, struct custat *, int /*<<< orphan*/);
int custom_stat(int procfd, const char *name, struct custat *s) {
  return __custom_stat(procfd, name, s, 0);
}


x86 assembly (clang, -O0):
<custom_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <__custom_stat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_stat>:
xor    %ecx,%ecx
jmp    1030 <__custom_stat@plt>

LLVM IR (-O0):
%struct.custat = type { i32 }
define i32 @custom_stat(i32 %0, i8* %1, %struct.custat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.custat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.custat* %2, %struct.custat** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.custat*, %struct.custat** %6
%10 = call i32 @__custom_stat(i32 %7, i8* %8, %struct.custat* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.custat = type { i32 }
define i32 @custom_stat(i32 %0, i8* %1, %struct.custat* %2) {
%4 = tail call i32 @__custom_stat(i32 %0, i8* %1, %struct.custat* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mm_free(char *);
void panet_info_addr_free(char *host, char *service) {
  if (host)
    mm_free(host);
  if (service)
    mm_free(service);
}


x86 assembly (clang, -O0):
<panet_info_addr_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <panet_info_addr_free+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <mm_free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1148 <panet_info_addr_free+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <mm_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panet_info_addr_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     111e <panet_info_addr_free+0xe>
call   1030 <mm_free@plt>
test   %rbx,%rbx
je     112c <panet_info_addr_free+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mm_free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @panet_info_addr_free(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @mm_free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @mm_free(i8* %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @panet_info_addr_free(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @mm_free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @mm_free(i8* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SayA(int, char *);
void NPrintA(int num, int attrib, char *cp) {
  char c;
  c = cp[num];
  cp[num] = 0;
  SayA(attrib, cp);
  cp[num] = c;
}


x86 assembly (clang, -O0):
<NPrintA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <SayA@plt>
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPrintA>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
movslq %edi,%r14
mov    (%rdx,%r14,1),%bpl
movb   $0x0,(%rdx,%r14,1)
mov    %esi,%edi
mov    %rdx,%rsi
call   1030 <SayA@plt>
mov    %bpl,(%rbx,%r14,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @NPrintA(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %6
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = call i32 @SayA(i32 %17, i8* %18)
%20 = load i8, i8* %7
%21 = load i8*, i8** %6
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
ret void
}

LLVM IR (-O2):
define void @NPrintA(i32 %0, i32 %1, i8* %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = load i8, i8* %5
store i8 0, i8* %5
%7 = tail call i32 @SayA(i32 %1, i8* %2)
store i8 %6, i8* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_num_bytes(int /*<<< orphan*/ *);
int BN_num_bytes_not_a_macro(BIGNUM *arg) { return BN_num_bytes(arg); }


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

x86 assembly (clang, -O2):
<BN_num_bytes_not_a_macro>:
jmp    1030 <BN_num_bytes@plt>

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

LLVM IR (-O2):
define i32 @BN_num_bytes_not_a_macro(i32* %0) {
%2 = tail call i32 @BN_num_bytes(i32* %0)
ret i32 %2
}
void sti(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int do_647() { return 647; }


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

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

LLVM IR (-O0):
define i32 @do_647() {
ret i32 647
}

LLVM IR (-O2):
define i32 @do_647() {
ret i32 647
}