xunge/DecIR huggingface dataset:
void bfqg_stats_update_dequeue(struct bfq_group *bfqg) {}


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

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

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

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_dequeue(%struct.bfq_group* nocapture %0) {
ret void
}
logical_or(short a, short b) { return a || b; }


x86 assembly (clang, -O0):
<logical_or>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1131 <logical_or+0x31>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_or>:
xor    %eax,%eax
or     %di,%si
setne  %al
ret

LLVM IR (-O0):
define i32 @logical_or(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @logical_or(i16 signext %0, i16 signext %1) {
%3 = or i16 %1, %0
%4 = icmp ne i16 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
float _lgammaf(float);
float lgammaf(float x) { return _lgammaf(x); }


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

x86 assembly (clang, -O2):
<lgammaf>:
jmp    1030 <_lgammaf@plt>

LLVM IR (-O0):
define float @lgammaf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_lgammaf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @lgammaf(float %0) {
%2 = tail call float @_lgammaf(float %0)
ret float %2
}
int Luminance(int r, int g, int b) { return (r * 77 + g * 143 + b * 37) >> 8; }


x86 assembly (clang, -O0):
<Luminance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x4d,-0x4(%rbp),%eax
imul   $0x8f,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x25,-0xc(%rbp),%ecx
add    %ecx,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Luminance>:
imul   $0x4d,%edi,%eax
imul   $0x8f,%esi,%ecx
add    %eax,%ecx
lea    (%rdx,%rdx,8),%eax
lea    (%rdx,%rax,4),%eax
add    %ecx,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @Luminance(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 77
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 143
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 37
%14 = add nsw i32 %11, %13
%15 = ashr i32 %14, 8
ret i32 %15
}

LLVM IR (-O2):
define i32 @Luminance(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 77
%5 = mul nsw i32 %1, 143
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 37
%8 = add nsw i32 %6, %7
%9 = ashr i32 %8, 8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ av_free_hw(void *);
void av_freep(void *arg) {
  void **ptr = (void **)arg;
  if (!ptr || !*ptr)
    return;
  av_free_hw(*ptr);
  *ptr = NULL;
}


x86 assembly (clang, -O0):
<av_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <av_freep+0x2d>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1142 <av_freep+0x32>
jmp    1159 <av_freep+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <av_free_hw@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_freep>:
push   %rbx
test   %rdi,%rdi
je     112d <av_freep+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <av_freep+0x1d>
call   1030 <av_free_hw@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @av_freep(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = icmp ne i8** %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %8, %1
br label %18
13: ; preds = %8
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = call i32 @av_free_hw(i8* %15)
%17 = load i8**, i8*** %3
store i8* null, i8** %17
br label %18
18: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @av_freep(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @av_free_hw(i8* %5)
store i8* null, i8** %2
br label %9
9: ; preds = %1, %4, %7
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ my_err(char *, char *, int, size_t);
void *my_malloc(size_t n_bytes) {
  void *mem;
  mem = malloc(n_bytes);
  if (!mem) {
    my_err("%s:%d: could not allocate %ld bytes of memory\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/"
           "memutil.c",
           19, n_bytes);
  }
  return mem;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <my_malloc+0x40>
mov    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x13,%edx
call   1040 <my_err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <my_malloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x13,%edx
mov    %r14,%rcx
call   1040 <my_err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [47 x i8] c"%s:%d: could not allocate %ld bytes of memory\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/memutil.c\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @my_err(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 19, i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [47 x i8] c"%s:%d: could not allocate %ld bytes of memory\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/memutil.c\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @my_err(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 19, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_open_system_container(void **ret, const char *machine) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_open_system_container(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_open_system_container(i8** nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  struct TYPE_4__ *fts_link;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int /*<<< orphan*/ fts_free(TYPE_1__ *);
void fts_lfree(FTSENT *head) {
  FTSENT *p;
  while ((p = head) != NULL) {
    head = head->fts_link;
    fts_free(p);
  }
}


x86 assembly (clang, -O0):
<fts_lfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1147 <fts_lfree+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fts_free@plt>
jmp    111c <fts_lfree+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_lfree>:
push   %rbx
test   %rdi,%rdi
je     1130 <fts_lfree+0x20>
cs nopw 0x0(%rax,%rax,1)
mov    (%rdi),%rbx
call   1030 <fts_free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <fts_lfree+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.TYPE_4__ = type { %struct.TYPE_4__* }
define void @fts_lfree(%struct.TYPE_4__* %0) {
%2 = icmp eq %struct.TYPE_4__* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi %struct.TYPE_4__* [ %6, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i64 0, i32 0
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = tail call i32 @fts_free(%struct.TYPE_4__* %4)
%8 = icmp eq %struct.TYPE_4__* %6, null
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mem_free(char *mem) {
  if (mem)
    free(mem);
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __libc_rpc_getport(struct sockaddr_in *, int /*<<< orphan*/,
                                      int /*<<< orphan*/, int /*<<< orphan*/,
                                      int, int);
u_short __pmap_getnisport(struct sockaddr_in *address, u_long program,
                          u_long version, u_int protocol) {
  return __libc_rpc_getport(address, program, version, protocol, 1, 1);
}


x86 assembly (clang, -O0):
<__pmap_getnisport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <__libc_rpc_getport@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pmap_getnisport>:
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <__libc_rpc_getport@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i32 @__pmap_getnisport(%struct.sockaddr_in* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.sockaddr_in*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @__libc_rpc_getport(%struct.sockaddr_in* %9, i32 %10, i32 %11, i32 %12, i32 1, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i32 @__pmap_getnisport(%struct.sockaddr_in* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @__libc_rpc_getport(%struct.sockaddr_in* %0, i32 %1, i32 %2, i32 %3, i32 1, i32 1)
ret i32 %5
}
int subs_si_test2(int a, int b, int c) {
  int d = a - 0xff;
  if (d == 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<subs_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1130 <subs_si_test2+0x30>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <subs_si_test2+0x3c>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test2>:
mov    %edi,%eax
add    $0xffffff01,%eax
lea    -0xff(%rdi,%rsi,1),%eax
cmove  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @subs_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -255
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %4, %1
%7 = select i1 %5, i32 %0, i32 %6
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Variables and functions */
int get_arg_long(char const *, int, char **);
int get_arg_short(char const, int, char **);
int get_arg(const char arg_short, const char *arg_long, int argc, char **argv) {
  int x_arg = get_arg_short(arg_short, argc, argv);
  if (x_arg == 0)
    x_arg = get_arg_long(arg_long, argc, argv);
  return x_arg;
}


x86 assembly (clang, -O0):
<get_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%al
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
movsbl %al,%edi
call   1030 <get_arg_short@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    116b <get_arg+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <get_arg_long@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edx,%esi
mov    %rcx,%rdx
call   1030 <get_arg_short@plt>
test   %eax,%eax
je     113f <get_arg+0x1f>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <get_arg_long@plt>

LLVM IR (-O0):
define i32 @get_arg(i8 signext %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32
store i8 %0, i8* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%10 = load i8, i8* %5
%11 = load i32, i32* %7
%12 = load i8**, i8*** %8
%13 = call i32 @get_arg_short(i8 signext %10, i32 %11, i8** %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i8**, i8*** %8
%20 = call i32 @get_arg_long(i8* %17, i32 %18, i8** %19)
store i32 %20, i32* %9
br label %21
21: ; preds = %16, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_arg(i8 signext %0, i8* %1, i32 %2, i8** %3) {
%5 = tail call i32 @get_arg_short(i8 signext %0, i32 %2, i8** %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @get_arg_long(i8* %1, i32 %2, i8** %3)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int randomperc();
int rnd(int low, int high) {
  int res;
  if (low >= high) {
    res = low;
  } else {
    res = low + (randomperc() * (high - low + 1));
    if (res > high) {
      res = high;
    }
  }
  return (res);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1135 <rnd+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    116f <rnd+0x5f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <randomperc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    116a <rnd+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    116f <rnd+0x5f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    %esi,%ebp
sub    %edi,%ebp
jle    1137 <rnd+0x27>
mov    %esi,%r14d
xor    %eax,%eax
call   1030 <randomperc@plt>
add    $0x1,%ebp
imul   %eax,%ebp
add    %ebx,%ebp
cmp    %r14d,%ebp
cmovg  %r14d,%ebp
mov    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
br label %26
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 (...) @randomperc()
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = mul nsw i32 %13, %17
%19 = add nsw i32 %12, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %11
%24 = load i32, i32* %4
store i32 %24, i32* %5
br label %25
25: ; preds = %23, %11
br label %26
26: ; preds = %25, %9
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @rnd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = tail call i32 (...) @randomperc()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = mul nsw i32 %5, %7
%9 = add nsw i32 %8, %0
%10 = icmp sgt i32 %9, %1
%11 = select i1 %10, i32 %1, i32 %9
br label %12
12: ; preds = %4, %2
%13 = phi i32 [ %0, %2 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ TestAppP__Boot__booted();
void RealMainP__Boot__booted(void) { TestAppP__Boot__booted(); }


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

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

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

LLVM IR (-O2):
define void @RealMainP__Boot__booted() {
%1 = tail call i32 (...) @TestAppP__Boot__booted()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(void const *, void *, int);
void *malloc(int);
void *ay_memdup(const void *addr, int n) {
  void *new_chunk = malloc(n);
  if (new_chunk)
    bcopy((addr), (new_chunk), (n));
  return new_chunk;
}


x86 assembly (clang, -O0):
<ay_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <ay_memdup+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <bcopy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ay_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <ay_memdup+0x28>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @ay_memdup(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %0, i32 %1, i1 false)
br label %6
6: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_puiss(void) { IF_fct_2('^'); }


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

x86 assembly (clang, -O2):
<IF_puiss>:
mov    $0x5e,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_puiss() {
%1 = call i32 @IF_fct_2(i8 signext 94)
ret void
}

LLVM IR (-O2):
define void @IF_puiss() {
%1 = tail call i32 @IF_fct_2(i8 signext 94)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void main(void) {
  int x;
  float y;
  foo(x);
  return;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = load i32, i32* %1
%4 = call i32 @foo(i32 %3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 undef)
ret void
}
/* Variables and functions */
int isalpha(char);
int f_isalpha(char c) { return isalpha(c); }


x86 assembly (clang, -O0):
<f_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_isalpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @f_isalpha(i8 signext %0) {
%2 = tail call i32 @isalpha(i8 signext %0)
ret i32 %2
}
void __attribute__((no)) __jit_debug_register_code() {}


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

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

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

LLVM IR (-O2):
define void @__jit_debug_register_code() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
unsigned int fsize(FILE *fd) {
  fseek(fd, 0, SEEK_END);
  unsigned int size = ftell(fd);
  fseek(fd, 0, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fsize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close_device();
int /*<<< orphan*/ stop_capturing();
int /*<<< orphan*/ uninit_device();
void terminate_camera() {
  stop_capturing();
  uninit_device();
  close_device();
}


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

x86 assembly (clang, -O2):
<terminate_camera>:
push   %rax
xor    %eax,%eax
call   1030 <stop_capturing@plt>
xor    %eax,%eax
call   1040 <uninit_device@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <close_device@plt>

LLVM IR (-O0):
define void @terminate_camera() {
%1 = call i32 (...) @stop_capturing()
%2 = call i32 (...) @uninit_device()
%3 = call i32 (...) @close_device()
ret void
}

LLVM IR (-O2):
define void @terminate_camera() {
%1 = tail call i32 (...) @stop_capturing()
%2 = tail call i32 (...) @uninit_device()
%3 = tail call i32 (...) @close_device()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *showParameters_il() {
  static char text[200];
  sprintf(text, "samplerate=%d; lenBitmapDiv=%d", 8, 8);
  return text;
}


x86 assembly (clang, -O0):
<showParameters_il>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x8,%ecx
mov    %ecx,%edx
call   1030 <sprintf@plt>
lea    0x2f0b(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showParameters_il>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
mov    $0x8,%ecx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [31 x i8] c"samplerate=%d; lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 8, i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}

LLVM IR (-O2):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [31 x i8] c"samplerate=%d; lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 8, i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}
int floatcomp(const void *elem1, const void *elem2) {
  if (*(const float *)elem1 < *(const float *)elem2)
    return -1;
  return *(const float *)elem1 > *(const float *)elem2;
}


x86 assembly (clang, -O0):
<floatcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1131 <floatcomp+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <floatcomp+0x4b>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatcomp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @floatcomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *);
int *make_int(size_t size) {
  printf("%s\n", "make_int");
  return malloc(size * sizeof(int));
}


x86 assembly (clang, -O0):
<make_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_int>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <printf@plt>
shl    $0x2,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"make_int\00"
define i32* @make_int(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = load i64, i64* %2
%5 = mul i64 %4, 4
%6 = call i32* @malloc(i64 %5)
ret i32* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"make_int\00"
define noalias i32* @make_int(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = shl i64 %0, 2
%4 = tail call i32* @malloc(i64 %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ lasvm_error(char *, char const *, int);
void lasvm_assertfail(const char *file, int line) {
  lasvm_error("Assertion failed: %s:%d\n", file, line);
}


x86 assembly (clang, -O0):
<lasvm_assertfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <lasvm_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lasvm_assertfail>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <lasvm_error@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Assertion failed: %s:%d\0A\00"
define void @lasvm_assertfail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @lasvm_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Assertion failed: %s:%d\0A\00"
define void @lasvm_assertfail(i8* %0, i32 %1) {
%3 = tail call i32 @lasvm_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void memWrite32(int val, unsigned char *p) {
  *(p + 0) = (val >> 0) & 0xFF;
  *(p + 1) = (val >> 8) & 0xFF;
  *(p + 2) = (val >> 16) & 0xFF;
  *(p + 3) = (val >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<memWrite32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memWrite32>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @memWrite32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %3
%24 = ashr i32 %23, 24
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
ret void
}

LLVM IR (-O2):
define void @memWrite32(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void Util_Zero(void *buf, size_t bufSize) {
  if (buf != ((void *)0)) {
    memset(buf, 0, bufSize);
  }
}


x86 assembly (clang, -O0):
<Util_Zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <Util_Zero+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_Zero>:
test   %rdi,%rdi
je     111f <Util_Zero+0xf>
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

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

LLVM IR (-O2):
define void @Util_Zero(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
br label %6
6: ; preds = %4, %2
ret void
}
void pci_aer_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @pci_aer_enable() {
ret void
}
/* Type definitions */
struct cc_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __rk_allreduce_alg_v(struct cc_context *, double *);
int __rk_allreduce_alg(void *context) {
  double v = 1.1;
  struct cc_context *ctx = context;
  __rk_allreduce_alg_v(ctx, &v);
  return 0;
}


x86 assembly (clang, -O0):
<__rk_allreduce_alg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <__rk_allreduce_alg_v@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rk_allreduce_alg>:
push   %rax
movabs $0x3ff199999999999a,%rax
99 f1 3f
mov    %rax,(%rsp)
mov    %rsp,%rsi
call   1030 <__rk_allreduce_alg_v@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cc_context = type { i32 }
define i32 @__rk_allreduce_alg(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca %struct.cc_context*
store i8* %0, i8** %2
store double 1.100000e+00, double* %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to %struct.cc_context*
store %struct.cc_context* %6, %struct.cc_context** %4
%7 = load %struct.cc_context*, %struct.cc_context** %4
%8 = call i32 @__rk_allreduce_alg_v(%struct.cc_context* %7, double* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.cc_context = type { i32 }
define i32 @__rk_allreduce_alg(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 1.100000e+00, double* %2
%4 = bitcast i8* %0 to %struct.cc_context*
%5 = call i32 @__rk_allreduce_alg_v(%struct.cc_context* %4, double* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ multiply_array_array(double *, double *, double *, int, int);
void multiply_array_array_inplace(double *a, double *b, int ncol, int nlns) {
  multiply_array_array(a, a, b, ncol, nlns);
}


x86 assembly (clang, -O0):
<multiply_array_array_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <multiply_array_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_array_array_inplace>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <multiply_array_array@plt>

LLVM IR (-O0):
define void @multiply_array_array_inplace(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @multiply_array_array(double* %9, double* %10, double* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @multiply_array_array_inplace(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call i32 @multiply_array_array(double* %0, double* %0, double* %1, i32 %2, i32 %3)
ret void
}
int main(int argc, char **argv) {
  unsigned x = -2;
  return x >> (argc + 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfffffffe,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x5,%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0x5(%rdi),%ecx
mov    $0xfffffffe,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 5
%4 = lshr i32 -2, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void handler(int signum) {
  int status;
  pid_t pid;
  pid = waitpid(-1, &status, WNOHANG);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <waitpid@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1030 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %3, i32 %5)
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x35_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x35_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x35_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x35_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x35_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, ...);
void UnsafePrint(const char *string, int integer) {
COFLO_NOT_THREADSAFE:
  printf(string);
  printf("%d\n", integer);
}


x86 assembly (clang, -O0):
<UnsafePrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnsafePrint>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @UnsafePrint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @UnsafePrint(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}