xunge/DecIR huggingface dataset:
/* Variables and functions */
int rdrand_long(unsigned long *);
int rdrand_seed() {
  unsigned long tmp;
  unsigned count, i;
  for (count = i = 0; i < ((512 * 128) / sizeof(unsigned long)); i++) {
    int ok = rdrand_long(&tmp);
    if (ok)
      count++;
  }
  return count == ((512 * 128) / sizeof(unsigned long));
}


x86 assembly (clang, -O0):
<rdrand_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    $0x2000,%rax
jae    1167 <rdrand_seed+0x57>
lea    -0x8(%rbp),%rdi
call   1030 <rdrand_long@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1154 <rdrand_seed+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <rdrand_seed+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <rdrand_seed+0x16>
mov    -0xc(%rbp),%eax
cmp    $0x2000,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand_seed>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebp,%ebp
mov    $0x2000,%ebx
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <rdrand_long@plt>
cmp    $0x1,%eax
sbb    $0xffffffff,%ebp
add    $0xffffffff,%ebx
jne    1130 <rdrand_seed+0x20>
xor    %eax,%eax
cmp    $0x2000,%ebp
sete   %al
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rdrand_seed() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %9, %3 ]
%5 = phi i32 [ 0, %0 ], [ %10, %3 ]
%6 = call i32 @rdrand_long(i64* %1)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add i32 %4, %8
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 8192
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = icmp eq i32 %9, 8192
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Delay();
void SuperDelay() {
  int i = 1;
  for (i = 1; i <= 576; i++) {
    Delay();
  }
}


