xunge/DecIR huggingface dataset:
int f(int c, int i) {
  int a1, a2, a3, x1, x2, x3, x;
  a1 = i * 16;
  x1 = c + a1;
  i = i + 2;
  a2 = i * 16;
  x2 = c + a2;
  if (x2 > 6)
    i = i + 2;
  i = i + 2;
  a3 = i * 16;
  x3 = c + a3;
  x = x1 + x2 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jle    114a <f+0x4a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x2(%rsi),%eax
mov    %eax,%ecx
shl    $0x4,%ecx
add    %edi,%ecx
lea    0x4(%rsi),%edx
cmp    $0x7,%ecx
cmovl  %eax,%edx
add    %esi,%edx
shl    $0x4,%edx
lea    (%rcx,%rdi,2),%eax
add    %edx,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 16
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
store i32 %16, i32* %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 2
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 16
store i32 %20, i32* %6
%21 = load i32, i32* %3
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp sgt i32 %24, 6
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 2
store i32 %28, i32* %4
br label %29
29: ; preds = %26, %2
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 2
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = mul nsw i32 %32, 16
store i32 %33, i32* %7
%34 = load i32, i32* %3
%35 = load i32, i32* %7
%36 = add nsw i32 %34, %35
store i32 %36, i32* %10
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %10
%41 = add nsw i32 %39, %40
store i32 %41, i32* %11
%42 = load i32, i32* %11
ret i32 %42
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = shl nsw i32 %3, 4
%5 = add nsw i32 %4, %0
%6 = icmp sgt i32 %5, 6
%7 = add nsw i32 %1, 4
%8 = select i1 %6, i32 %7, i32 %3
%9 = shl i32 %0, 1
%10 = add i32 %8, %1
%11 = shl i32 %10, 4
%12 = add i32 %9, 32
%13 = add i32 %12, %5
%14 = add i32 %13, %11
ret i32 %14
}
void my_stfpd(double *p, double _Complex x) { ((double _Complex *)p)[0] = x; }


x86 assembly (clang, -O0):
<my_stfpd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm1,(%rax)
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_stfpd>:
movsd  %xmm0,(%rdi)
movsd  %xmm1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @my_stfpd(double* %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca double*
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %1, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %2, double* %7
store double* %0, double** %5
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = load double*, double** %5
%13 = bitcast double* %12 to { double, double }*
%14 = getelementptr inbounds { double, double }, { double, double }* %13, i64 0
%15 = getelementptr inbounds { double, double }, { double, double }* %14, i32 0, i32 0
%16 = getelementptr inbounds { double, double }, { double, double }* %14, i32 0, i32 1
store double %9, double* %15
store double %11, double* %16
ret void
}

LLVM IR (-O2):
define void @my_stfpd(double* nocapture writeonly %0, double %1, double %2) {
%4 = getelementptr inbounds double, double* %0, i64 1
store double %1, double* %0
store double %2, double* %4
ret void
}
void reTransport(char *stream, int streamSize) {}


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

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

