xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage:\n");
  printf("disnix-proxy source_port destination_hostname destination_port "
         "lock_filename\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [78 x i8] c"disnix-proxy source_port destination_hostname destination_port lock_filename\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [77 x i8] c"disnix-proxy source_port destination_hostname destination_port lock_filename\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ warn(char *, char *, int);
void ignore(int sig) {
  if (sig != 0)
    warn("ignore", "MegaHAL received signal %d", sig);
}


x86 assembly (clang, -O0):
<ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113b <ignore+0x2b>
mov    -0x4(%rbp),%edx
lea    0xed1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <warn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore>:
test   %edi,%edi
je     1129 <ignore+0x19>
mov    %edi,%edx
lea    0xee3(%rip),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <warn@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ignore\00"
@.str.1 = [27 x i8] c"MegaHAL received signal %d\00"
define void @ignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ignore\00"
@.str.1 = [27 x i8] c"MegaHAL received signal %d\00"
define void @ignore(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
int noop2(int *par1, int *par2) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @noop2(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x6c() {
  Assert_real((isspace(108) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              545, ("isspace should be 0 for l"));
}


x86 assembly (clang, -O0):
<t_isspace_0x6c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6c,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x221,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x6c>:
push   %rax
mov    $0x6c,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x221,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for l\00"
define void @t_isspace_0x6c() {
%1 = call i64 @isspace(i32 108)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for l\00"
define void @t_isspace_0x6c() {
%1 = tail call i64 @isspace(i32 108)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ returnValueFromMethod(int);
void interpretReturnTrueFromMethod(int context) {
  returnValueFromMethod((10 << 2));
}


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

x86 assembly (clang, -O2):
<interpretReturnTrueFromMethod>:
mov    $0x28,%edi
jmp    1030 <returnValueFromMethod@plt>

LLVM IR (-O0):
define void @interpretReturnTrueFromMethod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @returnValueFromMethod(i32 40)
ret void
}

LLVM IR (-O2):
define void @interpretReturnTrueFromMethod(i32 %0) {
%2 = tail call i32 @returnValueFromMethod(i32 40)
ret void
}
int isSmaller(int valve, int data) { return (data < valve); }


x86 assembly (clang, -O0):
<isSmaller>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSmaller>:
xor    %eax,%eax
cmp    %edi,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @isSmaller(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isSmaller(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void __cyg_profile_func_exit(void *this, void *callsite) {
  printf("Exit %p\n", (int *)this);
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Exit %p\0A\00"
define void @__cyg_profile_func_exit(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 = bitcast i8* %5 to i32*
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Exit %p\0A\00"
define void @__cyg_profile_func_exit(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateClockConfig(unsigned long ulConfig) {
  unsigned long ulHIBCtl;

  ;
  ulHIBCtl = (*((volatile unsigned long *)(0x400FC010)));
  ulHIBCtl &= ~(0x00060000 | 0x00040000 | 0x00010000);
  ulHIBCtl |= ulConfig & (0x00060000 | 0x00040000 | 0x00010000);
  (*((volatile unsigned long *)(0x400FC010))) = ulHIBCtl;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateClockConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fc010,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffff8ffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x70000,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateClockConfig>:
mov    $0xfffffffffff8ffff,%rax
and    0x400fc010,%rax
40
and    $0x70000,%edi
or     %rax,%rdi
mov    %rdi,0x400fc010
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateClockConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = and i64 %5, -458753
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = and i64 %7, 458752
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %3
store volatile i64 %11, i64* inttoptr (i64 1074774032 to i64*)
%12 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateClockConfig(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -458753
%4 = and i64 %0, 458752
%5 = or i64 %3, %4
store volatile i64 %5, i64* inttoptr (i64 1074774032 to i64*)
%6 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
void gdk_axis_use_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_axis_use_get_type() {
ret void
}
flt(x, y) long long int x;
long long int y;
{
  if (x < y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<flt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1126 <flt+0x26>
movl   $0xd,-0x4(%rbp)
jmp    112d <flt+0x2d>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt>:
cmp    %rsi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @flt(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @flt(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i32 13, i32 140
ret i32 %4
}
void PUT_BTS(r) int r;
{
  int i;
  i = 32;
  while (i > 0) {
    printf("%d", (((r >> (i - 1)) % 2) + 2) % 2);
    i--;
  }
}


x86 assembly (clang, -O0):
<PUT_BTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116a <PUT_BTS+0x5a>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PUT_BTS+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUT_BTS>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x21,%ebx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%ecx
mov    %ebp,%esi
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <PUT_BTS+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @PUT_BTS(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 32, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, -1
%5 = lshr i32 %0, %4
%6 = and i32 %5, 1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp ugt i32 %3, 1
br i1 %8, label %2, label %9
9: ; preds = %2
ret void
}
int calc_hash(unsigned char *p) {
  int h = 0;
  while (*p) {
    h = (h << 1) + (h >> 3) + (h >> 5) + (h >> 8);
    h += *p++;
  }
  return h & 15;
}


x86 assembly (clang, -O0):
<calc_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <calc_hash+0x5a>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <calc_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113a <calc_hash+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
sar    $0x3,%edx
lea    (%rdx,%rax,2),%edx
mov    %eax,%esi
sar    $0x5,%esi
add    %edx,%esi
sar    $0x8,%eax
mov    %eax,%edx
add    %esi,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calc_hash+0x10>
and    $0xf,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %22, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i32 [ %17, %4 ], [ 0, %1 ]
%7 = phi i8* [ %15, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = ashr i32 %6, 3
%10 = add nsw i32 %8, %9
%11 = ashr i32 %6, 5
%12 = add nsw i32 %10, %11
%13 = ashr i32 %6, 8
%14 = add nsw i32 %12, %13
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = zext i8 %5 to i32
%17 = add nsw i32 %14, %16
%18 = load i8, i8* %15
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4
%21 = and i32 %17, 15
br label %22
22: ; preds = %20, %1
%23 = phi i32 [ 0, %1 ], [ %21, %20 ]
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ statusmsg(char *);
void mainhelp(void) { statusmsg("Use arrow keys and Enter to select"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Use arrow keys and Enter to select\00"
define void @mainhelp() {
%1 = call i32 @statusmsg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Use arrow keys and Enter to select\00"
define void @mainhelp() {
%1 = tail call i32 @statusmsg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
void maximum2INT(int i) {}


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

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

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

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

/* Variables and functions */
void WatchdogLock(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000C00))) = 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogLock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc00,%eax
cltq
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLock>:
movslq %edi,%rax
movl   $0x1,0xc00(%rax)
ret

LLVM IR (-O0):
define void @WatchdogLock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3072
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @WatchdogLock(i32 %0) {
%2 = add nsw i32 %0, 3072
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 1, i32* %4
ret void
}
/* Variables and functions */
void *emu_alloc_mem(size_t, int);
void *emu_malloc(size_t size) { return emu_alloc_mem(size, 8); }


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

x86 assembly (clang, -O2):
<emu_malloc>:
mov    $0x8,%esi
jmp    1030 <emu_alloc_mem@plt>

LLVM IR (-O0):
define i8* @emu_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @emu_alloc_mem(i64 %3, i32 8)
ret i8* %4
}

LLVM IR (-O2):
define i8* @emu_malloc(i64 %0) {
%2 = tail call i8* @emu_alloc_mem(i64 %0, i32 8)
ret i8* %2
}
int NZD(int m, int n) {
  if (!n) {
    return m;
  }
  return NZD(n, m % n);
}


x86 assembly (clang, -O0):
<NZD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <NZD+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <NZD+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <NZD@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NZD>:
mov    %edi,%eax
test   %esi,%esi
je     111d <NZD+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <NZD+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @NZD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @NZD(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @NZD(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
char *strchr(char *, char);
void GetUserAndHost(char **user, char **host) {
  char *ch;
  if ((ch = strchr(*user, '@'))) {
    *ch++ = '\0';
    *host = ch;
  } else {
    *host = *user;
    *user = NULL;
  }
}


x86 assembly (clang, -O0):
<GetUserAndHost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1161 <GetUserAndHost+0x51>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    117a <GetUserAndHost+0x6a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUserAndHost>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113f <GetUserAndHost+0x2f>
mov    %rax,%rcx
add    $0x1,%rcx
movb   $0x0,(%rax)
mov    %rcx,(%r14)
jmp    1149 <GetUserAndHost+0x39>
mov    %rbx,(%r14)
movq   $0x0,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @GetUserAndHost(i8** nocapture %0, i8** nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i8 signext 64)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %4
store i8* %7, i8** %1
br label %9
8: ; preds = %2
store i8* %3, i8** %1
store i8* null, i8** %0
br label %9
9: ; preds = %8, %6
ret void
}
void Em_EEPROM_1_Start(void) {}


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

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

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

LLVM IR (-O2):
define void @Em_EEPROM_1_Start() {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t i;
  for (i = 0; s[i]; i++) {
    ;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ instruction_count_init();
int /*<<< orphan*/ loop();
int /*<<< orphan*/ plus();
int main(int argc, char *argv[]) {
  instruction_count_init();
  plus();
  loop();
  return EXIT_SUCCESS;
}


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   1050 <instruction_count_init@plt>
mov    $0x0,%al
call   1030 <plus@plt>
mov    $0x0,%al
call   1040 <loop@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <instruction_count_init@plt>
xor    %eax,%eax
call   1030 <plus@plt>
xor    %eax,%eax
call   1040 <loop@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = 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 (...) @instruction_count_init()
%7 = call i32 (...) @plus()
%8 = call i32 (...) @loop()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @instruction_count_init()
%4 = tail call i32 (...) @plus()
%5 = tail call i32 (...) @loop()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
void set_disk_ro(struct gendisk *disk, int flag) { return; }


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

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

LLVM IR (-O0):
%struct.gendisk = type opaque
define void @set_disk_ro(%struct.gendisk* %0, i32 %1) {
%3 = alloca %struct.gendisk*
%4 = alloca i32
store %struct.gendisk* %0, %struct.gendisk** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.gendisk = type opaque
define void @set_disk_ro(%struct.gendisk* nocapture %0, i32 %1) {
ret void
}
int g(int a, int *b, int *d) {
  int c = ~(a);
  *b = c;
  if (c <= 0)
    *d = c;
  return c;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x1c(%rbp)
jg     1134 <g+0x34>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
cmp    $0xffffffff,%edi
not    %eax
mov    %eax,(%rsi)
jl     110d <g+0xd>
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define i32 @g(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32*, i32** %5
store i32 %10, i32* %11
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %7
%16 = load i32*, i32** %6
store i32 %15, i32* %16
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = xor i32 %0, -1
store i32 %4, i32* %1
%5 = icmp sgt i32 %0, -2
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 %4, i32* %2
br label %7
7: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  if (n >= 0)
    printf("The input value is >= 0\n");
  else
    printf("The input value is negative\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xee1(%rip),%rax
lea    0xebe(%rip),%rdi
cmovns %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [25 x i8] c"The input value is >= 0\0A\00"
@.str.2 = [29 x i8] c"The input value is negative\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [28 x i8] c"The input value is negative\00"
@str.3 = [24 x i8] c"The input value is >= 0\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 = load i32, i32* %1
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_xattrib_mod(struct yaffs_obj *, int /*<<< orphan*/, char const *,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int yaffs_remove_xattrib(struct yaffs_obj *obj, const char *name) {
  return yaffs_do_xattrib_mod(obj, 0, name, (0), 0, 0);
}


x86 assembly (clang, -O0):
<yaffs_remove_xattrib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <yaffs_do_xattrib_mod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_remove_xattrib>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <yaffs_do_xattrib_mod@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_remove_xattrib(%struct.yaffs_obj* %0, i8* %1) {
%3 = alloca %struct.yaffs_obj*
%4 = alloca i8*
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %3
store i8* %1, i8** %4
%5 = load %struct.yaffs_obj*, %struct.yaffs_obj** %3
%6 = load i8*, i8** %4
%7 = call i32 @yaffs_do_xattrib_mod(%struct.yaffs_obj* %5, i32 0, i8* %6, i32 0, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_remove_xattrib(%struct.yaffs_obj* %0, i8* %1) {
%3 = tail call i32 @yaffs_do_xattrib_mod(%struct.yaffs_obj* %0, i32 0, i8* %1, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int close(int);
int i2c_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<i2c_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void time_travel_set_timer_expiry(unsigned long long expiry) {}


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

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

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

LLVM IR (-O2):
define void @time_travel_set_timer_expiry(i64 %0) {
ret void
}
mymmisc(type, leng, mess) int type, leng;
char *mess;
{
  prtime();
  printf("Meta 0x%02x", type);
  prhex(mess, leng);
}


x86 assembly (clang, -O0):
<mymmisc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <prtime@plt>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <prhex@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymmisc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <prtime@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <prhex@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Meta 0x%02x\00"
define i32 @mymmisc(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @prhex to i32 (i8*, i32, ...)*)(i8* %11, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"Meta 0x%02x\00"
define i32 @mymmisc(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (...) @prtime()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @prhex to i32 (i8*, i32, ...)*)(i8* %2, i32 %1)
ret i32 undef
}
void toggle_bit(void *data, const unsigned int i) {
  ((unsigned int *)data)[i >> 5] ^= (1 << (i & 31));
}


x86 assembly (clang, -O0):
<toggle_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%ecx
mov    %ecx,%ecx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%ecx
xor    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @toggle_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %4
%11 = lshr i32 %10, 5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = xor i32 %14, %7
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @toggle_bit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = bitcast i8* %0 to i32*
%6 = lshr i32 %1, 5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = xor i32 %9, %4
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgau1(double *, int, double *, double *, int, int);
void cgau1_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau1(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau1_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau1_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau1@plt>

LLVM IR (-O0):
define void @cgau1_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @cgau1(double* %11, i32 %12, double* %13, double* %17, i32 %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @cgau1_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau1(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
int uh_tls_init(const char *key, const char *crt) { return -1; }


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

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

LLVM IR (-O0):
define i32 @uh_tls_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @uh_tls_init(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
void ff_hevc_put_hevc_bi_qpel_v12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v12_10_sse4() {
ret void
}
void rop3_65_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_65_0_1>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%r8b
or     %r8b,%al
not    %al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_65_0_1(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* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or 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 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_65_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %9, %7
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function_three() {
  printf("This is function THREE\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<function_three>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"This is function THREE\0A\00"
define i32 @function_three() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"This is function THREE\00"
define i32 @function_three() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_35int64_midword_reg(long long val) {
  return ((val >> 16) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x35,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_35int64_midword_reg>:
test   $0x350000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_35int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3473408
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ output;

/* Variables and functions */
char *crypt_gensalt_rn(char const *, unsigned long, char const *, int, char *,
                       int);
char *bcrypt_gensalt(const char *prefix, unsigned long count, const char *input,
                     int size) {
  static char output[(7 + 22 + 1)];
  return crypt_gensalt_rn(prefix, count, input, size, output, sizeof(output));
}


x86 assembly (clang, -O0):
<bcrypt_gensalt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0x2f03(%rip),%r8
mov    $0x1e,%r9d
call   1030 <crypt_gensalt_rn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcrypt_gensalt>:
lea    0x2f29(%rip),%r8
mov    $0x1e,%r9d
jmp    1030 <crypt_gensalt_rn@plt>

LLVM IR (-O0):
@bcrypt_gensalt.output = internal global [30 x i8] zeroinitializer
define i8* @bcrypt_gensalt(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i8* @crypt_gensalt_rn(i8* %9, i64 %10, i8* %11, i32 %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @bcrypt_gensalt.output, i64 0, i64 0), i32 30)
ret i8* %13
}

LLVM IR (-O2):
@bcrypt_gensalt.output = internal global [30 x i8] zeroinitializer
define i8* @bcrypt_gensalt(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @crypt_gensalt_rn(i8* %0, i64 %1, i8* %2, i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @bcrypt_gensalt.output, i64 0, i64 0), i32 30)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ first(size_t);
int /*<<< orphan*/ second(size_t);
int /*<<< orphan*/ third(char *, size_t);
void decorate(char *str, size_t len) {
  first(len);
  second(len);
  third(str, len);
  second(len);
  first(len);
}


x86 assembly (clang, -O0):
<decorate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <first@plt>
mov    -0x10(%rbp),%rdi
call   1040 <second@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <third@plt>
mov    -0x10(%rbp),%rdi
call   1040 <second@plt>
mov    -0x10(%rbp),%rdi
call   1050 <first@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decorate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <first@plt>
mov    %rbx,%rdi
call   1040 <second@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <third@plt>
mov    %rbx,%rdi
call   1040 <second@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <first@plt>

LLVM IR (-O0):
define void @decorate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @first(i64 %5)
%7 = load i64, i64* %4
%8 = call i32 @second(i64 %7)
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @third(i8* %9, i64 %10)
%12 = load i64, i64* %4
%13 = call i32 @second(i64 %12)
%14 = load i64, i64* %4
%15 = call i32 @first(i64 %14)
ret void
}

LLVM IR (-O2):
define void @decorate(i8* %0, i64 %1) {
%3 = tail call i32 @first(i64 %1)
%4 = tail call i32 @second(i64 %1)
%5 = tail call i32 @third(i8* %0, i64 %1)
%6 = tail call i32 @second(i64 %1)
%7 = tail call i32 @first(i64 %1)
ret void
}
void test___atomic_add_fetch_1(short *mem) { __atomic_add_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_add_fetch_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,%ax
lock xadd %ax,(%rdx)
add    %cx,%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_add_fetch_1>:
lock addw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_add_fetch_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw add i16* %5, i16 %6 acq_rel
%8 = add i16 %7, %6
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_add_fetch_1(i16* nocapture %0) {
%2 = atomicrmw add i16* %0, i16 1 acq_rel
ret void
}