xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long rand();
unsigned long test_value(unsigned long nr) { return nr ? (rand() % nr) : 0; }


x86 assembly (clang, -O0):
<test_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <test_value+0x2f>
mov    $0x0,%al
call   1030 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,-0x10(%rbp)
jmp    114a <test_value+0x3a>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    114a <test_value+0x3a>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_value>:
push   %rbx
test   %rdi,%rdi
je     1136 <test_value+0x26>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113a <test_value+0x2a>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @test_value(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i64 (...) @rand()
%7 = load i64, i64* %2
%8 = urem i64 %6, %7
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi i64 [ %8, %5 ], [ 0, %9 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @test_value(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 (...) @rand()
%5 = urem i64 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int ENOSYS;
int hwconfig_subarg_cmp(const char *opt, const char *subopt,
                        const char *subarg) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<hwconfig_subarg_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwconfig_subarg_cmp>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @hwconfig_subarg_cmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @ENOSYS
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @hwconfig_subarg_cmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
ret i32 %5
}
int test_imm_4Euint8_reg(unsigned char val) {
  return ((val) & (-0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Euint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Euint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -78
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_4Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -78
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_region {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, struct wl_region *);
void wl_surface_set_input_region(struct wl_surface *wl_surface,
                                 struct wl_region *region) {
  wl_proxy_marshal((struct wl_proxy *)wl_surface, 5, region);
}


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

x86 assembly (clang, -O2):
<wl_surface_set_input_region>:
mov    %rsi,%rdx
mov    $0x5,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_surface = type { i32 }
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_input_region(%struct.wl_surface* %0, %struct.wl_region* %1) {
%3 = alloca %struct.wl_surface*
%4 = alloca %struct.wl_region*
store %struct.wl_surface* %0, %struct.wl_surface** %3
store %struct.wl_region* %1, %struct.wl_region** %4
%5 = load %struct.wl_surface*, %struct.wl_surface** %3
%6 = bitcast %struct.wl_surface* %5 to %struct.wl_proxy*
%7 = load %struct.wl_region*, %struct.wl_region** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 5, %struct.wl_region* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_surface = type { i32 }
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_input_region(%struct.wl_surface* %0, %struct.wl_region* %1) {
%3 = bitcast %struct.wl_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 5, %struct.wl_region* %1)
ret void
}
/* Variables and functions */
int exec(char *, char **);
int execvp(char *path, char **argv) { return exec(path, argv); }


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

x86 assembly (clang, -O2):
<execvp>:
jmp    1030 <exec@plt>

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

LLVM IR (-O2):
define i32 @execvp(i8* %0, i8** %1) {
%3 = tail call i32 @exec(i8* %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int touchpad_read_register(int, int /*<<< orphan*/ *);
bool touchpad_interrupt_status_read(uint8_t *interrupt_status) {
  return touchpad_read_register(0x14, interrupt_status);
}


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

x86 assembly (clang, -O2):
<touchpad_interrupt_status_read>:
mov    %rdi,%rsi
mov    $0x14,%edi
jmp    1030 <touchpad_read_register@plt>

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

LLVM IR (-O2):
define i32 @touchpad_interrupt_status_read(i32* %0) {
%2 = tail call i32 @touchpad_read_register(i32 20, i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t getblock(const uint32_t *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<getblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblock>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getblock(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getblock(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int cbools(int i, int *p) {
  int j = 10;
  while (j) {
    i++;
    j--;
  }
  return (i || !p);
}


x86 assembly (clang, -O0):
<cbools>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1133 <cbools+0x33>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <cbools+0x12>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jne    114f <cbools+0x4f>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbools>:
cmp    $0xfffffff6,%edi
setne  %al
test   %rsi,%rsi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @cbools(i32 %0, i32* readnone %1) {
%3 = icmp ne i32 %0, -10
%4 = icmp eq i32* %1, null
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void assertions2OENDSUBJECT() {}


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

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

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

LLVM IR (-O2):
define void @assertions2OENDSUBJECT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int random();
int /*<<< orphan*/ sleep(int);
void Pensar(int i) {
  int s;
  s = random() % 10;
  printf("Filosofo %d pensando %d segundos\n", i, s);
  sleep(s);
}


x86 assembly (clang, -O0):
<Pensar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pensar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <random@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    0xe9f(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <sleep@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Filosofo %d pensando %d segundos\0A\00"
define void @Pensar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @random()
%5 = srem i32 %4, 10
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @sleep(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Filosofo %d pensando %d segundos\0A\00"
define void @Pensar(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, 10
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
%5 = tail call i32 @sleep(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ps();
int main(int argc, char *argv[], char *envp[]) {
  ps();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @ps()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @ps()
ret i32 0
}
void intel_fbdev_fini(struct drm_i915_private *dev_priv) {}


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_fbdev_fini(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ EXTENDED_KEY_USAGE;
typedef int /*<<< orphan*/ ASN1_OBJECT;

/* Variables and functions */
int /*<<< orphan*/ *sk_ASN1_OBJECT_value(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/);
ASN1_OBJECT *GetX509EkuField(EXTENDED_KEY_USAGE *eku, int32_t loc) {
  return sk_ASN1_OBJECT_value(eku, loc);
}


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

x86 assembly (clang, -O2):
<GetX509EkuField>:
jmp    1030 <sk_ASN1_OBJECT_value@plt>

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

LLVM IR (-O2):
define i32* @GetX509EkuField(i32* %0, i32 %1) {
%3 = tail call i32* @sk_ASN1_OBJECT_value(i32* %0, i32 %1)
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_4_le(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, float const *, int);
void ivory_serialize_pack_float_le(uint8_t *dst, uint32_t offs,
                                   const float *src) {
  uint8_t tmp[4] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_4_le(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_float_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1030 <ivory_serialize_pack_prim_4_le@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_float_le>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_4_le@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_float_le(i32* %0, i32 %1, float* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float*
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store float* %2, float** %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = bitcast [4 x i32]* %7 to i32**
%10 = load float*, float** %6
%11 = call i32 @memcpy(i32** %9, float* %10, i32 16)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_4_le(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_float_le(i32* %0, i32 %1, float* %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = bitcast [4 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, float* %2, i32 16)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_4_le(i32* %9, i32* %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ pread64(int, void *, size_t, int /*<<< orphan*/);
ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
  return pread64(fd, buf, count, offset);
}


x86 assembly (clang, -O0):
<pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <pread64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pread>:
jmp    1030 <pread64@plt>

LLVM IR (-O0):
define i32 @pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @pread64(i32 %9, i8* %10, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @pread64(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
int isInPart(int atom, int *part, int partSize) {
  int k;
  for (k = 0; k < partSize; k++)
    if (part[k] == atom)
      return 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<isInPart>:
test   %edx,%edx
jle    111e <isInPart+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <isInPart+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <isInPart+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isInPart(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* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %6
%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* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, 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 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @isInPart(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 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* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void RTDbgAsLineByAddrA(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsLineByAddrA() {
ret void
}
void debug_rhal_printf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_rhal_printf(i8* nocapture %0, ...) {
ret void
}
int ubi_dbg_is_bgt_disabled(const struct ubi_device *ubi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_is_bgt_disabled(%struct.ubi_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ matmul3_c(float *, float *, float *);
void matmul3_neon(float m0[9], float m1[9], float d[9]) {
  matmul3_c(m0, m1, d);
}


x86 assembly (clang, -O0):
<matmul3_neon>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <matmul3_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matmul3_neon>:
jmp    1030 <matmul3_c@plt>

LLVM IR (-O0):
define void @matmul3_neon(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 = load float*, float** %6
%10 = call i32 @matmul3_c(float* %7, float* %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @matmul3_neon(float* %0, float* %1, float* %2) {
%4 = tail call i32 @matmul3_c(float* %0, float* %1, float* %2)
ret void
}
unsigned xrop3_106_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_106_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i32 %6, %4
%8 = xor i32 %7, %3
%9 = xor i32 %5, 255
%10 = xor i32 %4, -1
%11 = and i32 %10, %5
%12 = or i32 %11, %9
%13 = or i32 %12, %8
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ y;

/* Variables and functions */
int /*<<< orphan*/ printHex(unsigned char *, int);
int main() {
  int x = 17;
  int y = 0x12345678;
  printHex((unsigned char *)&y, sizeof(y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0x12345678,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
call   1030 <printHex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x12345678,0x4(%rsp)
12
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <printHex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
store i32 305419896, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @printHex(i8* %4, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 305419896, i32* %1
%3 = call i32 @printHex(i8* %2, i32 4)
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *convert_path_slashes(char *buf) {
  char *p;
  if (buf) {
    while ((p = strrchr(buf, '\\'))) {
      *p = '/';
    }
  }
  return buf;
}


x86 assembly (clang, -O0):
<convert_path_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <convert_path_slashes+0x49>
jmp    112c <convert_path_slashes+0x1c>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1154 <convert_path_slashes+0x44>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
jmp    112c <convert_path_slashes+0x1c>
jmp    1159 <convert_path_slashes+0x49>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_path_slashes>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1137 <convert_path_slashes+0x27>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1137 <convert_path_slashes+0x27>
movb   $0x2f,(%rax)
jmp    1120 <convert_path_slashes+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @convert_path_slashes(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load i8*, i8** %2
%9 = call i8* @strrchr(i8* %8, i8 signext 92)
store i8* %9, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8*, i8** %3
store i8 47, i8* %12
br label %7
13: ; preds = %7
br label %14
14: ; preds = %13, %1
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @convert_path_slashes(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 92)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %4, %3 ]
store i8 47, i8* %7
%8 = tail call i8* @strrchr(i8* %0, i8 signext 92)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %3, %1
ret i8* %0
}
int ptrQ_incr(int index) { return ((index + 1) % 1024); }


x86 assembly (clang, -O0):
<ptrQ_incr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrQ_incr>:
lea    0x1(%rdi),%eax
lea    0x400(%rdi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffc00,%ecx
neg    %ecx
lea    (%rdi,%rcx,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ptrQ_incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, 1024
ret i32 %5
}

LLVM IR (-O2):
define i32 @ptrQ_incr(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 1024
ret i32 %3
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int getrusage(int, struct rusage *);
int runtime_rusage(int who, struct rusage *r) { return getrusage(who, r); }


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

x86 assembly (clang, -O2):
<runtime_rusage>:
jmp    1030 <getrusage@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @runtime_rusage(i32 %0, %struct.rusage* %1) {
%3 = alloca i32
%4 = alloca %struct.rusage*
store i32 %0, i32* %3
store %struct.rusage* %1, %struct.rusage** %4
%5 = load i32, i32* %3
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = call i32 @getrusage(i32 %5, %struct.rusage* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @runtime_rusage(i32 %0, %struct.rusage* %1) {
%3 = tail call i32 @getrusage(i32 %0, %struct.rusage* %1)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int a[], int i, int j) {
  if (i >= j)
    return;
  else {
    int pivot = partition(a, i, j);
    quicksort(a, i, pivot - 1);
    quicksort(a, pivot + 1, j);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quicksort+0x23>
jmp    1179 <quicksort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(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* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %11, %12
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AutonomousCodePlaceholderForTesting();
int /*<<< orphan*/ UserControlCodePlaceholderForTesting();
void do_not_call_this_function() {
  UserControlCodePlaceholderForTesting();
  AutonomousCodePlaceholderForTesting();
  do_not_call_this_function();
}


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

x86 assembly (clang, -O2):
<do_not_call_this_function>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <UserControlCodePlaceholderForTesting@plt>
xor    %eax,%eax
call   1030 <AutonomousCodePlaceholderForTesting@plt>
jmp    1130 <do_not_call_this_function+0x10>

LLVM IR (-O0):
define void @do_not_call_this_function() {
%1 = call i32 (...) @UserControlCodePlaceholderForTesting()
%2 = call i32 (...) @AutonomousCodePlaceholderForTesting()
ret void
}

LLVM IR (-O2):
define void @do_not_call_this_function() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @UserControlCodePlaceholderForTesting()
%3 = tail call i32 (...) @AutonomousCodePlaceholderForTesting()
br label %1
}
void bar(long *x, long *y) {
  *x += 2;
  *y += 3;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
addq   $0x2,(%rdi)
addq   $0x3,(%rsi)
ret

LLVM IR (-O0):
define void @bar(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 2
store i64 %7, i64* %5
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = add nsw i64 %9, 3
store i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @bar(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = add nsw i64 %3, 2
store i64 %4, i64* %0
%5 = load i64, i64* %1
%6 = add nsw i64 %5, 3
store i64 %6, i64* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t htol_u16(uint16_t hostval) { return hostval; }


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

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

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

LLVM IR (-O2):
define i32 @htol_u16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int INT_MAX;
int main(void) {
  (long long)0 || INT_MAX - 1;
  return 0;
}


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

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

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MAX
%3 = sub nsw i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
ret i32 0
}
double u2d(u)
unsigned int u;
{ return u; }


x86 assembly (clang, -O0):
<u2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2d>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
ret

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

LLVM IR (-O2):
define double @u2d(i32 %0) {
%2 = uitofp i32 %0 to double
ret double %2
}
/* Variables and functions */
long ptrace(int, int, void *, void *);
long py_ptrace(int request, int pid, void *addr, void *data) {
  return ptrace(request, pid, addr, data);
}


x86 assembly (clang, -O0):
<py_ptrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <ptrace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_ptrace>:
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
define i64 @py_ptrace(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i64 @ptrace(i32 %9, i32 %10, i8* %11, i8* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @py_ptrace(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i64 @ptrace(i32 %0, i32 %1, i8* %2, i8* %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ region_write(int, int, int, int);
void nf_ncs0(int x) { region_write((0xB0E00000 + 0x4), 0x1, 1, (x)); }


x86 assembly (clang, -O0):
<nf_ncs0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xb0e00004,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <region_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_ncs0>:
mov    %edi,%ecx
mov    $0xb0e00004,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <region_write@plt>

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

LLVM IR (-O2):
define void @nf_ncs0(i32 %0) {
%2 = tail call i32 @region_write(i32 -1327497212, i32 1, i32 1, i32 %0)
ret void
}
/* Variables and functions */
int foo(int);
int main(void) { return foo(23) - 23; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1030 <foo@plt>
add    $0xffffffe9,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 23)
%3 = sub nsw i32 %2, 23
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 23)
%2 = add nsw i32 %1, -23
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
const uint8_t *packer_uint32_unpack(const uint8_t *buffer, uint32_t *value) {
  *value = ((uint32_t)buffer[0] << 24) + ((uint32_t)buffer[1] << 16) +
           ((uint32_t)buffer[2] << 8) + buffer[3];
  return buffer + 4;
}


x86 assembly (clang, -O0):
<packer_uint32_unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
add    0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packer_uint32_unpack>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
add    0xc(%rdi),%eax
mov    %eax,(%rsi)
lea    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @packer_uint32_unpack(i32* %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = add nsw i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
store i32 %15, i32* %1
%16 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int nondet_int();
int main() {
  int i, j, k;
  i = nondet_int();
  k = nondet_int();
  if (i) {
  } else {
    if (k) {
      assert(0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <main+0x32>
jmp    1168 <main+0x48>
cmpl   $0x0,-0x10(%rbp)
je     1163 <main+0x43>
xor    %edi,%edi
call   1040 <assert@plt>
jmp    1168 <main+0x48>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <nondet_int@plt>
test   %ebx,%ebx
jne    1140 <main+0x20>
test   %eax,%eax
je     1140 <main+0x20>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = tail call i32 (...) @nondet_int()
%3 = icmp eq i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @assert(i32 0)
br label %8
8: ; preds = %6, %0
ret i32 0
}
int KMAPI_GetAPIVersion_MINOR() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @KMAPI_GetAPIVersion_MINOR() {
ret i32 0
}
double calcTemp(double o, double t, double l, double r, double b) {
  return (o + t + l + r + b) / (double)5;
}


x86 assembly (clang, -O0):
<calcTemp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcTemp>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
divsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcTemp(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load double, double* %10
%19 = fadd double %17, %18
%20 = fdiv double %19, 5.000000e+00
ret double %20
}

LLVM IR (-O2):
define double @calcTemp(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = fadd double %8, %4
%10 = fdiv double %9, 5.000000e+00
ret double %10
}
void readEEPROM() {}


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

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

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

LLVM IR (-O2):
define void @readEEPROM() {
ret void
}
void extern_postdeclared2(void) {}


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

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

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

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