xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char **, int, int);
void main(int argc, char **argv) {
  char buffer[517];
  FILE *badfile;
  memset(&buffer, 0x90, 517);
  badfile = fopen("./badfile", "w");
  fwrite(buffer, 517, 1, badfile);
  fclose(badfile);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x220(%rbp),%rdi
mov    $0x90,%esi
mov    $0x205,%edx
call   1040 <memset@plt>
lea    0xe91(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x228(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x228(%rbp),%rcx
mov    $0x205,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x228(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x90,%esi
mov    $0x205,%edx
call   1040 <memset@plt>
lea    0xe9a(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x205,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"./badfile\00"
@.str.1 = [2 x i8] c"w\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [517 x i8]
%6 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [517 x i8]* %5 to i8**
%8 = call i32 @memset(i8** %7, i32 144, i32 517)
%9 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %6
%10 = getelementptr inbounds [517 x i8], [517 x i8]* %5, i64 0, i64 0
%11 = load i32*, i32** %6
%12 = call i32 @fwrite(i8* %10, i32 517, i32 1, i32* %11)
%13 = load i32*, i32** %6
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"./badfile\00"
@.str.1 = [2 x i8] c"w\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [517 x i8]
%4 = getelementptr inbounds [517 x i8], [517 x i8]* %3, i64 0, i64 0
%5 = bitcast [517 x i8]* %3 to i8**
%6 = call i32 @memset(i8** %5, i32 144, i32 517)
%7 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @fwrite(i8* %4, i32 517, i32 1, i32* %7)
%9 = call i32 @fclose(i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *wsk;
  int tab[2][2] = {{12}, {14, 16}};
  wsk = tab[0];
  printf("%d\n", *wsk + 1);
  printf("%d\n", *wsk + 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x3,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tab = [2 x [2 x i32]] [[2 x i32] [i32 12, i32 0], [2 x i32] [i32 14, i32 16]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca [2 x [2 x i32]]
%3 = bitcast [2 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ claw();
int /*<<< orphan*/ lift();
void lift_loop() {
  lift();
  claw();
}


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

x86 assembly (clang, -O2):
<lift_loop>:
push   %rax
xor    %eax,%eax
call   1030 <lift@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <claw@plt>

LLVM IR (-O0):
define void @lift_loop() {
%1 = call i32 (...) @lift()
%2 = call i32 (...) @claw()
ret void
}

LLVM IR (-O2):
define void @lift_loop() {
%1 = tail call i32 (...) @lift()
%2 = tail call i32 (...) @claw()
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const char *s1, const char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned int setbits(unsigned x, int p, int n, unsigned int y) {
  return (((~(~0 << n)) & y) << (p + 1 - n)) |
         (x & ((~(~0 << (p + 1 - n))) | (~0 << (p + 1))));
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    -0x14(%rbp),%ecx
or     %esi,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
and    %eax,%edx
lea    0x1(%rsi),%r8d
mov    %r8d,%eax
sub    %ecx,%eax
mov    %eax,%ecx
shl    %cl,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
not    %esi
or     %esi,%eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = shl i32 -1, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %8
%13 = and i32 %11, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = shl i32 %13, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = shl i32 -1, %23
%25 = xor i32 %24, -1
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
%28 = shl i32 -1, %27
%29 = or i32 %25, %28
%30 = and i32 %19, %29
%31 = or i32 %18, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = and i32 %6, %3
%8 = add nsw i32 %1, 1
%9 = sub nsw i32 %8, %2
%10 = shl i32 %7, %9
%11 = shl nsw i32 -1, %9
%12 = xor i32 %11, -1
%13 = shl nsw i32 -1, %8
%14 = or i32 %13, %12
%15 = and i32 %14, %0
%16 = or i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int pow(double, int);
double tile2lon(int x, int z) { return x / pow(2.0, z) * 360.0 - 180; }


x86 assembly (clang, -O0):
<tile2lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
movsd  0xee1(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tile2lon>:
push   %rbx
mov    %edi,%ebx
movsd  0xee5(%rip),%xmm0
mov    %esi,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed0(%rip),%xmm0
addsd  0xed0(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @tile2lon(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @pow(double 2.000000e+00, i32 %6)
%8 = sdiv i32 %5, %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 3.600000e+02, double -1.800000e+02)
ret double %10
}

LLVM IR (-O2):
define double @tile2lon(i32 %0, i32 %1) {
%3 = tail call i32 @pow(double 2.000000e+00, i32 %1)
%4 = sdiv i32 %0, %3
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 3.600000e+02, double -1.800000e+02)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *,
                          char const *);
void NonSysError(const char *Module, const char *Fct) {
  syslog(LOG_ERR, "%s - %s", Module, Fct);
  exit(-1);
}


x86 assembly (clang, -O0):
<NonSysError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <syslog@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<NonSysError>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <syslog@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [8 x i8] c"%s - %s\00"
define void @NonSysError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_ERR
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [8 x i8] c"%s - %s\00"
define void @NonSysError(i8* %0, i8* %1) {
%3 = load i32, i32* @LOG_ERR
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
int isalnum(int c) {
  if ((c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     111b <isalnum+0x1b>
cmpl   $0x39,-0x8(%rbp)
jle    1143 <isalnum+0x43>
cmpl   $0x41,-0x8(%rbp)
jl     112f <isalnum+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1143 <isalnum+0x43>
cmpl   $0x61,-0x8(%rbp)
jl     114f <isalnum+0x4f>
cmpl   $0x7a,-0x8(%rbp)
jg     114f <isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %21, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 90
br i1 %14, label %21, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %22
21: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %15
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __set_cpsr(unsigned int);
__attribute__((always_)) void irq_restore(unsigned oldCPSR) {
  __set_cpsr(oldCPSR);
}


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

x86 assembly (clang, -O2):
<irq_restore>:
jmp    1030 <__set_cpsr@plt>

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

LLVM IR (-O2):
define void @irq_restore(i32 %0) {
%2 = tail call i32 @__set_cpsr(i32 %0)
ret void
}
const char *_Locale_long_d_t_fmt(struct _Locale_time *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_long_d_t_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_long_d_t_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* null
}
void arrayNull(long long unsigned array[]) {
  for (int i = 0; i < 1001; i++) {
    array[i] = 0;
  }
}


x86 assembly (clang, -O0):
<arrayNull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e9,-0xc(%rbp)
jge    113a <arrayNull+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <arrayNull+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayNull>:
push   %rax
mov    $0x1f48,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @arrayNull(i64* nocapture writeonly %0) {
%2 = bitcast i64* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int is_path_exist(const char *file_path) {
  if (access(file_path, F_OK) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_path_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <is_path_exist+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <is_path_exist+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_path_exist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @is_path_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @is_path_exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int flat_set_persistent(unsigned int relval, unsigned long *p) {
  if (*p) {
    return 0;
  } else {
    if ((relval >> 27) != 2) {
      *p = relval;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<flat_set_persistent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1125 <flat_set_persistent+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1158 <flat_set_persistent+0x58>
mov    -0x8(%rbp),%eax
shr    $0x1b,%eax
cmp    $0x2,%eax
je     114c <flat_set_persistent+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1158 <flat_set_persistent+0x58>
jmp    1151 <flat_set_persistent+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flat_set_persistent>:
mov    %edi,%ecx
and    $0xf8000000,%ecx
xor    %eax,%eax
cmp    $0x10000000,%ecx
je     1122 <flat_set_persistent+0x22>
cmpq   $0x0,(%rsi)
jne    1122 <flat_set_persistent+0x22>
mov    %edi,%eax
mov    %rax,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @flat_set_persistent(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
%6 = load i64*, i64** %5
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = lshr i32 %11, 27
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = load i64*, i64** %5
store i64 %16, i64* %17
store i32 1, i32* %3
br label %20
18: ; preds = %10
br label %19
19: ; preds = %18
store i32 0, i32* %3
br label %20
20: ; preds = %19, %14, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @flat_set_persistent(i32 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp ne i64 %3, 0
%5 = and i32 %0, -134217728
%6 = icmp eq i32 %5, 268435456
%7 = or i1 %6, %4
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = zext i32 %0 to i64
store i64 %9, i64* %1
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %11
}
icomp(p1, p2) int *p1, *p2;
{ return (*p1 - *p2); }


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

x86 assembly (clang, -O2):
<icomp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @icomp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @icomp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_isempty() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_isempty"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_idxset_isempty\00"
define i32 @pa_idxset_isempty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ EISDIR;
scalar_t__ errno;
int rmdir(char const *);
int unlink(char const *);
int remove(const char *pathname) {
  int rv;
  rv = unlink(pathname);
  if (rv == -1 && errno == EISDIR)
    return rmdir(pathname);
  return rv;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    116d <remove+0x4d>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
jne    116d <remove+0x4d>
mov    -0x10(%rbp),%rdi
call   1040 <rmdir@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <remove+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1152 <remove+0x32>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rcx
mov    0x2ea9(%rip),%rdx
mov    $0xffffffff,%eax
cmp    (%rdx),%rcx
jne    1152 <remove+0x32>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rmdir@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EISDIR = global i64 0
define i32 @remove(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EISDIR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @rmdir(i8* %0)
br label %10
10: ; preds = %1, %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ], [ %2, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ Crc16(int /*<<< orphan*/, int /*<<< orphan*/ const *, int);
uint16_t Crc16Array(uint32_t ui32WordLen, const uint32_t *pui32Data) {
  return (Crc16(0, (const uint8_t *)pui32Data, ui32WordLen * 4));
}


x86 assembly (clang, -O0):
<Crc16Array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
shl    $0x2,%edx
xor    %edi,%edi
call   1030 <Crc16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Crc16Array>:
lea    0x0(,%rdi,4),%edx
xor    %edi,%edi
jmp    1030 <Crc16@plt>

LLVM IR (-O0):
define i32 @Crc16Array(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 = mul nsw i32 %6, 4
%8 = call i32 @Crc16(i32 0, i32* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @Crc16Array(i32 %0, i32* %1) {
%3 = shl nsw i32 %0, 2
%4 = tail call i32 @Crc16(i32 0, i32* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int /*<<< orphan*/, int /*<<< orphan*/ *, int,
                               int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void test_first_base_is_zero(void) {
  int8_t input[] = {0};
  int8_t expected[] = {0};
  test_rebase(0, input, (sizeof(input) / sizeof(input[0])), 10, expected, 0);
}


x86 assembly (clang, -O0):
<test_first_base_is_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%r8
xor    %r9d,%r9d
mov    $0x1,%edx
mov    $0xa,%ecx
mov    %r9d,%edi
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_first_base_is_zero>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
xor    %edi,%edi
mov    $0x1,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_first_base_is_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 0, i32* %5, i32 1, i32 10, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_first_base_is_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 0, i32* %4
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = call i32 @test_rebase(i32 0, i32* %4, i32 1, i32 10, i32* %6, i32 0)
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_wake_queue(struct net_device *);
void acx_wake_queue(struct net_device *ndev, const char *msg) {
  netif_wake_queue(ndev);
  if (msg)
    ;
}


x86 assembly (clang, -O0):
<acx_wake_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <netif_wake_queue@plt>
cmpq   $0x0,-0x10(%rbp)
je     1139 <acx_wake_queue+0x29>
jmp    1139 <acx_wake_queue+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acx_wake_queue>:
jmp    1030 <netif_wake_queue@plt>

LLVM IR (-O0):
%struct.net_device = type { i32 }
define void @acx_wake_queue(%struct.net_device* %0, i8* %1) {
%3 = alloca %struct.net_device*
%4 = alloca i8*
store %struct.net_device* %0, %struct.net_device** %3
store i8* %1, i8** %4
%5 = load %struct.net_device*, %struct.net_device** %3
%6 = call i32 @netif_wake_queue(%struct.net_device* %5)
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @acx_wake_queue(%struct.net_device* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @netif_wake_queue(%struct.net_device* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
scalar_t__ pthread_condattr_init(int /*<<< orphan*/ *);
scalar_t__ test_status_destroyed(int /*<<< orphan*/ *);
int main(void) {
  pthread_cond_t condvar;
  pthread_condattr_t attr;
  int result = 1;
  if (pthread_condattr_init(&attr) == 0 && test_status_destroyed(&condvar) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_condattr_init@plt>
cmp    $0x0,%rax
jne    1163 <main+0x43>
lea    -0x8(%rbp),%rdi
call   1030 <test_status_destroyed@plt>
cmp    $0x0,%rax
jne    1163 <main+0x43>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <pthread_condattr_init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <main+0x18>
pop    %rcx
ret
lea    0x4(%rsp),%rdi
call   1030 <test_status_destroyed@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @pthread_condattr_init(i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i64 @test_status_destroyed(i32* %1)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 1, %0 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_F6uint16_reg(unsigned short val) {
  return ((val) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xf6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F6uint16_reg>:
test   $0xf6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F6uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 246
%6 = icmp ne i32 %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_F6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 246
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long _pathconf(int);
long fpathconf(int fd, int name) {
  fd;
  return _pathconf(name);
}


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

x86 assembly (clang, -O2):
<fpathconf>:
mov    %esi,%edi
jmp    1030 <_pathconf@plt>

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

LLVM IR (-O2):
define i64 @fpathconf(i32 %0, i32 %1) {
%3 = tail call i64 @_pathconf(i32 %1)
ret i64 %3
}
char *start(char *bin, int size) {
  for (int i = 0; i < size; i++) {
    if (bin[i] == '1') {
      return &bin[i];
    }
  }
  return bin;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <start+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    1147 <start+0x47>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <start+0x62>
jmp    114c <start+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <start+0x12>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
mov    %rdi,%rax
test   %esi,%esi
jle    111f <start+0x1f>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x31,(%rax,%rcx,1)
je     1120 <start+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <start+0x10>
ret
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @start(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 49
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %17, label %6
14: ; preds = %6
%15 = and i64 %7, 4294967295
%16 = getelementptr inbounds i8, i8* %0, i64 %15
br label %17
17: ; preds = %11, %2, %14
%18 = phi i8* [ %16, %14 ], [ %0, %2 ], [ %0, %11 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 10;
  printf("%d\n", i);
  printf("25\n");
  return 32;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"25\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 32
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [3 x i8] c"25\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 32
}
void clearStr(char *str) {
  int i = 0;
  for (i = 0; str[i] != '\0' && str[i] != 0; i++) {
    str[i] = 0;
  }
  str[i] = 0;
}


x86 assembly (clang, -O0):
<clearStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1145 <clearStr+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1155 <clearStr+0x55>
jmp    116f <clearStr+0x6f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clearStr+0x16>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearStr>:
cmpb   $0x0,(%rdi)
je     1124 <clearStr+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x0,(%rdi)
lea    0x1(%rdi),%rax
cmpb   $0x0,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <clearStr+0x10>
movb   $0x0,(%rax)
ret
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clearStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
store i8 0, i8* %12
ret void
}
void ExttServiceGlueAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttServiceGlueAuxTable() {
ret void
}
char *skip_word(char *from) {
  while (*from > ' ')
    from++;
  while (*from && *from == ' ')
    from++;
  return from;
}


x86 assembly (clang, -O0):
<skip_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jle    1129 <skip_word+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_word+0x8>
jmp    112e <skip_word+0x2e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1153 <skip_word+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1163 <skip_word+0x63>
jmp    1174 <skip_word+0x74>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112e <skip_word+0x2e>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_word>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x20,0x1(%rdi)
lea    0x1(%rdi),%rdi
jg     1110 <skip_word+0x10>
jne    112e <skip_word+0x2e>
nopl   0x0(%rax)
lea    0x1(%rdi),%rax
cmpb   $0x20,0x1(%rdi)
mov    %rax,%rdi
je     1120 <skip_word+0x20>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @skip_word(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp sgt i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = icmp eq i8 %4, 32
br i1 %8, label %9, label %14
9: ; preds = %7, %9
%10 = phi i8* [ %11, %9 ], [ %3, %7 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 32
br i1 %13, label %9, label %14
14: ; preds = %9, %7
%15 = phi i8* [ %3, %7 ], [ %11, %9 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int suma(int, int);
void main() { printf("%d\n", suma(2, 5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <suma@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <suma@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = call i32 @suma(i32 2, i32 5)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @suma(i32 2, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *n = strdup(s);
  if (!n)
    abort();
  return n;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1040 <strdup@plt>
test   %rax,%rax
je     112d <xstrdup+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void BSP_PeriodicTask_StopB(void) {
  (*((volatile uint32_t *)0x4004E024)) = 0x00000001;
  (*((volatile uint32_t *)0xE000E18C)) = 1 << 6;
}


x86 assembly (clang, -O0):
<BSP_PeriodicTask_StopB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4004e024,%eax
movl   $0x1,(%rax)
mov    $0xe000e18c,%eax
movl   $0x40,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_PeriodicTask_StopB>:
movl   $0x1,0x4004e024
mov    $0xe000e18c,%eax
movl   $0x40,(%rax)
ret

LLVM IR (-O0):
define void @BSP_PeriodicTask_StopB() {
store volatile i32 1, i32* inttoptr (i64 1074061348 to i32*)
store volatile i32 64, i32* inttoptr (i64 3758154124 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_PeriodicTask_StopB() {
store volatile i32 1, i32* inttoptr (i64 1074061348 to i32*)
store volatile i32 64, i32* inttoptr (i64 3758154124 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log2(float);
float pow(float, int /*<<< orphan*/);
float bias(float value, float b) { return pow(value, -log2(b)); }


x86 assembly (clang, -O0):
<bias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movss  -0xc(%rbp),%xmm0
xor    %edi,%edi
sub    %eax,%edi
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bias>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
call   1030 <log2@plt>
neg    %eax
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define float @bias(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @log2(float %6)
%8 = sub nsw i32 0, %7
%9 = call float @pow(float %5, i32 %8)
ret float %9
}

LLVM IR (-O2):
define float @bias(float %0, float %1) {
%3 = tail call i32 @log2(float %1)
%4 = sub nsw i32 0, %3
%5 = tail call float @pow(float %0, i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
const char *protreg_base_str(unsigned val) {
  static char str[11];
  sprintf(str, "0x%08X", val << 13);
  return str;
}


x86 assembly (clang, -O0):
<protreg_base_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
shl    $0xd,%edx
lea    0x2f01(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2eee(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protreg_base_str>:
push   %rbx
mov    %edi,%edx
shl    $0xd,%edx
lea    0x2f0c(%rip),%rbx
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@protreg_base_str.str = internal global [11 x i8] zeroinitializer
@.str = [7 x i8] c"0x%08X\00"
define i8* @protreg_base_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 13
%5 = call i32 @sprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @protreg_base_str.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @protreg_base_str.str, i64 0, i64 0)
}

LLVM IR (-O2):
@protreg_base_str.str = internal global [11 x i8] zeroinitializer
@.str = [7 x i8] c"0x%08X\00"
define i8* @protreg_base_str(i32 %0) {
%2 = shl i32 %0, 13
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @protreg_base_str.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @protreg_base_str.str, i64 0, i64 0)
}