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

/* Variables and functions */
int pthread_attr_init(int /*<<< orphan*/ *);
int pthread_attr_setstack(int /*<<< orphan*/ *, unsigned char *, int);
int main(void) {
  pthread_attr_t attr;
  int ret;
  static unsigned char stack[65536];
  ret = pthread_attr_init(&attr);
  if (ret)
    return -1;
  return ret = pthread_attr_setstack(&attr, stack, sizeof(stack));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <main+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <main+0x4c>
lea    -0x8(%rbp),%rdi
lea    0x2ee4(%rip),%rsi
mov    $0x10000,%edx
call   1040 <pthread_attr_setstack@plt>
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <pthread_attr_init@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     1138 <main+0x18>
pop    %rcx
ret
lea    0x2f01(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x10000,%edx
call   1040 <pthread_attr_setstack@plt>
pop    %rcx
ret

LLVM IR (-O0):
@main.stack = internal global [65536 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @pthread_attr_init(i32* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 @pthread_attr_setstack(i32* %2, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.stack, i64 0, i64 0), i32 65536)
store i32 %9, i32* %3
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@main.stack = internal global [65536 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_attr_init(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @pthread_attr_setstack(i32* %1, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.stack, i64 0, i64 0), i32 65536)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
int sscanf(char const *, char *, float *);
int iupStrToFloatDef(const char *str, float *f, float def) {
  if (!str) {
    *f = def;
    return 1;
  }
  if (sscanf(str, "%f", f) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iupStrToFloatDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <iupStrToFloatDef+0x39>
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1179 <iupStrToFloatDef+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1172 <iupStrToFloatDef+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1179 <iupStrToFloatDef+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrToFloatDef>:
push   %rax
mov    %rsi,%rdx
test   %rdi,%rdi
je     1131 <iupStrToFloatDef+0x21>
lea    0xee0(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret
movss  %xmm0,(%rdx)
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @iupStrToFloatDef(i8* %0, float* %1, float %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float
store i8* %0, i8** %5
store float* %1, float** %6
store float %2, float* %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load float, float* %7
%12 = load float*, float** %6
store float %11, float* %12
store i32 1, i32* %4
br label %20
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load float*, float** %6
%16 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = icmp ne i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %4
br label %20
19: ; preds = %13
store i32 1, i32* %4
br label %20
20: ; preds = %19, %18, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @iupStrToFloatDef(i8* %0, float* %1, float %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %6
5: ; preds = %3
store float %2, float* %1
br label %10
6: ; preds = %3
%7 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ 1, %5 ], [ %9, %6 ]
ret i32 %11
}
int car(int x, int y) {
  int q;
  q = x + 4;
  return q;
}


x86 assembly (clang, -O0):
<car>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<car>:
lea    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @car(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 4
ret i32 %3
}
/* Variables and functions */
int b(int);
int c(int);
int a(int val) {
  if (val <= 1)
    val = b(val);
  else if (val >= 3)
    val = c(val);
  return val;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1145 <a+0x25>
mov    -0x4(%rbp),%edi
call   1030 <b@plt>
mov    %eax,-0x4(%rbp)
jmp    115f <a+0x3f>
cmpl   $0x3,-0x4(%rbp)
jl     115a <a+0x3a>
mov    -0x4(%rbp),%edi
call   1040 <c@plt>
mov    %eax,-0x4(%rbp)
jmp    115f <a+0x3f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
cmp    $0x1,%edi
jg     112a <a+0xa>
jmp    1030 <b@plt>
cmp    $0x2,%edi
jne    1135 <a+0x15>
mov    $0x2,%eax
ret
jmp    1040 <c@plt>

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

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @b(i32 %0)
br label %9
5: ; preds = %1
%6 = icmp eq i32 %0, 2
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @c(i32 %0)
br label %9
9: ; preds = %5, %7, %3
%10 = phi i32 [ %4, %3 ], [ %8, %7 ], [ 2, %5 ]
ret i32 %10
}
/* Variables and functions */
size_t roundup2(size_t x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<roundup2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @roundup2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = add i64 %25, 1
store i64 %26, i64* %2
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @roundup2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
/* Variables and functions */
int getcns(int);
int cmd_radio(int argc, char **argv) { return getcns(0x1075); }


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

x86 assembly (clang, -O2):
<cmd_radio>:
mov    $0x1075,%edi
jmp    1030 <getcns@plt>

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

LLVM IR (-O2):
define i32 @cmd_radio(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @getcns(i32 4213)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void IN_AL_DX() {
  ;
  _c_setbyte(0xec);
  ;
}


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

x86 assembly (clang, -O2):
<IN_AL_DX>:
mov    $0xec,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @IN_AL_DX() {
%1 = call i32 @_c_setbyte(i32 236)
ret void
}

LLVM IR (-O2):
define void @IN_AL_DX() {
%1 = tail call i32 @_c_setbyte(i32 236)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkstr(char *);
void f() { mkstr("asdfasdf"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"asdfasdf\00"
define void @f() {
%1 = call i32 @mkstr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"asdfasdf\00"
define void @f() {
%1 = tail call i32 @mkstr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      if (!(state[0UL] > local1)) {
        state[0UL] += state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] + 792422477UL) + 0xfffffffff7856444UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    115b <RandomFunc+0x5b>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     114a <RandomFunc+0x4a>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
add    $0x2f3b684d,%rcx
add    $0xfffffffff7856444,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x2626d7d6,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %26, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%17 = load i64, i64* %16
%18 = load i64, i64* %6
%19 = icmp ugt i64 %17, %18
br i1 %19, label %26, label %20
20: ; preds = %15
%21 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = add i64 %24, %22
store i64 %25, i64* %23
br label %26
26: ; preds = %20, %15
%27 = load i64, i64* %6
%28 = add i64 %27, 2
store i64 %28, i64* %6
br label %12
29: ; preds = %12
%30 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%31 = load i64, i64* %30
%32 = add i64 %31, 792422477
%33 = add i64 %32, -142252988
%34 = load i64*, i64** %4
%35 = getelementptr inbounds i64, i64* %34, i64 0
store i64 %33, i64* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 640079830
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cursortocolumn(int column) { printf("\033[%dG", column); }


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

x86 assembly (clang, -O2):
<cursortocolumn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dG\00"
define void @cursortocolumn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dG\00"
define void @cursortocolumn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ macos_init();
void pi_init(void) { macos_init(); }


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

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

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

LLVM IR (-O2):
define void @pi_init() {
%1 = tail call i32 (...) @macos_init()
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t nvm_kv_mask_lsb(uint64_t value, uint32_t lsb) {
  return (value & ~(((uint64_t)1 << lsb) - 1));
}


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

x86 assembly (clang, -O2):
<nvm_kv_mask_lsb>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @nvm_kv_mask_lsb(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = xor i32 %8, -1
%10 = and i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @nvm_kv_mask_lsb(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = and i32 %3, %0
ret i32 %4
}
void SetRow_ERMS() {}


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

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

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

LLVM IR (-O2):
define void @SetRow_ERMS() {
ret void
}
void GPIOModuleEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x130)))) &= ~((0x00000001u));
}


x86 assembly (clang, -O0):
<GPIOModuleEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOModuleEnable>:
add    $0x130,%edi
andl   $0xfffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @GPIOModuleEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 304
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPIOModuleEnable(i32 %0) {
%2 = add i32 %0, 304
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x8d() {
  Assert_real((iscntrl(141) == 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_iscntrl.c",
              710, ("iscntrl should be 0 for 0x8d"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x8d\00"
define void @t_iscntrl_0x8d() {
%1 = tail call i64 @iscntrl(i32 141)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _M2_M2EXCEPTION_init(__attribute__((unused)) int argc,
                          __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_M2EXCEPTION_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ invalid_argument(int);
int /*<<< orphan*/ *optarg;
scalar_t__ safe_atoi(int /*<<< orphan*/ *, int *);
int optarg_atoi(int opt_index) {
  int out;
  assert(optarg != NULL);
  if (safe_atoi(optarg, &out))
    invalid_argument(opt_index);
  return out;
}


x86 assembly (clang, -O0):
<optarg_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <safe_atoi@plt>
cmp    $0x0,%rax
je     1178 <optarg_atoi+0x48>
mov    -0x4(%rbp),%edi
call   1050 <invalid_argument@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optarg_atoi>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2ebc(%rip),%rbx
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
lea    0x4(%rsp),%rsi
call   1030 <safe_atoi@plt>
test   %rax,%rax
je     1164 <optarg_atoi+0x34>
mov    %ebp,%edi
call   1050 <invalid_argument@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@optarg = global i32* null
define i32 @optarg_atoi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32*, i32** @optarg
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** @optarg
%9 = call i64 @safe_atoi(i32* %8, i32* %3)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 @invalid_argument(i32 %12)
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@optarg = global i32* null
define i32 @optarg_atoi(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32*, i32** @optarg
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32*, i32** @optarg
%9 = call i64 @safe_atoi(i32* %8, i32* %2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %1
%12 = call i32 @invalid_argument(i32 %0)
br label %13
13: ; preds = %11, %1
%14 = load i32, i32* %2
ret i32 %14
}
const char *librtaAbout_ShortNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


x86 assembly (clang, -O0):
<librtaAbout_ShortNotice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<librtaAbout_ShortNotice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @librtaAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @librtaAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
unsigned long get_XMappingEvent_serial(void *_p) {
  return (unsigned long)((XMappingEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XMappingEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XMappingEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ dhry();
int main() {
  dhry();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <dhry@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @dhry()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dhry()
ret i32 0
}
void foo270(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo270(i32 %0) {
ret void
}
void av_encryption_info_get_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_info_get_side_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          char const *);
void cmdshell_print_status_read(const char *rsrc, const char *rdst,
                                const char *roffset, const char *rcipher) {
  printf("\n"
         "Read options:\n"
         "  Source:             \"%s\"\n"
         "  Destination:        \"%s\"\n"
         "  Source Offset:      %s\n"
         "  Source Cipher:      %s\n"
         "\n",
         rsrc, rdst, roffset, rcipher);
}


x86 assembly (clang, -O0):
<cmdshell_print_status_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdshell_print_status_read>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [121 x i8] c"\0ARead options:\0A Source: \22%s\22\0A Destination: \22%s\22\0A Source Offset: %s\0A Source Cipher: %s\0A\0A\00"
define void @cmdshell_print_status_read(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [121 x i8] c"\0ARead options:\0A Source: \22%s\22\0A Destination: \22%s\22\0A Source Offset: %s\0A Source Cipher: %s\0A\0A\00"
define void @cmdshell_print_status_read(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
void lpm_arch_awake(void) {}


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

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

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

LLVM IR (-O2):
define void @lpm_arch_awake() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ __pos;
};
typedef TYPE_1__ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __infer_nondet_int();
int /*<<< orphan*/ __infer_nondet_long_int();
int fgetpos(FILE *__restrict stream, fpos_t *__restrict pos) {
  int success;
  FILE tmp;
  tmp = *stream;
  pos->__pos = __infer_nondet_long_int();
  success = __infer_nondet_int();
  if (success)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<fgetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_int@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <__infer_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1168 <fgetpos+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <fgetpos+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetpos>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_long_int@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <__infer_nondet_int@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @fgetpos(i32* noalias %0, %struct.TYPE_3__* noalias %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.TYPE_3__*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = call i32 (...) @__infer_nondet_long_int()
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = call i32 (...) @__infer_nondet_int()
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @fgetpos(i32* noalias nocapture readnone %0, %struct.TYPE_3__* noalias nocapture writeonly %1) {
%3 = tail call i32 (...) @__infer_nondet_long_int()
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = tail call i32 (...) @__infer_nondet_int()
%6 = icmp eq i32 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
unsigned xrop3_65_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_65_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_65_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
not    %edi
and    %esi,%edi
mov    %esi,%eax
shl    $0x8,%eax
mov    %ecx,%edx
xor    %eax,%edx
xor    $0xffffff00,%edx
not    %eax
or     %ecx,%eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_65_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_65_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, %6
%8 = xor i32 %7, -256
%9 = xor i32 %6, -1
%10 = or i32 %4, %9
%11 = and i32 %10, %8
%12 = xor i32 %3, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
const char *bad_str(const char *estr) {
  static char buf[100 + 8];
  sprintf(buf, "bad \"%.100s\"", estr);
  return buf;
}


x86 assembly (clang, -O0):
<bad_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_str>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@bad_str.buf = internal global [108 x i8] zeroinitializer
@.str = [13 x i8] c"bad \22%.100s\22\00"
define i8* @bad_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @bad_str.buf, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @bad_str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@bad_str.buf = internal global [108 x i8] zeroinitializer
@.str = [13 x i8] c"bad \22%.100s\22\00"
define i8* @bad_str(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @bad_str.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @bad_str.buf, i64 0, i64 0)
}
__attribute__((weak)) int _kill(int pid, int sig) {
  (void)pid;
  (void)sig;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define weak i32 @_kill(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
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_debug(char *message) { printf("<debug>%s</debug>\n", message); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"<debug>%s</debug>\0A\00"
define void @print_debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"<debug>%s</debug>\0A\00"
define void @print_debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
call0c(i, l, c, s) int i;
long l;
char c;
short s;
{
  i = 3;
  l = 4;
  c = 'k';
  s = 5;
}


x86 assembly (clang, -O0):
<call0c>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %dl,%cl
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
movl   $0x3,-0x8(%rbp)
movq   $0x4,-0x10(%rbp)
movb   $0x6b,-0x11(%rbp)
movw   $0x5,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call0c(i32 %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8
%9 = alloca i16
%10 = trunc i32 %2 to i8
%11 = trunc i32 %3 to i16
store i32 %0, i32* %6
store i64 %1, i64* %7
store i8 %10, i8* %8
store i16 %11, i16* %9
store i32 3, i32* %6
store i64 4, i64* %7
store i8 107, i8* %8
store i16 5, i16* %9
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call0c(i32 %0, i64 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int sqrt(int);
double C(int32_t xi) {
  if (!xi) {
    return 1. / sqrt(2.);
  } else {
    return 1.;
  }
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <C+0x39>
mov    $0x2,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1156 <C+0x46>
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rax
test   %edi,%edi
je     111f <C+0xf>
movsd  0xee3(%rip),%xmm0
pop    %rax
ret
mov    $0x2,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecb(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @C(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @sqrt(i32 2)
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %2
br label %11
10: ; preds = %1
store double 1.000000e+00, double* %2
br label %11
11: ; preds = %10, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @C(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @sqrt(i32 2)
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
const char *DeviceName() { return "Infrared Blaster"; }


x86 assembly (clang, -O0):
<DeviceName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeviceName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Infrared Blaster\00"
define i8* @DeviceName() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"Infrared Blaster\00"
define i8* @DeviceName() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
int length(const char *src, int maxlen) {
  const char *s = src;

  __asm__ volatile("xor %%al,%%al; repne scasb"
                   : "=D"(src)
                   : "0"(src), "c"(maxlen)
                   : "%eax");
  return src - s;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %al,%al
repnz scas %es:(%rdi),%al
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    %esi,%ecx
mov    %rdi,%rdx
xor    %al,%al
repnz scas %es:(%rdi),%al
mov    %rdi,%rax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @length(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
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* asm sideeffect "xor %al,%al; repne scasb", "={di},0,{cx},~{eax},~{dirflag},~{fpsr},~{flags}"(i8* %7, i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @length(i8* %0, i32 %1) {
%3 = tail call i8* asm sideeffect "xor %al,%al; repne scasb", "={di},0,{cx},~{eax},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1)
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
void Bpda_file_error(file, mode) char *file;
char *mode;
{
  printf("\n  BMotif: can't open %s for %s\n\n", file, mode);
  Kill_bplatform_and_exit(1, 0);
}


x86 assembly (clang, -O0):
<Bpda_file_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <Kill_bplatform_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bpda_file_error>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <Kill_bplatform_and_exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0A BMotif: can't open %s for %s\0A\0A\00"
define void @Bpda_file_error(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 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Kill_bplatform_and_exit to i32 (i32, i32, ...)*)(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A BMotif: can't open %s for %s\0A\0A\00"
define void @Bpda_file_error(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Kill_bplatform_and_exit to i32 (i32, i32, ...)*)(i32 1, i32 0)
ret void
}
unsigned long hash(unsigned char *str, unsigned long seed, unsigned long p) {
  unsigned long hash = seed;
  int c;
  while ((c = *str++)) {
    hash = (((hash << 5) + hash) + c) % p;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     115a <hash+0x5a>
mov    -0x20(%rbp),%rax
shl    $0x5,%rax
add    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
add    %rcx,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
jmp    1118 <hash+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    (%rdi),%al
test   %al,%al
je     1152 <hash+0x52>
add    $0x1,%rdi
jmp    1130 <hash+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
div    %rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1152 <hash+0x52>
mov    %rdx,%rsi
shl    $0x5,%rsi
add    %rdx,%rsi
movzbl %al,%eax
add    %rsi,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <hash+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <hash+0x25>
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0, i64 %1, i64 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = phi i64 [ %14, %6 ], [ %1, %3 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = mul i64 %9, 33
%12 = zext i8 %7 to i64
%13 = add i64 %11, %12
%14 = urem i64 %13, %2
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3
%18 = phi i64 [ %1, %3 ], [ %14, %6 ]
ret i64 %18
}
void tegra_fb_pan_display_reset(struct tegra_fb_info *fb_info) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_fb_info = type opaque
define void @tegra_fb_pan_display_reset(%struct.tegra_fb_info* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ test_add(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ test_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void test_add_sub(int64_t x, int64_t y, uint32_t n) {
  test_add(x, y, n);
  test_sub(x, y, n);
  test_sub(y, x, n);
}


x86 assembly (clang, -O0):
<test_add_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <test_add@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <test_sub@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <test_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add_sub>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <test_add@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <test_sub@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <test_sub@plt>

LLVM IR (-O0):
define void @test_add_sub(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @test_add(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @test_sub(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = call i32 @test_sub(i32 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @test_add_sub(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @test_add(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @test_sub(i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @test_sub(i32 %1, i32 %0, i32 %2)
ret void
}