LLVM IR (-O0):
define void @reTransport(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 @reTransport(i8* nocapture %0, i32 %1) {
ret void
}
char *bg_get_type(struct background *bg) { return "Background"; }


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

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

LLVM IR (-O0):
%struct.background = type opaque
@.str = [11 x i8] c"Background\00"
define i8* @bg_get_type(%struct.background* %0) {
%2 = alloca %struct.background*
store %struct.background* %0, %struct.background** %2
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.background = type opaque
@.str = [11 x i8] c"Background\00"
define i8* @bg_get_type(%struct.background* nocapture readnone %0) {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ DI();
int /*<<< orphan*/ EI();
int /*<<< orphan*/ R_Systeminit();
void hdwinit(void) {
  DI();
  R_Systeminit();
  EI();
}


x86 assembly (clang, -O0):
<hdwinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DI@plt>
mov    $0x0,%al
call   1030 <R_Systeminit@plt>
mov    $0x0,%al
call   1050 <EI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdwinit>:
push   %rax
xor    %eax,%eax
call   1040 <DI@plt>
xor    %eax,%eax
call   1030 <R_Systeminit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <EI@plt>

LLVM IR (-O0):
define void @hdwinit() {
%1 = call i32 (...) @DI()
%2 = call i32 (...) @R_Systeminit()
%3 = call i32 (...) @EI()
ret void
}

LLVM IR (-O2):
define void @hdwinit() {
%1 = tail call i32 (...) @DI()
%2 = tail call i32 (...) @R_Systeminit()
%3 = tail call i32 (...) @EI()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ settftpmode(char *);
void setascii(int argc, char *argv[]) { settftpmode("netascii"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"netascii\00"
define void @setascii(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @settftpmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"netascii\00"
define void @setascii(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @settftpmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
void win() {
  char winner[100];
  printf("New winner!\nName? ");
  fgets(winner, 360, stdin);
  printf("Congrats %s\n\n", winner);
}


x86 assembly (clang, -O0):
<win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0x168,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x168,%esi
call   1040 <fgets@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"New winner!\0AName? \00"
@stdin = global i32 0
@.str.1 = [14 x i8] c"Congrats %s\0A\0A\00"
define void @win() {
%1 = alloca [100 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 360, i32 %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"New winner!\0AName? \00"
@stdin = global i32 0
@.str.1 = [14 x i8] c"Congrats %s\0A\0A\00"
define void @win() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 360, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct mutex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assert(int, char *);
int /*<<< orphan*/ __CPROVER_atomic_begin();
int /*<<< orphan*/ __CPROVER_atomic_end();
int /*<<< orphan*/ assert_context_process();
void mutex_unlock(struct mutex *lock) {
  int __cil_tmp2;
  {
    {
      __CPROVER_atomic_begin();
      assert_context_process();
      __cil_tmp2 = *((int *)lock);
      __CPROVER_assert(__cil_tmp2, "Unlock a not locked mutex");
      *((int *)lock) = 0;
      __CPROVER_atomic_end();
    }
    return;
  }
}


x86 assembly (clang, -O0):
<mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__CPROVER_atomic_begin@plt>
mov    $0x0,%al
call   1030 <assert_context_process@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xe93(%rip),%rsi
call   1060 <__CPROVER_assert@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1050 <__CPROVER_atomic_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_unlock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <__CPROVER_atomic_begin@plt>
xor    %eax,%eax
call   1030 <assert_context_process@plt>
mov    (%rbx),%edi
lea    0xea5(%rip),%rsi
call   1060 <__CPROVER_assert@plt>
movl   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1050 <__CPROVER_atomic_end@plt>

LLVM IR (-O0):
%struct.mutex = type { i32 }
@.str = [26 x i8] c"Unlock a not locked mutex\00"
define void @mutex_unlock(%struct.mutex* %0) {
%2 = alloca %struct.mutex*
%3 = alloca i32
store %struct.mutex* %0, %struct.mutex** %2
%4 = call i32 (...) @__CPROVER_atomic_begin()
%5 = call i32 (...) @assert_context_process()
%6 = load %struct.mutex*, %struct.mutex** %2
%7 = bitcast %struct.mutex* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @__CPROVER_assert(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.mutex*, %struct.mutex** %2
%12 = bitcast %struct.mutex* %11 to i32*
store i32 0, i32* %12
%13 = call i32 (...) @__CPROVER_atomic_end()
ret void
}

LLVM IR (-O2):
%struct.mutex = type { i32 }
@.str = [26 x i8] c"Unlock a not locked mutex\00"
define void @mutex_unlock(%struct.mutex* nocapture %0) {
%2 = tail call i32 (...) @__CPROVER_atomic_begin()
%3 = tail call i32 (...) @assert_context_process()
%4 = getelementptr %struct.mutex, %struct.mutex* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @__CPROVER_assert(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
%7 = tail call i32 (...) @__CPROVER_atomic_end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destruct_dev_key(void *pd, void *key) {
  if (key) {
    free(key);
  }
}


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

x86 assembly (clang, -O2):
<destruct_dev_key>:
test   %rsi,%rsi
je     111d <destruct_dev_key+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destruct_dev_key(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
int notInPivot(int *pivot, int col, int i) {
  register int h;
  for (h = 0; h < col; h++)
    if (pivot[h] == i)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<notInPivot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <notInPivot+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <notInPivot+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <notInPivot+0x5b>
jmp    1146 <notInPivot+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <notInPivot+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notInPivot>:
mov    $0x1,%eax
test   %esi,%esi
jle    111e <notInPivot+0x1e>
mov    %esi,%ecx
xor    %esi,%esi
nopl   (%rax)
cmp    %edx,(%rdi,%rsi,4)
je     111f <notInPivot+0x1f>
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1110 <notInPivot+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @notInPivot(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ IF_catC_i(int);
void IF_catsC(void) { IF_catC_i(1); }


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

x86 assembly (clang, -O2):
<IF_catsC>:
mov    $0x1,%edi
jmp    1030 <IF_catC_i@plt>

LLVM IR (-O0):
define void @IF_catsC() {
%1 = call i32 @IF_catC_i(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_catsC() {
%1 = tail call i32 @IF_catC_i(i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_send_event(void *_p, int _v) {
  ((XEnterWindowEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEnterWindowEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEnterWindowEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct tgl_state {
  int dummy;
};
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_req_pq_temp_packet(struct tgl_state *,
                                           struct connection *);
void create_temp_auth_key(struct tgl_state *TLS, struct connection *c) {
  send_req_pq_temp_packet(TLS, c);
}


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

x86 assembly (clang, -O2):
<create_temp_auth_key>:
jmp    1030 <send_req_pq_temp_packet@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @create_temp_auth_key(%struct.tgl_state* %0, %struct.connection* %1) {
%3 = alloca %struct.tgl_state*
%4 = alloca %struct.connection*
store %struct.tgl_state* %0, %struct.tgl_state** %3
store %struct.connection* %1, %struct.connection** %4
%5 = load %struct.tgl_state*, %struct.tgl_state** %3
%6 = load %struct.connection*, %struct.connection** %4
%7 = call i32 @send_req_pq_temp_packet(%struct.tgl_state* %5, %struct.connection* %6)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @create_temp_auth_key(%struct.tgl_state* %0, %struct.connection* %1) {
%3 = tail call i32 @send_req_pq_temp_packet(%struct.tgl_state* %0, %struct.connection* %1)
ret void
}
int compare_doubles(const void *a, const void *b) {
  double *arg1 = (double *)a;
  double *arg2 = (double *)b;
  if (*arg1 < *arg2)
    return -1;
  else if (*arg1 == *arg2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_doubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <compare_doubles+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <compare_doubles+0x71>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    116a <compare_doubles+0x6a>
jp     116a <compare_doubles+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <compare_doubles+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_doubles(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %26
25: ; preds = %18
store i32 1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp une double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int bar(int);
int foo(int);
int rec1(int);
int main() {
  int x = 3;
  int y = bar(x);
  int z = rec1(y);
  int w = foo(y);
  __CRAB_assert(w == 10);
  return z + w;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <rec1@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <foo@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1030 <bar@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1060 <rec1@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <foo@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1040 <__CRAB_assert@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @bar(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @rec1(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @foo(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 10
%14 = zext i1 %13 to i32
%15 = call i32 @__CRAB_assert(i32 %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 3)
%2 = tail call i32 @rec1(i32 %1)
%3 = tail call i32 @foo(i32 %1)
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i32
%6 = tail call i32 @__CRAB_assert(i32 %5)
%7 = add nsw i32 %3, %2
ret i32 %7
}
int f7(int t, int v) {
  if (v == 0)
    __builtin_unreachable();
  int a = t + 1U;
  int b = a * v;
  return b - v;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1114 <f7+0x14>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
tail call void @llvm.assume(i1 %3)
%4 = mul i32 %1, %0
ret i32 %4
}
/* Variables and functions */
void putchar(char c) {
  while ((*((volatile unsigned long *)0x7F005018)) & (1 << 14))
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putchar+0x27>
jmp    110a <putchar+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
testq  $0x4000,0x7f005018
jne    1100 <putchar>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
double fun_2D_ferr_1(double x, double unused_0, double unused_1) {
  unused_0 = unused_0;
  unused_1 = unused_1;
  return x * x * x * x + x * x * x + x * x + x;
}


x86 assembly (clang, -O0):
<fun_2D_ferr_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_2D_ferr_1>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @fun_2D_ferr_1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
store double %7, double* %5
%8 = load double, double* %6
store double %8, double* %6
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = load double, double* %4
%15 = load double, double* %4
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %13, double %14, double %19)
%21 = load double, double* %4
%22 = load double, double* %4
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %20)
%24 = load double, double* %4
%25 = fadd double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @fun_2D_ferr_1(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %6)
%8 = fadd double %7, %0
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen_safe(char *, char *);
int /*<<< orphan*/ *stdin;
void open_in_file(FILE **in, char *infile_name) {
  *in = NULL;
  if (infile_name == NULL)
    *in = stdin;
  else
    *in = fopen_safe(infile_name, "rb");
}


x86 assembly (clang, -O0):
<open_in_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    114c <open_in_file+0x3c>
mov    0x2eab(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1166 <open_in_file+0x56>
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <fopen_safe@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_in_file>:
push   %rbx
mov    %rdi,%rbx
movq   $0x0,(%rdi)
test   %rsi,%rsi
je     1134 <open_in_file+0x24>
lea    0xed9(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <fopen_safe@plt>
jmp    113e <open_in_file+0x2e>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [3 x i8] c"rb\00"
define void @open_in_file(i32** %0, i8* %1) {
%3 = alloca i32**
%4 = alloca i8*
store i32** %0, i32*** %3
store i8* %1, i8** %4
%5 = load i32**, i32*** %3
store i32* null, i32** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** @stdin
%10 = load i32**, i32*** %3
store i32* %9, i32** %10
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32* @fopen_safe(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = load i32**, i32*** %3
store i32* %13, i32** %14
br label %15
15: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [3 x i8] c"rb\00"
define void @open_in_file(i32** nocapture writeonly %0, i8* %1) {
store i32* null, i32** %0
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32*, i32** @stdin
br label %8
6: ; preds = %2
%7 = tail call i32* @fopen_safe(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32* [ %7, %6 ], [ %5, %4 ]
store i32* %9, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void yyerror(char *string) { fprintf(stderr, "%s\n", string); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int map_shutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @map_shutdown() {
ret i32 0
}

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

/* Variables and functions */
unsigned int w_str_hash(const void *p) {
  const char *s = (const char *)p;
  uint32_t hash = 0;
  while (*s) {
    hash = (hash << 4) + *s;
    s++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<w_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <w_str_hash+0x47>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <w_str_hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <w_str_hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%eax
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <w_str_hash+0x10>
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
int fread(float *, size_t, size_t, int /*<<< orphan*/ *);
int c_fread_real_(float *f, int *nf, FILE **fp) {
  return fread(f, (size_t)sizeof(float), (size_t)*nf, *fp);
}


x86 assembly (clang, -O0):
<c_fread_real_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fread_real_>:
movslq (%rsi),%rax
mov    (%rdx),%rcx
mov    $0x4,%esi
mov    %rax,%rdx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @c_fread_real_(float* %0, i32* %1, i32** %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32**
store float* %0, float** %4
store i32* %1, i32** %5
store i32** %2, i32*** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = load i32**, i32*** %6
%12 = load i32*, i32** %11
%13 = call i32 @fread(float* %7, i64 4, i64 %10, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @c_fread_real_(float* nocapture %0, i32* nocapture %1, i32** nocapture %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = load i32*, i32** %2
%7 = tail call i32 @fread(float* %0, i64 4, i64 %5, i32* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("todo: write the help\n");
  exit(0);
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"todo: write the help\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"todo: write the help\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void incA(__attribute__((unused)) void **alloc,
          __attribute__((unused)) void **in,
          __attribute__((unused)) void **inout,
          __attribute__((unused)) void **out) {
  unsigned *v = inout[0];
  v[0]++;
}


x86 assembly (clang, -O0):
<incA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<incA>:
mov    (%rdx),%rax
addl   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @incA(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8**, i8*** %7
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %9
%14 = load i32*, i32** %9
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = add i32 %16, 1
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @incA(i8** nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = bitcast i8** %2 to i32**
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = add i32 %7, 1
store i32 %8, i32* %6
ret void
}
/* Variables and functions */
scalar_t__ posix_memalign(void **, int, int);
int foo(float *p) {
  int res = *p;
  int *q;
  void *tem;
  if (posix_memalign(&tem, 128, 128 * sizeof(int)) != 0)
    return 0;
  q = (int *)tem;
  *q = 1;
  return res + *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvttss2si (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x80,%esi
mov    $0x200,%edx
call   1030 <posix_memalign@plt>
cmp    $0x0,%rax
je     1150 <foo+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1176 <foo+0x66>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x80,%esi
mov    $0x200,%edx
call   1030 <posix_memalign@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    115b <foo+0x4b>
mov    0x8(%rsp),%rax
movl   $0x1,(%rax)
cvttps2dq 0x10(%rsp),%xmm0
cvtdq2ps %xmm0,%xmm0
addss  (%rbx),%xmm0
cvttss2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(float* %0) {
%2 = alloca i32
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store float* %0, float** %3
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = fptosi float %8 to i32
store i32 %9, i32* %4
%10 = call i64 @posix_memalign(i8** %6, i32 128, i32 512)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %23
13: ; preds = %1
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %5
%16 = load i32*, i32** %5
store i32 1, i32* %16
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to float
%19 = load float*, float** %3
%20 = load float, float* %19
%21 = fadd float %18, %20
%22 = fptosi float %21 to i32
store i32 %22, i32* %2
br label %23
23: ; preds = %13, %12
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @foo(float* nocapture %0) {
%2 = alloca i8*
%3 = load float, float* %0
%4 = bitcast i8** %2 to i8*
%5 = call i64 @posix_memalign(i8** %2, i32 128, i32 512)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = fptosi float %3 to i32
%9 = bitcast i8** %2 to i32**
%10 = load i32*, i32** %9
store i32 1, i32* %10
%11 = sitofp i32 %8 to float
%12 = load float, float* %0
%13 = fadd float %12, %11
%14 = fptosi float %13 to i32
br label %15
15: ; preds = %1, %7
%16 = phi i32 [ %14, %7 ], [ 0, %1 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int f(void) {
  puts("F");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"F\00"
define i32 @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int wait_threads(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @wait_threads() {
ret i32 1
}

LLVM IR (-O2):
define i32 @wait_threads() {
ret i32 1
}
unsigned int oof(int uid) { return (174 << 7) + uid; }


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

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

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

LLVM IR (-O2):
define i32 @oof(i32 %0) {
%2 = add nsw i32 %0, 22272
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ might_sleep();
int num_online_cpus();
int /*<<< orphan*/ preempt_disable();
int /*<<< orphan*/ preempt_enable();
int rcu_blocking_is_gp(void) {
  int ret;
  might_sleep();
  preempt_disable();
  ret = num_online_cpus() == 1;
  preempt_enable();
  return ret;
}


x86 assembly (clang, -O0):
<rcu_blocking_is_gp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <might_sleep@plt>
mov    $0x0,%al
call   1050 <preempt_disable@plt>
mov    $0x0,%al
call   1030 <num_online_cpus@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <preempt_enable@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcu_blocking_is_gp>:
push   %rbx
xor    %eax,%eax
call   1060 <might_sleep@plt>
xor    %eax,%eax
call   1050 <preempt_disable@plt>
xor    %eax,%eax
call   1030 <num_online_cpus@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
sete   %bl
xor    %eax,%eax
call   1040 <preempt_enable@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rcu_blocking_is_gp() {
%1 = alloca i32
%2 = call i32 (...) @might_sleep()
%3 = call i32 (...) @preempt_disable()
%4 = call i32 (...) @num_online_cpus()
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
store i32 %6, i32* %1
%7 = call i32 (...) @preempt_enable()
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @rcu_blocking_is_gp() {
%1 = tail call i32 (...) @might_sleep()
%2 = tail call i32 (...) @preempt_disable()
%3 = tail call i32 (...) @num_online_cpus()
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = tail call i32 (...) @preempt_enable()
ret i32 %5
}
float test_sfsi(int x) { return (float)x; }


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

x86 assembly (clang, -O2):
<test_sfsi>:
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @test_sfsi(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
void wifi_rsp_sme_power_on(const struct wifi_msg_sme_power_on_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_power_on_rsp_t = type opaque
define void @wifi_rsp_sme_power_on(%struct.wifi_msg_sme_power_on_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void show_version(char const *app_name) {
  printf("%s: "
         "oprofile"
         " "
         "0.9.1"
         " compiled on "
         "Mar 17 2022"
         " "
         "09:01:22"
         "\n",
         app_name);
  exit(EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<show_version>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"%s: oprofile 0.9.1 compiled on Mar 17 2022 09:01:22\0A\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"%s: oprofile 0.9.1 compiled on Mar 17 2022 09:01:22\0A\00"
@EXIT_SUCCESS = global i32 0
define void @show_version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ e_sec();
void e_sec_accu() { e_sec(); }


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

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

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

LLVM IR (-O2):
define void @e_sec_accu() {
%1 = tail call i32 (...) @e_sec()
ret void
}
int lprintf(format)
char *format;
{
  int _fputc();
  return _spr(&format, &_fputc, 2);
}


x86 assembly (clang, -O0):
<lprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <_spr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lprintf>:
push   %rax
mov    %rdi,(%rsp)
mov    0x2ec4(%rip),%rsi
mov    %rsp,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <_spr@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lprintf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8**, i32 (...)*, i32, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, i32, ...)*)(i8** %2, i32 (...)* @_fputc, i32 2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @lprintf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8**, i32 (...)*, i32, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, i32, ...)*)(i8** %2, i32 (...)* @_fputc, i32 2)
ret i32 %3
}