xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M571_f(char *s) {
  debug("M571_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M571_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M571_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M571_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M571_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M571_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M571_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void gtk_paint_handle() {}


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

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

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

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

/* Variables and functions */
int rc_i2c_write_bytes(int, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int rc_i2c_write_byte(int bus, uint8_t regAddr, uint8_t data) {
  return rc_i2c_write_bytes(bus, regAddr, 1, &data);
}


x86 assembly (clang, -O0):
<rc_i2c_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
lea    -0xc(%rbp),%rcx
call   1030 <rc_i2c_write_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_i2c_write_byte>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x1,%edx
call   1030 <rc_i2c_write_bytes@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rc_i2c_write_byte(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 = load i32, i32* %5
%9 = call i32 @rc_i2c_write_bytes(i32 %7, i32 %8, i32 1, i32* %6)
ret i32 %9
}

LLVM IR (-O2):
define i32 @rc_i2c_write_byte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @rc_i2c_write_bytes(i32 %0, i32 %1, i32 1, i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage:\n");
  printf("  sandbox dir uid key\n");
  printf("  sandbox -reap uid\n");
  printf("  sandbox -teardown dir\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [23 x i8] c" sandbox dir uid key\0A\00"
@.str.2 = [21 x i8] c" sandbox -reap uid\0A\00"
@.str.3 = [25 x i8] c" sandbox -teardown dir\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [22 x i8] c" sandbox dir uid key\00"
@str.5 = [20 x i8] c" sandbox -reap uid\00"
@str.6 = [24 x i8] c" sandbox -teardown dir\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
ret void
}
void gtk_handle_box_get_shadow_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_handle_box_get_shadow_type() {
ret void
}
unsigned char icase_hash(unsigned char c) { return c & ~((c & 0x40) >> 1); }


x86 assembly (clang, -O0):
<icase_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    $0x40,%ecx
sar    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icase_hash>:
mov    %edi,%eax
shr    %al
not    %al
or     $0xdf,%al
and    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @icase_hash(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 64
%8 = ashr i32 %7, 1
%9 = xor i32 %8, -1
%10 = and i32 %4, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @icase_hash(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = and i8 %2, 32
%4 = xor i8 %3, -1
%5 = and i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int machdep_sys_getdents(int, char *, int);
machdep_sys_getdirentries(int fd, char *buf, int len, int *seek) {
  return (machdep_sys_getdents(fd, buf, len));
}


x86 assembly (clang, -O0):
<machdep_sys_getdirentries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <machdep_sys_getdents@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_getdirentries>:
jmp    1030 <machdep_sys_getdents@plt>

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

LLVM IR (-O2):
define i32 @machdep_sys_getdirentries(i32 %0, i8* %1, i32 %2, i32* nocapture readnone %3) {
%5 = tail call i32 @machdep_sys_getdents(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, void const *, int);
int __sv_cmp_d(const void *a, const void *b) {
  double a2, b2;
  memcpy(&a2, a, sizeof(double));
  memcpy(&b2, b, sizeof(double));
  return a2 < b2 ? -1 : a2 > b2 ? 1 : 0;
}


x86 assembly (clang, -O0):
<__sv_cmp_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1165 <__sv_cmp_d+0x55>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <__sv_cmp_d+0x70>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sv_cmp_d>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__sv_cmp_d(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @memcpy(double* %3, i8* %0, i32 8)
%8 = call i32 @memcpy(double* %4, i8* %1, i32 8)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fcmp olt double %9, %10
%12 = fcmp ogt double %9, %10
%13 = zext i1 %12 to i32
%14 = select i1 %11, i32 -1, i32 %13
ret i32 %14
}
int hexdec(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  else if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  else if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hexdec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hexdec+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hexdec+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <hexdec+0x84>
cmpl   $0x41,-0x8(%rbp)
jl     114e <hexdec+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <hexdec+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <hexdec+0x84>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <hexdec+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <hexdec+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <hexdec+0x84>
jmp    1178 <hexdec+0x78>
jmp    117d <hexdec+0x7d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdec>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hexdec+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexdec+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexdec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %35
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %35
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %35
32: ; preds = %25, %22
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
store i32 -1, i32* %2
br label %35
35: ; preds = %34, %28, %18, %9
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @hexdec(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
int iio_trigger_detach_poll_func(struct iio_trigger *trig,
                                 struct iio_poll_func *pf) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.iio_trigger = type opaque
%struct.iio_poll_func = type opaque
define i32 @iio_trigger_detach_poll_func(%struct.iio_trigger* nocapture readnone %0, %struct.iio_poll_func* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void trio_destroy(char *string) {
  if (string) {
    free(string);
  }
}


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

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

LLVM IR (-O0):
define void @trio_destroy(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 @trio_destroy(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
}
/* Variables and functions */
int __send_to_ppe(int, int, char const **);
int chdir(const char *path) { return __send_to_ppe(0x2101, 33, &path); }


x86 assembly (clang, -O0):
<chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2101,%edi
mov    $0x21,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2101,%edi
mov    $0x21,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 33, i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 33, i8** %2)
ret i32 %3
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ geteuid();
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() {
  struct passwd *pw_entry;
  pw_entry = getpwuid(geteuid());
  if (pw_entry == NULL)
    exit(1);
  puts(pw_entry->pw_name);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <main+0x36>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
test   %rax,%rax
je     115f <main+0x1f>
mov    (%rax),%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @puts(i32 %8)
ret i32 0
}
float fsign(float _a) { return _a < 0.0f ? -1.0f : 1.0f; }


x86 assembly (clang, -O0):
<fsign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm1,%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @fsign(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float -1.000000e+00, float 1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @fsign(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
__attribute__((visibility("default"))) void sd_bus_error_free(void *e) {}


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

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

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

LLVM IR (-O2):
define void @sd_bus_error_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runTest();
int /*<<< orphan*/ select_features();
int /*<<< orphan*/ select_helpers();
int /*<<< orphan*/ setup();
int valid_product();
int main(void) {
  int retValue_acc;
  int tmp;
  {
    {
      select_helpers();
      select_features();
      tmp = valid_product();
    }
    if (tmp) {
      {
        setup();
        runTest();
      }
    } else {
    }
    retValue_acc = 0;
    return (retValue_acc);
    return (retValue_acc);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <select_helpers@plt>
mov    $0x0,%al
call   1050 <select_features@plt>
mov    $0x0,%al
call   1030 <valid_product@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1194 <main+0x44>
mov    $0x0,%al
call   1070 <setup@plt>
mov    $0x0,%al
call   1040 <runTest@plt>
jmp    1199 <main+0x49>
jmp    1199 <main+0x49>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <select_helpers@plt>
xor    %eax,%eax
call   1050 <select_features@plt>
xor    %eax,%eax
call   1030 <valid_product@plt>
test   %eax,%eax
je     1178 <main+0x28>
xor    %eax,%eax
call   1070 <setup@plt>
xor    %eax,%eax
call   1040 <runTest@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @select_helpers()
%2 = tail call i32 (...) @select_features()
%3 = tail call i32 (...) @valid_product()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (...) @setup()
%7 = tail call i32 (...) @runTest()
br label %8
8: ; preds = %0, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __syscall_sync();
void sync(void) { __syscall_sync(); }


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

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

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

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 (...) @__syscall_sync()
ret void
}
int pioneer_buf_to_checksum(unsigned char *buf) {
  return 256 * buf[0] + buf[1];
}


x86 assembly (clang, -O0):
<pioneer_buf_to_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pioneer_buf_to_checksum>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @pioneer_buf_to_checksum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 256, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @pioneer_buf_to_checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
void f(int **p) {
  int *k = (int)malloc(sizeof(int));
  *k = 4;
  printf("i=%i\n", *k);
  *p = k;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
movslq %eax,%rbx
movl   $0x4,(%rbx)
lea    0xebf(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"i=%i\0A\00"
define void @f(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = call i64 @malloc(i32 4)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
store i32 4, i32* %8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %3
%13 = load i32**, i32*** %2
store i32* %12, i32** %13
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"i=%i\0A\00"
define void @f(i32** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = shl i64 %2, 32
%4 = ashr exact i64 %3, 32
%5 = inttoptr i64 %4 to i32*
store i32 4, i32* %5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
store i32* %5, i32** %0
ret void
}
void smpInit(void) {}


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

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

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

LLVM IR (-O2):
define void @smpInit() {
ret void
}
/* Variables and functions */
char *rindex(char *, char);
char *strdup(char const *);
char *get_base_dir(const char *path) {
  char *base = strdup(path);
  char *c = rindex(base, '/');
  *c = '\0';
  return base;
}


x86 assembly (clang, -O0):
<get_base_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_base_dir>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_base_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @rindex(i8* %7, i8 signext 47)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
store i8 0, i8* %9
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @get_base_dir(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @rindex(i8* %2, i8 signext 47)
store i8 0, i8* %3
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int *);
int KeyHit(void) {
  int bytes_waiting;
  ioctl(0, FIONREAD, &bytes_waiting);
  return (bytes_waiting);
}


x86 assembly (clang, -O0):
<KeyHit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x4(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeyHit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @KeyHit() {
%1 = alloca i32
%2 = load i32, i32* @FIONREAD
%3 = call i32 @ioctl(i32 0, i32 %2, i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @KeyHit() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @FIONREAD
%4 = call i32 @ioctl(i32 0, i32 %3, i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("uid = %d, gid = %d\n", getuid(), getgid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"uid = %d, gid = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @getgid()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"uid = %d, gid = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int foo(unsigned a, unsigned b) { return (a - b - 1) >= a; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    -0x4(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %edi,%esi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp uge i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int GetDataHeight(int h) { return (h + 7) & ~7; }


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

x86 assembly (clang, -O2):
<GetDataHeight>:
lea    0x7(%rdi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @GetDataHeight(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
%5 = and i32 %4, -8
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetDataHeight(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = and i32 %2, -8
ret i32 %3
}
void INT_Excep_TPU6_TGI6C(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU6_TGI6C() {
ret void
}
_Complex double foo_double(_Complex double x) { return x; }


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

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

LLVM IR (-O0):
define { double, double } @foo_double(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%10 = load double, double* %9
%11 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %11
store double %10, double* %12
%13 = load { double, double }, { double, double }* %3
ret { double, double } %13
}

LLVM IR (-O2):
define { double, double } @foo_double(double %0, double %1) {
%3 = insertvalue { double, double } poison, double %0, 0
%4 = insertvalue { double, double } %3, double %1, 1
ret { double, double } %4
}
/* Type definitions */
struct array_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ array_item_no(struct array_s *, void *);
unsigned long array_item_remove(struct array_s *, int /*<<< orphan*/);
unsigned long array_item_remove_ptr(struct array_s *a, void *item) {
  return array_item_remove(a, array_item_no(a, item));
}


x86 assembly (clang, -O0):
<array_item_remove_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <array_item_no@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <array_item_remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_item_remove_ptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <array_item_no@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <array_item_remove@plt>

LLVM IR (-O0):
%struct.array_s = type { i32 }
define i64 @array_item_remove_ptr(%struct.array_s* %0, i8* %1) {
%3 = alloca %struct.array_s*
%4 = alloca i8*
store %struct.array_s* %0, %struct.array_s** %3
store i8* %1, i8** %4
%5 = load %struct.array_s*, %struct.array_s** %3
%6 = load %struct.array_s*, %struct.array_s** %3
%7 = load i8*, i8** %4
%8 = call i32 @array_item_no(%struct.array_s* %6, i8* %7)
%9 = call i64 @array_item_remove(%struct.array_s* %5, i32 %8)
ret i64 %9
}

LLVM IR (-O2):
%struct.array_s = type { i32 }
define i64 @array_item_remove_ptr(%struct.array_s* %0, i8* %1) {
%3 = tail call i32 @array_item_no(%struct.array_s* %0, i8* %1)
%4 = tail call i64 @array_item_remove(%struct.array_s* %0, i32 %3)
ret i64 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void set_uint16(uint8_t *p, uint16_t v) {
  p[0] = (uint8_t)(v & 0xff);
  p[1] = (uint8_t)((v >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<set_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uint16>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %rcx,(%rdi)
movzbl %ah,%eax
mov    %rax,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @set_uint16(i64* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = zext i32 %3 to i64
store i64 %4, i64* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
ret void
}
/* Variables and functions */
int issetugid();
int OPENSSL_issetugid(void) { return issetugid(); }


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

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

LLVM IR (-O0):
define i32 @OPENSSL_issetugid() {
%1 = call i32 (...) @issetugid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @OPENSSL_issetugid() {
%1 = tail call i32 (...) @issetugid()
ret i32 %1
}
char *langRomTypeMegaRam2mb() { return "2MB MegaRAM"; }


x86 assembly (clang, -O0):
<langRomTypeMegaRam2mb>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"2MB MegaRAM\00"
define i8* @langRomTypeMegaRam2mb() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"2MB MegaRAM\00"
define i8* @langRomTypeMegaRam2mb() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void dummyvideo_ReadScreen2(void *dest, int *width, int *height, int front) {}


x86 assembly (clang, -O0):
<dummyvideo_ReadScreen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummyvideo_ReadScreen2(i8* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @dummyvideo_ReadScreen2(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
float exp(float);
float chi2_k2_cdf(float x) { return 1 - exp(-x / 2); }


x86 assembly (clang, -O0):
<chi2_k2_cdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  0xeb5(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chi2_k2_cdf>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movss  0xede(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @chi2_k2_cdf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = fdiv float %4, 2.000000e+00
%6 = call float @exp(float %5)
%7 = fsub float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @chi2_k2_cdf(float %0) {
%2 = fmul float %0, -5.000000e-01
%3 = tail call float @exp(float %2)
%4 = fsub float 1.000000e+00, %3
ret float %4
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
scalar_t__ iswlower(char);
wint_t towupper(wint_t wc) {
  if (iswlower(wc)) {
    return wc - 'a' + 'A';
  }
  return wc;
}


x86 assembly (clang, -O0):
<towupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <iswlower@plt>
cmp    $0x0,%rax
je     1143 <towupper+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <towupper+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <iswlower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @towupper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @iswlower(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %15
13: ; preds = %1
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %15
15: ; preds = %13, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @towupper(i8 signext %0) {
%2 = tail call i64 @iswlower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int ft_isalpha(int);
int ft_isdigit(int);
int ft_isalnum(int c) { return (ft_isdigit(c) + ft_isalpha(c)); }


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_isdigit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_isalpha@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <ft_isdigit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <ft_isalpha@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_isdigit(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ft_isalpha(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i32 @ft_isdigit(i32 %0)
%3 = tail call i32 @ft_isalpha(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
char fromDigit(char val) { return val + '0'; }


x86 assembly (clang, -O0):
<fromDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @fromDigit(i8 signext %0) {
%2 = add i8 %0, 48
ret i8 %2
}
float gallonsToLiters(float gallons) {
  float liters = 0.0;
  liters = gallons * 3.7854;
  return liters;
}


x86 assembly (clang, -O0):
<gallonsToLiters>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gallonsToLiters>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @gallonsToLiters(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 3.785400e+00
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @gallonsToLiters(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.785400e+00
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ PIT1_DriverIRQHandler();
__attribute__((weak)) void PIT1_IRQHandler(void) { PIT1_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @PIT1_IRQHandler() {
%1 = tail call i32 (...) @PIT1_DriverIRQHandler()
ret void
}
int DynamicObjectSize3(void *const p
                       __attribute__((pass_dynamic_object_size(3)))) {
  return __builtin_object_size(p, 3);
}


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

x86 assembly (clang, -O2):
<DynamicObjectSize3>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i32 @DynamicObjectSize3(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 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @DynamicObjectSize3(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Sound32(unsigned long);
void sound(unsigned long hz) { Sound32(hz); }


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

x86 assembly (clang, -O2):
<sound>:
jmp    1030 <Sound32@plt>

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

LLVM IR (-O2):
define void @sound(i64 %0) {
%2 = tail call i32 @Sound32(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_disk();
int /*<<< orphan*/ display_mbr();
int /*<<< orphan*/ init_master();
int /*<<< orphan*/ load_mbr();
int main(void) {
  init_master();
  check_disk();
  load_mbr();
  display_mbr();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_master@plt>
xor    %eax,%eax
call   1040 <check_disk@plt>
xor    %eax,%eax
call   1050 <load_mbr@plt>
xor    %eax,%eax
call   1060 <display_mbr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_master()
%3 = call i32 (...) @check_disk()
%4 = call i32 (...) @load_mbr()
%5 = call i32 (...) @display_mbr()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_master()
%2 = tail call i32 (...) @check_disk()
%3 = tail call i32 (...) @load_mbr()
%4 = tail call i32 (...) @display_mbr()
ret i32 0
}
void anetSendTimeout(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",
               42, "Function '%s' is disabled.", __func__);
}


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

x86 assembly (clang, -O2):
<anetSendTimeout>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x2a,%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__.anetSendTimeout = [16 x i8] c"anetSendTimeout\00"
define void @anetSendTimeout() {
%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 42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.anetSendTimeout, 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__.anetSendTimeout = [16 x i8] c"anetSendTimeout\00"
define void @anetSendTimeout() {
%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 42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.anetSendTimeout, i64 0, i64 0))
ret void
}
void temp() {}


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

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

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

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