xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ strncasecmp(char const *, char const *, int);
bool is_equal(const char *buff, int len, const char *str) {
  int y = strlen(str);
  if (len != y)
    return false;
  return !strncasecmp(buff, str, len);
}


x86 assembly (clang, -O0):
<is_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1157 <is_equal+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1177 <is_equal+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_equal>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
jne    1153 <is_equal+0x33>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <strncasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @is_equal(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %23
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i8*, i8** %7
%18 = load i32, i32* %6
%19 = call i32 @strncasecmp(i8* %16, i8* %17, i32 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
store i32 %22, i32* %4
br label %23
23: ; preds = %15, %14
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_equal(i8* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @strncasecmp(i8* %0, i8* %2, i32 %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ %9, %6 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_bcd_inc();
int main(void) {
  test_bcd_inc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_bcd_inc()
ret i32 0
}
void ASN1_STRING_print_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_print_ex() {
ret void
}
void INT_Excep_PERIB_INTB144(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB144() {
ret void
}
int p_online(int processorid, int flag) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @p_online(i32 %0, i32 %1) {
ret i32 2
}
/* Type definitions */
struct pagetable {
  int dummy;
};

/* Variables and functions */
scalar_t__ memory_alloc_page(int);
struct pagetable *pagetable_create() {
  return (struct pagetable *)memory_alloc_page(1);
}


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

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

LLVM IR (-O0):
%struct.pagetable = type { i32 }
define %struct.pagetable* @pagetable_create() {
%1 = call i64 @memory_alloc_page(i32 1)
%2 = inttoptr i64 %1 to %struct.pagetable*
ret %struct.pagetable* %2
}

LLVM IR (-O2):
%struct.pagetable = type { i32 }
define %struct.pagetable* @pagetable_create() {
%1 = tail call i64 @memory_alloc_page(i32 1)
%2 = inttoptr i64 %1 to %struct.pagetable*
ret %struct.pagetable* %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ lstat(char const *, struct stat *);
int checkdir(const char *dir) {
  if (NULL == dir) {
    return 0;
  }
  struct stat st;
  if (lstat(dir, &st) < 0) {
    return 0;
  }
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<checkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1144 <checkdir+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1172 <checkdir+0x52>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
jge    1167 <checkdir+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1172 <checkdir+0x52>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkdir>:
test   %rdi,%rdi
je     1140 <checkdir+0x20>
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %rax,%rax
js     1143 <checkdir+0x23>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @checkdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @lstat(i8* %9, %struct.stat* %4)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %17
13: ; preds = %8
%14 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i32 @S_ISDIR(i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @checkdir(i8* %0) {
%2 = alloca %struct.stat
%3 = icmp eq i8* %0, null
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = bitcast %struct.stat* %2 to i8*
%6 = call i64 @lstat(i8* %0, %struct.stat* %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @S_ISDIR(i32 %10)
br label %12
12: ; preds = %4, %8
%13 = phi i32 [ %11, %8 ], [ 0, %4 ]
br label %14
14: ; preds = %1, %12
%15 = phi i32 [ %13, %12 ], [ 0, %1 ]
ret i32 %15
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Evexp_const_exp_cmp(struct Cyc_Absyn_Exp *,
                                           struct Cyc_Absyn_Exp *);
int Cyc_Evexp_same_const_exp(struct Cyc_Absyn_Exp *e1,
                             struct Cyc_Absyn_Exp *e2) {
  return ({ Cyc_Evexp_const_exp_cmp(e1, e2); }) == 0;
}


x86 assembly (clang, -O0):
<Cyc_Evexp_same_const_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Evexp_const_exp_cmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define i32 @Cyc_Evexp_same_const_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = alloca %struct.Cyc_Absyn_Exp*
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca i32
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %3
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %4
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
%7 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%8 = call i32 @Cyc_Evexp_const_exp_cmp(%struct.Cyc_Absyn_Exp* %6, %struct.Cyc_Absyn_Exp* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define i32 @Cyc_Evexp_same_const_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = tail call i32 @Cyc_Evexp_const_exp_cmp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void my_srand(int x) { srand(x); }


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

x86 assembly (clang, -O2):
<my_srand>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @my_srand(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
void led_toggle() {}


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

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

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

LLVM IR (-O2):
define void @led_toggle() {
ret void
}
void ble_rsp_hardware_analog_comparator_enable(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_hardware_analog_comparator_enable(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_get_standard_start(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 0;
  ptos[1] = 0;
  fail = _ada_use_c2phc(619, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_standard_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_standard_start>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_standard_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 619, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_standard_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 0, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 619, i32* %6, i32* %3, double* %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete (void *data) {
  if (data != NULL) {
    free(data);
    data = NULL;
  }
}


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

x86 assembly (clang, -O2):
<delete>:
test   %rdi,%rdi
je     111a <delete+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @delete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void bar_write16(uint32_t bar, uint32_t offset, uint16_t value) {
  volatile uint16_t *preg = (volatile uint16_t *)(bar | (offset & 0xFF));
  *preg = value;
}


x86 assembly (clang, -O0):
<bar_write16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_write16>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @bar_write16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = or i32 %8, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %7
%14 = load i32, i32* %6
%15 = load i32*, i32** %7
store volatile i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @bar_write16(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = or i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %2, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int ivory_serialize_unpack_prim_4_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int *, int);
void ivory_serialize_unpack_int32_be(const uint8_t *src, uint32_t offs,
                                     int32_t *dst) {
  uint32_t tmp = ivory_serialize_unpack_prim_4_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_int32_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_4_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_int32_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_4_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_int32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_4_be(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_int32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_4_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
int _CheckLine(char *buf) {
  int i = 0;
  if (buf[i] == '\n') {
    if (buf[i - 1] == '\r')
      i = 2;
    else
      i = 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<_CheckLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <_CheckLine+0x56>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    114a <_CheckLine+0x4a>
movl   $0x2,-0xc(%rbp)
jmp    1151 <_CheckLine+0x51>
movl   $0x1,-0xc(%rbp)
jmp    1156 <_CheckLine+0x56>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CheckLine>:
xor    %eax,%eax
cmpb   $0xa,(%rdi)
jne    1113 <_CheckLine+0x13>
xor    %eax,%eax
cmpb   $0xd,-0x1(%rdi)
sete   %al
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_CheckLine(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 13
%8 = select i1 %7, i32 2, i32 1
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void foo(char *p) { __builtin_memset(p, 0, 32); }


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

x86 assembly (clang, -O2):
<foo>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(32) %0, i8 0, i64 32, i1 false)
ret void
}
struct running_checksum *priv_to_rc(struct sha256_running_checksum *priv) {
  return (struct running_checksum *)priv;
}


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

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

LLVM IR (-O0):
%struct.running_checksum = type opaque
%struct.sha256_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.sha256_running_checksum* %0) {
%2 = alloca %struct.sha256_running_checksum*
store %struct.sha256_running_checksum* %0, %struct.sha256_running_checksum** %2
%3 = load %struct.sha256_running_checksum*, %struct.sha256_running_checksum** %2
%4 = bitcast %struct.sha256_running_checksum* %3 to %struct.running_checksum*
ret %struct.running_checksum* %4
}

LLVM IR (-O2):
%struct.running_checksum = type opaque
%struct.sha256_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.sha256_running_checksum* readnone %0) {
%2 = bitcast %struct.sha256_running_checksum* %0 to %struct.running_checksum*
ret %struct.running_checksum* %2
}
int main() { return sizeof(unsigned long long); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int nulstr_get(char const *, char const *);
bool nulstr_contains(const char *nulstr, const char *needle) {
  return nulstr_get(nulstr, needle);
}


x86 assembly (clang, -O0):
<nulstr_contains>:
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 <nulstr_get@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nulstr_contains>:
jmp    1030 <nulstr_get@plt>

LLVM IR (-O0):
define i32 @nulstr_contains(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 @nulstr_get(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @nulstr_contains(i8* %0, i8* %1) {
%3 = tail call i32 @nulstr_get(i8* %0, i8* %1)
ret i32 %3
}
char square_to_file(int square) { return (square % 8) + 97; }


x86 assembly (clang, -O0):
<square_to_file>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_to_file>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xf8,%eax
sub    %eax,%edi
lea    0x61(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @square_to_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 8
%5 = add nsw i32 %4, 97
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @square_to_file(i32 %0) {
%2 = srem i32 %0, 8
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 97
ret i8 %4
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dictClear(struct dict *);
int /*<<< orphan*/ wfree(struct dict *);
void dictRelease(struct dict *d) {
  dictClear(d);
  wfree(d);
}


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

x86 assembly (clang, -O2):
<dictRelease>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dictClear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <wfree@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
define void @dictRelease(%struct.dict* %0) {
%2 = alloca %struct.dict*
store %struct.dict* %0, %struct.dict** %2
%3 = load %struct.dict*, %struct.dict** %2
%4 = call i32 @dictClear(%struct.dict* %3)
%5 = load %struct.dict*, %struct.dict** %2
%6 = call i32 @wfree(%struct.dict* %5)
ret void
}

LLVM IR (-O2):
%struct.dict = type { i32 }
define void @dictRelease(%struct.dict* %0) {
%2 = tail call i32 @dictClear(%struct.dict* %0)
%3 = tail call i32 @wfree(%struct.dict* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int unload_module(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: %s <module name>\n", argv[0]);
    return 0;
  } else
    return unload_module(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <unload_module@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <unload_module@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s <module name>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @unload_module(i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s <module name>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @unload_module(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
double nan(char *);
double trio_nan(void) {
  static double result = 0.0;
  if (result == 0.0) {
    result = nan("");
  }
  return result;
}


x86 assembly (clang, -O0):
<trio_nan>:
push   %rbp
mov    %rsp,%rbp
movsd  0x2f14(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1143 <trio_nan+0x33>
jp     1143 <trio_nan+0x33>
lea    0xeca(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,0x2eed(%rip)
movsd  0x2ee5(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_nan>:
push   %rax
movsd  0x2f17(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1139 <trio_nan+0x29>
jp     1139 <trio_nan+0x29>
lea    0xed4(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,0x2ef7(%rip)
pop    %rax
ret

LLVM IR (-O0):
@trio_nan.result = internal global double 0.000000e+00
@.str = [1 x i8] zeroinitializer
define double @trio_nan() {
%1 = load double, double* @trio_nan.result
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call double @nan(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store double %4, double* @trio_nan.result
br label %5
5: ; preds = %3, %0
%6 = load double, double* @trio_nan.result
ret double %6
}

LLVM IR (-O2):
@trio_nan.result = internal unnamed_addr global double 0.000000e+00
@.str = [1 x i8] zeroinitializer
define double @trio_nan() {
%1 = load double, double* @trio_nan.result
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call double @nan(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store double %4, double* @trio_nan.result
br label %5
5: ; preds = %3, %0
%6 = phi double [ %4, %3 ], [ %1, %0 ]
ret double %6
}
float warp_saturatef(float val, float min, float max) {
  return (val < min ? min : (val > max ? max : val));
}


x86 assembly (clang, -O0):
<warp_saturatef>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <warp_saturatef+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <warp_saturatef+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <warp_saturatef+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <warp_saturatef+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_saturatef>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @warp_saturatef(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @warp_saturatef(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xbd() {
  Assert_real((isalpha(189) == 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_isalpha.c",
              950, ("isalpha should be 0 for 0xbd"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xbd>:
push   %rax
mov    $0xbd,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b6,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xbd\00"
define void @t_isalpha_0xbd() {
%1 = call i64 @isalpha(i32 189)
%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 950, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xbd\00"
define void @t_isalpha_0xbd() {
%1 = tail call i64 @isalpha(i32 189)
%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 950, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AD7490_reset(void *);
void AD7490_init(void *AD7490_address) {
  AD7490_reset(AD7490_address);
  *((volatile int *)AD7490_address + 3) = 2;
  *((volatile char *)&*((volatile int *)AD7490_address + 2) + 2) = 0;
  *((volatile char *)&*((volatile int *)AD7490_address + 2) + 1) = 1;
}


x86 assembly (clang, -O0):
<AD7490_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <AD7490_reset@plt>
mov    -0x8(%rbp),%rax
movl   $0x2,0xc(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xa(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x9(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AD7490_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <AD7490_reset@plt>
movl   $0x2,0xc(%rbx)
movb   $0x0,0xa(%rbx)
movb   $0x1,0x9(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @AD7490_init(i8* %0) {
%2 = tail call i32 @AD7490_reset(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = bitcast i8* %3 to i32*
store volatile i32 2, i32* %4
%5 = getelementptr inbounds i8, i8* %0, i64 10
store volatile i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 9
store volatile i8 1, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void http_response(int fd, char *code) {
  char header[512];
  sprintf(header,
          "HTTP/1.1 %s\r\n"
          "Content-Type:	text/html\r\n\r\n"
          "%s\r\n",
          code, code);
  (void)write(fd, header, strlen(header));
}


x86 assembly (clang, -O0):
<http_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea8(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x21c(%rbp),%edi
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_response>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rcx
mov    %edi,%ebp
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"HTTP/1.1 %s\0D\0AContent-Type:\09text/html\0D\0A\0D\0A%s\0D\0A\00"
define void @http_response(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i32, i32* %3
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 %10, i8* %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"HTTP/1.1 %s\0D\0AContent-Type:\09text/html\0D\0A\0D\0A%s\0D\0A\00"
define void @http_response(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @write(i32 %0, i8* %4, i32 %6)
ret void
}
void av_dict_count() {}


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

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

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

LLVM IR (-O2):
define void @av_dict_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ machdep_SystemTerm();
void McSrv_SystemTerm(void) { machdep_SystemTerm(); }


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

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

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

LLVM IR (-O2):
define void @McSrv_SystemTerm() {
%1 = tail call i32 (...) @machdep_SystemTerm()
ret void
}
unsigned long rdmsr(unsigned int msr) {
  unsigned low, high;
  asm volatile("rdmsr" : "=a"(low), "=d"(high) : "c"(msr));
  return low | ((unsigned long)high << 32);
}


x86 assembly (clang, -O0):
<rdmsr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
rdmsr
mov    %eax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdmsr>:
mov    %edi,%ecx
rdmsr
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdmsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = shl i64 %12, 32
%14 = or i64 %10, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @rdmsr(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
%4 = extractvalue { i32, i32 } %2, 1
%5 = zext i32 %3 to i64
%6 = zext i32 %4 to i64
%7 = shl nuw i64 %6, 32
%8 = or i64 %7, %5
ret i64 %8
}
void ClobberMemory() { asm volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @ClobberMemory() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int Door_isOpen();
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
char *isDoorOpen() {
  char *response = (char *)malloc(sizeof(char) * 1024);
  memset(response, 0, sizeof(char) * 1024);
  char buffer[512];
  sprintf(buffer, "%d\n", Door_isOpen());
  strcat(response, buffer);
  return response;
}


x86 assembly (clang, -O0):
<isDoorOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    $0x0,%al
call   1040 <Door_isOpen@plt>
mov    -0x218(%rbp),%rdi
mov    %eax,%edx
lea    0xe62(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDoorOpen>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
xor    %eax,%eax
call   1040 <Door_isOpen@plt>
lea    0xe7c(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%edx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i8* @isDoorOpen() {
%1 = alloca i8*
%2 = alloca [512 x i8]
%3 = call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @memset(i8* %5, i32 0, i32 1024)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%8 = call i32 (...) @Door_isOpen()
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %1
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i8* @isDoorOpen() {
%1 = alloca [512 x i8]
%2 = tail call i64 @malloc(i32 1024)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @memset(i8* %3, i32 0, i32 1024)
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%6 = tail call i32 (...) @Door_isOpen()
%7 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @strcat(i8* %3, i8* %5)
ret i8* %3
}
/* Variables and functions */
float rint(float);
void Sys_SnapVector(float *v) {
  v[0] = rint(v[0]);
  v[1] = rint(v[1]);
  v[2] = rint(v[2]);
}


x86 assembly (clang, -O0):
<Sys_SnapVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_SnapVector>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <rintf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%rbx),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Sys_SnapVector(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @rint(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @rint(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @rint(float %17)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @Sys_SnapVector(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.rint.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.rint.f32(float %5)
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.rint.f32(float %8)
store float %9, float* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PerfCounterHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PerfCounterUpdated() { UAVObjUpdated(PerfCounterHandle()); }


x86 assembly (clang, -O0):
<PerfCounterUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PerfCounterHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PerfCounterUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <PerfCounterHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @PerfCounterUpdated() {
%1 = call i32 (...) @PerfCounterHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PerfCounterUpdated() {
%1 = tail call i32 (...) @PerfCounterHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void *new_thread_1(void *new_buf) {
  int i;
  sprintf((char *)new_buf, "New thread %%d stack at %x\n", &i);
  pthread_yield();
  return (new_buf);
  PANIC();
}


x86 assembly (clang, -O0):
<new_thread_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    $0x0,%al
call   1030 <pthread_yield@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_thread_1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
xor    %eax,%eax
call   1030 <pthread_yield@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"New thread %%d stack at %x\0A\00"
define i8* @new_thread_1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 (...) @pthread_yield()
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [28 x i8] c"New thread %%d stack at %x\0A\00"
define i8* @new_thread_1(i8* returned writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 (...) @pthread_yield()
ret i8* %0
}
void EndDraw(void) { __asm__ __volatile__("int $0x40" ::"a"(12), "b"(2)); }


x86 assembly (clang, -O0):
<EndDraw>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndDraw>:
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @EndDraw() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 12, i32 2)
ret void
}