x86 assembly (clang, -O0):
<SuperDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x240,-0x4(%rbp)
jg     1148 <SuperDelay+0x38>
mov    $0x0,%al
call   1030 <Delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <SuperDelay+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuperDelay>:
push   %rbx
mov    $0x240,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Delay@plt>
add    $0xffffffff,%ebx
jne    1120 <SuperDelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @SuperDelay() {
%1 = alloca i32
store i32 1, i32* %1
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 576
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @Delay()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @SuperDelay() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @Delay()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 577
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
void store64_reverse_2(long long *p, long long x) {
  p[1] = __builtin_bswap64(x);
}


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

x86 assembly (clang, -O2):
<store64_reverse_2>:
bswap  %rsi
mov    %rsi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @store64_reverse_2(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @llvm.bswap.i64(i64 %5)
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 1
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @store64_reverse_2(i64* nocapture writeonly %0, i64 %1) {
%3 = tail call i64 @llvm.bswap.i64(i64 %1)
%4 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %3, i64* %4
ret void
}
void scale_3f(float scalar, float *x) {
  x[0] *= scalar;
  x[1] *= scalar;
  x[2] *= scalar;
}


x86 assembly (clang, -O0):
<scale_3f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_3f>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @scale_3f(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fmul float %3, %0
store float %4, float* %1
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %0
store float %7, float* %5
%8 = getelementptr inbounds float, float* %1, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %0
store float %10, float* %8
ret void
}
int do_user_app(const char *cmd) {
  printf("[%05d:%s]"
         "%s"
         "\n",
         179, __FUNCTION__, cmd);
  return system(cmd);
}


x86 assembly (clang, -O0):
<do_user_app>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdi
mov    $0xb3,%esi
lea    0xeca(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_user_app>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rdx
mov    $0xb3,%esi
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[%05d:%s]%s\0A\00"
@__FUNCTION__.do_user_app = [12 x i8] c"do_user_app\00"
define i32 @do_user_app(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 179, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.do_user_app, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"[%05d:%s]%s\0A\00"
@__FUNCTION__.do_user_app = [12 x i8] c"do_user_app\00"
define i32 @do_user_app(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 179, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.do_user_app, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
ret i32 %3
}
void getTimeoutFromObjectOrReply(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               80, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<getTimeoutFromObjectOrReply>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x50,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeoutFromObjectOrReply>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x50,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getTimeoutFromObjectOrReply = [28 x i8] c"getTimeoutFromObjectOrReply\00"
define void @getTimeoutFromObjectOrReply() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.getTimeoutFromObjectOrReply, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getTimeoutFromObjectOrReply = [28 x i8] c"getTimeoutFromObjectOrReply\00"
define void @getTimeoutFromObjectOrReply() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.getTimeoutFromObjectOrReply, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sil_rb_path {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete (struct sil_rb_path *);
void sil_rb_delete(struct sil_rb_path *path) { delete (path); }


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

x86 assembly (clang, -O2):
<sil_rb_delete>:
jmp    1030 <delete@plt>

LLVM IR (-O0):
%struct.sil_rb_path = type { i32 }
define void @sil_rb_delete(%struct.sil_rb_path* %0) {
%2 = alloca %struct.sil_rb_path*
store %struct.sil_rb_path* %0, %struct.sil_rb_path** %2
%3 = load %struct.sil_rb_path*, %struct.sil_rb_path** %2
%4 = call i32 @delete(%struct.sil_rb_path* %3)
ret void
}

LLVM IR (-O2):
%struct.sil_rb_path = type { i32 }
define void @sil_rb_delete(%struct.sil_rb_path* %0) {
%2 = tail call i32 @delete(%struct.sil_rb_path* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CASER_DriverIRQHandler();
__attribute__((weak)) void CASER_IRQHandler(void) { CASER_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @CASER_IRQHandler() {
%1 = call i32 (...) @CASER_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CASER_IRQHandler() {
%1 = tail call i32 (...) @CASER_DriverIRQHandler()
ret void
}
void RTAvloGCPhysInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloGCPhysInsert() {
ret void
}
struct s3c24x0_interrupt *s3c24x0_get_base_interrupt(void) {
  return (struct s3c24x0_interrupt *)0x4A000000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_interrupt = type opaque
define %struct.s3c24x0_interrupt* @s3c24x0_get_base_interrupt() {
ret %struct.s3c24x0_interrupt* inttoptr (i64 1241513984 to %struct.s3c24x0_interrupt*)
}

LLVM IR (-O2):
%struct.s3c24x0_interrupt = type opaque
define %struct.s3c24x0_interrupt* @s3c24x0_get_base_interrupt() {
ret %struct.s3c24x0_interrupt* inttoptr (i64 1241513984 to %struct.s3c24x0_interrupt*)
}
/* Variables and functions */
int /*<<< orphan*/ _io_out8(int, int);
int /*<<< orphan*/ wait_KBC_sendready();
void enable_mouse(void) {
  wait_KBC_sendready();
  _io_out8(0x0064, 0xd4);
  wait_KBC_sendready();
  _io_out8(0x0060, 0xf4);
  return;
}


x86 assembly (clang, -O0):
<enable_mouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <_io_out8@plt>
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
call   1040 <_io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_mouse>:
push   %rax
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <_io_out8@plt>
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0xf4,%esi
pop    %rax
jmp    1040 <_io_out8@plt>

LLVM IR (-O0):
define void @enable_mouse() {
%1 = call i32 (...) @wait_KBC_sendready()
%2 = call i32 @_io_out8(i32 100, i32 212)
%3 = call i32 (...) @wait_KBC_sendready()
%4 = call i32 @_io_out8(i32 96, i32 244)
ret void
}

LLVM IR (-O2):
define void @enable_mouse() {
%1 = tail call i32 (...) @wait_KBC_sendready()
%2 = tail call i32 @_io_out8(i32 100, i32 212)
%3 = tail call i32 (...) @wait_KBC_sendready()
%4 = tail call i32 @_io_out8(i32 96, i32 244)
ret void
}
/* Variables and functions */
int load_shader_file(void const *, size_t, char *, void *, void *, int);
int load_vshader(void const *key, size_t size, void *data, void *link) {
  if (size == 0) {
    return -1;
  }
  return load_shader_file(key, size - 1, ".vert", data, link, 0x8B31);
}


x86 assembly (clang, -O0):
<load_vshader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113f <load_vshader+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <load_vshader+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xea6(%rip),%rdx
mov    $0x8b31,%r9d
call   1030 <load_shader_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_vshader>:
test   %rsi,%rsi
je     1131 <load_vshader+0x21>
mov    %rcx,%r8
mov    %rdx,%rcx
add    $0xffffffffffffffff,%rsi
lea    0xeda(%rip),%rdx
mov    $0x8b31,%r9d
jmp    1030 <load_shader_file@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c".vert\00"
define i32 @load_vshader(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = add i64 %1, -1
%8 = tail call i32 @load_shader_file(i8* %0, i64 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i32 35633)
br label %9
9: ; preds = %4, %6
%10 = phi i32 [ %8, %6 ], [ -1, %4 ]
ret i32 %10
}
int test_imm_5Auint8_mem(unsigned char *val) {
  return ((*val) & (0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Auint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x5a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Auint8_mem>:
testb  $0x5a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 90
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num) { return 0; }


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

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

LLVM IR (-O0):
%struct.hwbm_pool = type opaque
define i32 @hwbm_pool_add(%struct.hwbm_pool* %0, i32 %1) {
%3 = alloca %struct.hwbm_pool*
%4 = alloca i32
store %struct.hwbm_pool* %0, %struct.hwbm_pool** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.hwbm_pool = type opaque
define i32 @hwbm_pool_add(%struct.hwbm_pool* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage() {
  printf(
      "jpeg2theora %s - %s\nUsage: jpeg2theora [options] directory pattern\n"
      "  -o --output <filename.ogv>     file name for encoded output;\n"
      "                                 If this option is not given, the\n"
      "                                 compressed data is sent to stdout.\n\n"
      "  -d --denoise  <n>              Denoise filter (0-100)\n"
      "  -w --width  <n>                Image width\n"
      "  -h --height <n>                Image height\n"
      "  -v --video-quality <n>         Theora quality selector from 0 to 10\n"
      "  -k --keyframe-freq <n>         Keyframe frequency\n",
      "0.1", "Copyright (C) 2011 Open IP Cam Project");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0x10f5(%rip),%rsi
lea    0x10f2(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0x10f9(%rip),%rsi
lea    0x10f6(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [535 x i8] c"jpeg2theora %s - %s\0AUsage: jpeg2theora [options] directory pattern\0A -o --output <filename.ogv> file name for encoded output;\0A If this option is not given, the\0A compressed data is sent to stdout.\0A\0A -d --denoise <n> Denoise filter (0-100)\0A -w --width <n> Image width\0A -h --height <n> Image height\0A -v --video-quality <n> Theora quality selector from 0 to 10\0A -k --keyframe-freq <n> Keyframe frequency\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [39 x i8] c"Copyright (C) 2011 Open IP Cam Project\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([535 x i8], [535 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [535 x i8] c"jpeg2theora %s - %s\0AUsage: jpeg2theora [options] directory pattern\0A -o --output <filename.ogv> file name for encoded output;\0A If this option is not given, the\0A compressed data is sent to stdout.\0A\0A -d --denoise <n> Denoise filter (0-100)\0A -w --width <n> Image width\0A -h --height <n> Image height\0A -v --video-quality <n> Theora quality selector from 0 to 10\0A -k --keyframe-freq <n> Keyframe frequency\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [39 x i8] c"Copyright (C) 2011 Open IP Cam Project\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([535 x i8], [535 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void outputAr(int *mas, int n) {
  int i = 0;
  for (; i < n; i++)
    printf("Ar[%d] = %d\n", i, mas[i]);
}


x86 assembly (clang, -O0):
<outputAr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <outputAr+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <outputAr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputAr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <outputAr+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <outputAr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Ar[%d] = %d\0A\00"
define void @outputAr(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 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Ar[%d] = %d\0A\00"
define void @outputAr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
int lower(int c) { return (c >= 'A' && c <= 'Z' ? c + 'a' - 'A' : c); }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <lower+0x2c>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 97
%11 = sub nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_807x(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_807x() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_set_label_color(int, int, int);
void gui_update_run_enable(int enable) {
  if (enable) {
    gui_set_label_color(2, 0xff00ff00, 0xff000000);
  } else {
    gui_set_label_color(2, 0xff669966, 0xff000000);
  }
}


x86 assembly (clang, -O0):
<gui_update_run_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <gui_update_run_enable+0x2e>
mov    $0x2,%edi
mov    $0xff00ff00,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    1152 <gui_update_run_enable+0x42>
mov    $0x2,%edi
mov    $0xff669966,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_update_run_enable>:
test   %edi,%edi
mov    $0xff669966,%eax
mov    $0xff00ff00,%esi
cmove  %eax,%esi
mov    $0x2,%edi
mov    $0xff000000,%edx
jmp    1030 <gui_set_label_color@plt>

LLVM IR (-O0):
define void @gui_update_run_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @gui_set_label_color(i32 2, i32 -16711936, i32 -16777216)
br label %9
7: ; preds = %1
%8 = call i32 @gui_set_label_color(i32 2, i32 -10053274, i32 -16777216)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @gui_update_run_enable(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 -10053274, i32 -16711936
%4 = tail call i32 @gui_set_label_color(i32 2, i32 %3, i32 -16777216)
ret void
}
int hputra(hstring, keyword, ra)
char *hstring;
const char *keyword;
const double ra;
{
  char value[30];
  ra2str(value, 30, ra, 3);
  fixnegzero(value);
  return (hputs(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x1e,%esi
mov    $0x3,%edx
mov    $0x1,%al
call   1040 <ra2str@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <fixnegzero@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1050 <hputs@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputra>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1e,%esi
mov    $0x3,%edx
mov    $0x1,%al
call   1040 <ra2str@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <fixnegzero@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <hputs@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @hputra(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load double, double* %6
%10 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @ra2str to i32 (i8*, i32, double, i32, ...)*)(i8* %8, i32 30, double %9, i32 3)
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @fixnegzero to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%16 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @hputra(i8* %0, i8* %1, double %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @ra2str to i32 (i8*, i32, double, i32, ...)*)(i8* %5, i32 30, double %2, i32 3)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @fixnegzero to i32 (i8*, ...)*)(i8* %5)
%8 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret i32 %8
}
/* Type definitions */
struct WdStack {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wdPeekAt(struct WdStack *, int);
int /*<<< orphan*/ wdPokeAt(int /*<<< orphan*/, struct WdStack *, int);
int32_t wdSwap(struct WdStack *s) {
  int32_t n1 = wdPeekAt(s, 1);
  int32_t n2 = wdPeekAt(s, 2);
  wdPokeAt(n1, s, 2);
  wdPokeAt(n2, s, 1);
}


x86 assembly (clang, -O0):
<wdSwap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <wdPeekAt@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <wdPeekAt@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <wdPokeAt@plt>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <wdPokeAt@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdSwap>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <wdPeekAt@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <wdPeekAt@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <wdPokeAt@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <wdPokeAt@plt>

LLVM IR (-O0):
%struct.WdStack = type { i32 }
define i32 @wdSwap(%struct.WdStack* %0) {
%2 = alloca i32
%3 = alloca %struct.WdStack*
%4 = alloca i32
%5 = alloca i32
store %struct.WdStack* %0, %struct.WdStack** %3
%6 = load %struct.WdStack*, %struct.WdStack** %3
%7 = call i32 @wdPeekAt(%struct.WdStack* %6, i32 1)
store i32 %7, i32* %4
%8 = load %struct.WdStack*, %struct.WdStack** %3
%9 = call i32 @wdPeekAt(%struct.WdStack* %8, i32 2)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load %struct.WdStack*, %struct.WdStack** %3
%12 = call i32 @wdPokeAt(i32 %10, %struct.WdStack* %11, i32 2)
%13 = load i32, i32* %5
%14 = load %struct.WdStack*, %struct.WdStack** %3
%15 = call i32 @wdPokeAt(i32 %13, %struct.WdStack* %14, i32 1)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.WdStack = type { i32 }
define i32 @wdSwap(%struct.WdStack* %0) {
%2 = tail call i32 @wdPeekAt(%struct.WdStack* %0, i32 1)
%3 = tail call i32 @wdPeekAt(%struct.WdStack* %0, i32 2)
%4 = tail call i32 @wdPokeAt(i32 %2, %struct.WdStack* %0, i32 2)
%5 = tail call i32 @wdPokeAt(i32 %3, %struct.WdStack* %0, i32 1)
ret i32 undef
}
char foo(void *v) { return *(char *)v; }


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

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @foo(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
void set_XSelectionClearEvent_serial(void *_p, unsigned long _v) {
  ((XSelectionClearEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XSelectionClearEvent_serial>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XSelectionClearEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
double det2x2(double a1, double a2, double b1, double b2) {
  return ((a1 * b2) - (a2 * b1));
}


x86 assembly (clang, -O0):
<det2x2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<det2x2>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @det2x2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @det2x2(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
int test_imm_E2uint32_mem(unsigned int *val) {
  return ((*val) & (0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2uint32_mem>:
testb  $0xe2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E2uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 226
%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_E2uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 226
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void minus(int i) {
  printf("Input was %d\n", i);
  printf("%d * -1 = %d\n", i, -i);
}


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

x86 assembly (clang, -O2):
<minus>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edx
neg    %edx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Input was %d\0A\00"
@.str.1 = [14 x i8] c"%d * -1 = %d\0A\00"
define void @minus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Input was %d\0A\00"
@.str.1 = [14 x i8] c"%d * -1 = %d\0A\00"
define void @minus(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = sub nsw i32 0, %0
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %3)
ret void
}
float obdConvert_33(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A;
}


x86 assembly (clang, -O0):
<obdConvert_33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @obdConvert_33(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @obdConvert_33(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
ret float %5
}
/* Type definitions */
struct DEV {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct DEV *);
void Destroy(struct DEV *self) {
  if (self != NULL)
    free(self);
}


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

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

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

LLVM IR (-O2):
%struct.DEV = type { i32 }
define void @Destroy(%struct.DEV* %0) {
%2 = icmp eq %struct.DEV* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.DEV* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
  int flags;
  scalar_t__ num;
};
typedef TYPE_1__ ca_slot_info_t;

/* Variables and functions */
int /*<<< orphan*/ CA_GET_SLOT_INFO;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int /*<<< orphan*/ printf(char *, int, int);
void ci_get_info(int fd) {
  ca_slot_info_t info;
  info.num = 0;
  ioctl(fd, CA_GET_SLOT_INFO, &info);
  printf("INFO type=%d, flags=0x%02x\n", info.type, info.flags);
}


x86 assembly (clang, -O0):
<ci_get_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ci_get_info>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1040 <ioctl@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i64 }
@CA_GET_SLOT_INFO = global i32 0
@.str = [28 x i8] c"INFO type=%d, flags=0x%02x\0A\00"
define void @ci_get_info(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_3__
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 2
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @CA_GET_SLOT_INFO
%7 = call i32 @ioctl(i32 %5, i32 %6, %struct.TYPE_3__* %3)
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i64 }
@CA_GET_SLOT_INFO = global i32 0
@.str = [28 x i8] c"INFO type=%d, flags=0x%02x\0A\00"
define void @ci_get_info(i32 %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 2
store i64 0, i64* %4
%5 = load i32, i32* @CA_GET_SLOT_INFO
%6 = call i32 @ioctl(i32 %0, i32 %5, %struct.TYPE_3__* %2)
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret void
}
void functionWithCapturedStmt() {
#pragma clang __debug captured
  {
    printf("__func__ %s\n", __func__);
    printf("__FUNCTION__ %s\n", __FUNCTION__);
    printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
  }
}


x86 assembly (clang, -O0):
<functionWithCapturedStmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1130 <__captured_stmt>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<functionWithCapturedStmt>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xf08(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.anon = type {}
@.str = [13 x i8] c"__func__ %s\0A\00"
@__func__.__captured_stmt = [25 x i8] c"functionWithCapturedStmt\00"
@.str.1 = [17 x i8] c"__FUNCTION__ %s\0A\00"
@.str.2 = [25 x i8] c"__PRETTY_FUNCTION__ %s\0A\0A\00"
@__PRETTY_FUNCTION__.__captured_stmt = [32 x i8] c"void functionWithCapturedStmt()\00"
define void @functionWithCapturedStmt() {
%1 = alloca %struct.anon
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.__captured_stmt, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.__captured_stmt, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__PRETTY_FUNCTION__.__captured_stmt, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.anon = type {}
@.str = [13 x i8] c"__func__ %s\0A\00"
@__func__.__captured_stmt = [25 x i8] c"functionWithCapturedStmt\00"
@.str.1 = [17 x i8] c"__FUNCTION__ %s\0A\00"
@.str.2 = [25 x i8] c"__PRETTY_FUNCTION__ %s\0A\0A\00"
@__PRETTY_FUNCTION__.__captured_stmt = [32 x i8] c"void functionWithCapturedStmt()\00"
define void @functionWithCapturedStmt() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.__captured_stmt, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.__captured_stmt, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__PRETTY_FUNCTION__.__captured_stmt, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_unsigned_short(unsigned short const k1,
                                             unsigned short const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_unsigned_short>:
xor    %eax,%eax
cmp    %si,%di
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp eq i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int Sys_FileTime(const char *path) {
  struct stat buf;
  if (stat(path, &buf) == -1)
    return -1;
  return buf.st_mtime;
}


x86 assembly (clang, -O0):
<Sys_FileTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <Sys_FileTime+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <Sys_FileTime+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FileTime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <Sys_FileTime+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @Sys_FileTime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}