xunge/DecIR huggingface dataset:
int nwd(int a, int b) {
  while (a != b) {
    if (a > b) {
      a -= b;
    } else {
      b -= a;
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<nwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <nwd+0x42>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1132 <nwd+0x32>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <nwd+0x3d>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <nwd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nwd>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <nwd+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <nwd+0x10>
ret

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

LLVM IR (-O2):
define i32 @nwd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int ceil(double);
signed int iceil(double x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<iceil>:
jmp    1030 <ceil@plt>

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

LLVM IR (-O2):
define i32 @iceil(double %0) {
%2 = tail call i32 @ceil(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
xor    %ebx,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x28() {
  Assert_real((isbdigit(40) == 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_isbdigit.c",
              205, ("isbdigit should be 0 for ("));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x28>:
push   %rax
mov    $0x28,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xcd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for (\00"
define void @t_isbdigit_0x28() {
%1 = call i64 @isbdigit(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for (\00"
define void @t_isbdigit_0x28() {
%1 = tail call i64 @isbdigit(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int mlx_int_do_nothing(void *param) {}


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

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

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

LLVM IR (-O2):
define i32 @mlx_int_do_nothing(i8* nocapture readnone %0) {
ret i32 undef
}
unsigned int __isPATrange(void *addr) {
  return !!(
      addr > (void *)*((unsigned long *)*(unsigned long *)(0x000000000000c18u) +
                       (431)) &&
      addr < (void *)*((unsigned long *)*(unsigned long *)(0x000000000000c18u) +
                       (432)));
}


x86 assembly (clang, -O0):
<__isPATrange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xc18,%eax
mov    (%rax),%rax
mov    0xd78(%rax),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x9(%rbp)
jbe    1145 <__isPATrange+0x45>
mov    -0x8(%rbp),%rax
mov    $0xc18,%ecx
mov    (%rcx),%rcx
mov    0xd80(%rcx),%rcx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isPATrange>:
mov    0xc18,%rcx
xor    %eax,%eax
cmp    %rdi,0xd78(%rcx)
jae    111f <__isPATrange+0x1f>
xor    %eax,%eax
cmp    %rdi,0xd80(%rcx)
seta   %al
ret

LLVM IR (-O0):
define i32 @__isPATrange(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i64, i64* inttoptr (i64 3096 to i64*)
%5 = inttoptr i64 %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 431
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
%9 = icmp ugt i8* %3, %8
br i1 %9, label %10, label %18
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = load i64, i64* inttoptr (i64 3096 to i64*)
%13 = inttoptr i64 %12 to i64*
%14 = getelementptr inbounds i64, i64* %13, i64 432
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to i8*
%17 = icmp ult i8* %11, %16
br label %18
18: ; preds = %10, %1
%19 = phi i1 [ false, %1 ], [ %17, %10 ]
%20 = xor i1 %19, true
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @__isPATrange(i8* readnone %0) {
%2 = load i64, i64* inttoptr (i64 3096 to i64*)
%3 = inttoptr i64 %2 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 431
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
%7 = icmp ult i8* %6, %0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds i64, i64* %3, i64 432
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
%12 = icmp ugt i8* %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %1
%15 = phi i32 [ 0, %1 ], [ %13, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ mill_choose_init(char *);
int mill_choose_wait();
void unused(void) {
  {
    mill_choose_init("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/"
                     "heads/master/tests/choose.c"
                     ":"
                     "102");
    int mill_idx = -2;
    while (1) {
      if (mill_idx != -2) {
        if (0) {
          break;
        }
      }
      mill_idx = mill_choose_wait();
    }
  }
}


x86 assembly (clang, -O0):
<unused>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <mill_choose_init@plt>
movl   $0xfffffffe,-0x4(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
je     114a <unused+0x2a>
jmp    114a <unused+0x2a>
mov    $0x0,%al
call   1030 <mill_choose_wait@plt>
mov    %eax,-0x4(%rbp)
jmp    113b <unused+0x1b>

x86 assembly (clang, -O2):
<unused>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <mill_choose_init@plt>
nopl   (%rax)
xor    %eax,%eax
call   1030 <mill_choose_wait@plt>
jmp    1130 <unused+0x10>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/heads/master/tests/choose.c:102\00"
define void @unused() {
%1 = alloca i32
%2 = call i32 @mill_choose_init(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
store i32 -2, i32* %1
br label %3
3: ; preds = %0, %7
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, -2
br i1 %5, label %6, label %7
6: ; preds = %3
br label %7
7: ; preds = %6, %3
%8 = call i32 (...) @mill_choose_wait()
store i32 %8, i32* %1
br label %3
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/heads/master/tests/choose.c:102\00"
define void @unused() {
%1 = tail call i32 @mill_choose_init(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @mill_choose_wait()
br label %2
}
long long get_arch_specific_mem_size(void) { return -1; }


x86 assembly (clang, -O0):
<get_arch_specific_mem_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arch_specific_mem_size>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @get_arch_specific_mem_size() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @get_arch_specific_mem_size() {
ret i64 -1
}
__attribute__((always_)) void pm_runtime_enable(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @pm_runtime_enable(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
char *GetString(void) { return malloc(256 * sizeof(char)); }


x86 assembly (clang, -O0):
<GetString>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetString>:
mov    $0x100,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @GetString() {
%1 = call i8* @malloc(i32 256)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @GetString() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
ret i8* %1
}
void sound_update(void) {}


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

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

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

LLVM IR (-O2):
define void @sound_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int a, b, c;
  printf("Enter two numbers:");
  scanf("%d%d", &a, &b);
  c = a + b;
  printf("The sum is %d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter two numbers:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [14 x i8] c"The sum is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter two numbers:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [14 x i8] c"The sum is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
long gethostid(void) { return 0xdeadface; }


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

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

LLVM IR (-O0):
define i64 @gethostid() {
ret i64 3735943886
}

LLVM IR (-O2):
define i64 @gethostid() {
ret i64 3735943886
}
/* Variables and functions */
int atoi(char *);
char *getenv(char const *);
int env2d_default(const char *n, int def) {
  char *v_ch = getenv(n);
  return v_ch == NULL ? def : atoi(v_ch);
}


x86 assembly (clang, -O0):
<env2d_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1152 <env2d_default+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    115e <env2d_default+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env2d_default>:
push   %rbx
mov    %esi,%ebx
call   1030 <getenv@plt>
test   %rax,%rax
je     1136 <env2d_default+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @env2d_default(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @getenv(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %15
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i32 @atoi(i8* %13)
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @env2d_default(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int getresgid(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int getresuid(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int get_saved_ids(uid_t *suid, gid_t *sgid) {
  uid_t ruid, euid;
  gid_t rgid, egid;
  if ((getresuid(&ruid, &euid, suid)) == -1)
    abort();
  if ((getresgid(&rgid, &egid, sgid)) == -1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<get_saved_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <getresuid@plt>
cmp    $0xffffffff,%eax
jne    1161 <get_saved_ids+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <getresgid@plt>
cmp    $0xffffffff,%eax
jne    1182 <get_saved_ids+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_saved_ids>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <getresuid@plt>
cmp    $0xffffffff,%eax
je     116c <get_saved_ids+0x3c>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    %rbx,%rdx
call   1040 <getresgid@plt>
cmp    $0xffffffff,%eax
je     116c <get_saved_ids+0x3c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @get_saved_ids(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i32 @getresuid(i32* %3, i32* %4, i32* %0)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = call i32 @getresgid(i32* %5, i32* %6, i32* %1)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %15
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ localSysTick_Handler();
void SysTick_Handler(void) { localSysTick_Handler(); }


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

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

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

LLVM IR (-O2):
define void @SysTick_Handler() {
%1 = tail call i32 (...) @localSysTick_Handler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg_cpy;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ str_clearcopy(char *, char const *, int);
void console_print(const char *msg) {
  char msg_cpy[128];
  str_clearcopy(msg_cpy, msg, sizeof(msg_cpy));
  printf("%s\n", msg_cpy);
}


x86 assembly (clang, -O0):
<console_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x80,%edx
call   1040 <str_clearcopy@plt>
lea    -0x90(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_print>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
call   1040 <str_clearcopy@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @console_print(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @str_clearcopy(i8* %3, i8* %0, i32 128)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void glutMenuStateFunc(void (*func)(int state)) {}


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

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

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

LLVM IR (-O2):
define void @glutMenuStateFunc(void (i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ attr_char_nonalnum(unsigned char const);
scalar_t__ isalnum(unsigned char const);
bool attr_char(unsigned char const c) {
  assert('\0' != c);
  return isalnum(c) || attr_char_nonalnum(c);
}


x86 assembly (clang, -O0):
<attr_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movzbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1181 <attr_char+0x51>
movzbl -0x1(%rbp),%edi
call   1040 <attr_char_nonalnum@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attr_char>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1156 <attr_char+0x26>
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <attr_char_nonalnum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @attr_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ne i32 0, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8, i8* %2
%9 = call i64 @isalnum(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %2
%13 = call i64 @attr_char_nonalnum(i8 zeroext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %11, %1
%16 = phi i1 [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @attr_char(i8 zeroext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @isalnum(i8 zeroext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = tail call i64 @attr_char_nonalnum(i8 zeroext %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
void MainWinDisp_nat(nn) int nn;
{
  char buf[50];
  strcpy(buf, "");
  CreNumInBuf(buf, nn);
  DisplayCurrWinText(buf);
}


x86 assembly (clang, -O0):
<MainWinDisp_nat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1040 <CreNumInBuf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <DisplayCurrWinText@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MainWinDisp_nat>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%esi
movb   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <CreNumInBuf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <DisplayCurrWinText@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @MainWinDisp_nat(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @CreNumInBuf to i32 (i8*, i32, ...)*)(i8* %6, i32 %7)
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* %9)
ret void
}

LLVM IR (-O2):
define void @MainWinDisp_nat(i32 %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @CreNumInBuf to i32 (i8*, i32, ...)*)(i8* %3, i32 %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRCA_get(void) { return U_WMRCORENONE_get("U_WMRCA"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRCA\00"
define i32 @U_WMRCA_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCA\00"
define i32 @U_WMRCA_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
__attribute__((always_)) void
proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
%struct.proc_dir_entry = type opaque
define void @proc_device_tree_add_node(%struct.device_node* nocapture %0, %struct.proc_dir_entry* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void CloseFile(FILE **f) {
  if (*f == NULL) {
    printf("ERROR: tried to close NULL file\n");
    return;
  }
  fclose(*f);
  *f = NULL;
}


x86 assembly (clang, -O0):
<CloseFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114b <CloseFile+0x2b>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
jmp    1162 <CloseFile+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseFile>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     113a <CloseFile+0x1a>
call   1040 <fclose@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret
lea    0xebf(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ERROR: tried to close NULL file\0A\00"
define void @CloseFile(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = load i32**, i32*** %2
%10 = load i32*, i32** %9
%11 = call i32 @fclose(i32* %10)
%12 = load i32**, i32*** %2
store i32* null, i32** %12
br label %13
13: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"ERROR: tried to close NULL file\00"
define void @CloseFile(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @fclose(i32* %2)
store i32* null, i32** %0
br label %8
8: ; preds = %6, %4
ret void
}
int fun1104() { return 1104; }


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

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

LLVM IR (-O0):
define i32 @fun1104() {
ret i32 1104
}

LLVM IR (-O2):
define i32 @fun1104() {
ret i32 1104
}
/* Variables and functions */
scalar_t__ file_IsDirectorySeparator(char const);
int file_IsPathRelative(const char *path) {
  if (file_IsDirectorySeparator(path[0])) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_IsPathRelative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <file_IsDirectorySeparator@plt>
cmp    $0x0,%rax
je     113e <file_IsPathRelative+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <file_IsPathRelative+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_IsPathRelative>:
push   %rax
movsbl (%rdi),%edi
call   1030 <file_IsDirectorySeparator@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @file_IsPathRelative(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @file_IsDirectorySeparator(i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int hash_str(const char *str) {
  int i, hash;
  hash = 0;
  for (i = 0; str[i]; ++i) {
    hash *= 21;
    hash += str[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114f <hash_str+0x4f>
imul   $0x15,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash_str+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_str+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 21
%9 = sext i8 %6 to i32
%10 = add nsw i32 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_OV7725(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_OV7725>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_OV7725>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_OV7725(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_OV7725(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
void setval_350(unsigned *p) { *p = 2430634312U; }


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

x86 assembly (clang, -O2):
<setval_350>:
movl   $0x90e08948,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_350(i32* nocapture writeonly %0) {
store i32 -1864332984, i32* %0
ret void
}
/* Variables and functions */
int strlen(char *);
void remove_eol(char *line) {
  int i = strlen(line) - 1;
  while (line[i] == '\n' || line[i] == '\r') {
    line[i] = 0;
    i--;
  }
}


x86 assembly (clang, -O0):
<remove_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     115a <remove_eol+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116a <remove_eol+0x5a>
jmp    1184 <remove_eol+0x74>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <remove_eol+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_eol>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
jmp    1137 <remove_eol+0x27>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
movzbl (%rax),%ecx
cmp    $0xd,%cl
je     1130 <remove_eol+0x20>
cmp    $0xa,%cl
je     1130 <remove_eol+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_eol(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %9, %1
%5 = phi i64 [ %6, %9 ], [ %3, %1 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %10 [
i8 10, label %9
i8 13, label %9
]
9: ; preds = %4, %4
store i8 0, i8* %7
br label %4
10: ; preds = %4
ret void
}
int test_imm_B1uint16_reg(unsigned short val) {
  return ((val) & (-0xB1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B1uint16_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, -177
%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_B1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -177
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_control_zmereno(int /*<<< orphan*/);
void msr_init(void) { io_control_zmereno(0); }


x86 assembly (clang, -O0):
<msr_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <io_control_zmereno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msr_init>:
xor    %edi,%edi
jmp    1030 <io_control_zmereno@plt>

LLVM IR (-O0):
define void @msr_init() {
%1 = call i32 @io_control_zmereno(i32 0)
ret void
}

LLVM IR (-O2):
define void @msr_init() {
%1 = tail call i32 @io_control_zmereno(i32 0)
ret void
}
void ostr_reject(void *data, int ch) {}


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

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

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

LLVM IR (-O2):
define void @ostr_reject(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cache_strcmp(const char *A, const char *B) {
  return A == B ? 0 : strcmp(A, B);
}


x86 assembly (clang, -O0):
<cache_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1138 <cache_strcmp+0x28>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <cache_strcmp+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_strcmp>:
cmp    %rsi,%rdi
je     111a <cache_strcmp+0xa>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cache_strcmp(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 = icmp eq i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcmp(i8* %10, i8* %11)
br label %13
13: ; preds = %9, %8
%14 = phi i32 [ 0, %8 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @cache_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ sqrt(float);
float fnc(float x1, float x2, float x3, float x4) {
  return (float)sqrt(x1 * x1 + x2 * x2 + x3 * x3 + x4 * x4);
}


x86 assembly (clang, -O0):
<fnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnc>:
push   %rax
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm2,%xmm0
mulss  %xmm3,%xmm3
addss  %xmm3,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fnc(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %5
%11 = load float, float* %6
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %9, float %10, float %13)
%15 = load float, float* %7
%16 = load float, float* %7
%17 = call float @llvm.fmuladd.f32(float %15, float %16, float %14)
%18 = load float, float* %8
%19 = load float, float* %8
%20 = call float @llvm.fmuladd.f32(float %18, float %19, float %17)
%21 = call i64 @sqrt(float %20)
%22 = sitofp i64 %21 to float
ret float %22
}

LLVM IR (-O2):
define float @fnc(float %0, float %1, float %2, float %3) {
%5 = fmul float %1, %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %5)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %6)
%8 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %7)
%9 = tail call i64 @sqrt(float %8)
%10 = sitofp i64 %9 to float
ret float %10
}
int aa_iremainder(int a, int b) { return a % b; }


x86 assembly (clang, -O0):
<aa_iremainder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_iremainder>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @aa_iremainder(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @aa_iremainder(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
void *errChkdMalloc(int size) {
  void *memPointer;
  memPointer = malloc(size);
  if (NULL == memPointer) {
    printf("\n\nError while allocating memory. Program will stop.\n");
    exit(0);
  } else {
    return memPointer;
  }
}


x86 assembly (clang, -O0):
<errChkdMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1166 <errChkdMalloc+0x36>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errChkdMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <errChkdMalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\0A\0AError while allocating memory. Program will stop.\0A\00"
define i8* @errChkdMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [52 x i8] c"\0A\0AError while allocating memory. Program will stop.\00"
define noalias i8* @errChkdMalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i8* %2
}