xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ udd_detach();
void udc_detach(void) { udd_detach(); }


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

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

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

LLVM IR (-O2):
define void @udc_detach() {
%1 = tail call i32 (...) @udd_detach()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_debug(char *);
int /*<<< orphan*/ print_debug_hex32(char);
void test(void) {
  signed char x;
  x = -1;
  print_debug_hex32(x);
  print_debug("\n");
  _exit(0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <print_debug_hex32@plt>
lea    0xeb4(%rip),%rdi
call   1050 <print_debug@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <print_debug_hex32@plt>
lea    0xebe(%rip),%rdi
call   1050 <print_debug@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @test() {
%1 = alloca i8
store i8 -1, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @print_debug_hex32(i8 signext %2)
%4 = call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @test() {
%1 = tail call i32 @print_debug_hex32(i8 signext -1)
%2 = tail call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
double exp(double);
double expit(double x) { return 1.0 / (1.0 + exp(-x)); }


x86 assembly (clang, -O0):
<expit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  0xeba(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expit>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @expit(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
void cleanup_socket() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ volshow_cmdline_parser_release(struct volshow_args_info *);
void volshow_cmdline_parser_free(struct volshow_args_info *args_info) {
  volshow_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<volshow_cmdline_parser_free>:
jmp    1030 <volshow_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.volshow_args_info = type { i32 }
define void @volshow_cmdline_parser_free(%struct.volshow_args_info* %0) {
%2 = tail call i32 @volshow_cmdline_parser_release(%struct.volshow_args_info* %0)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_EXCL;
int O_RDONLY;
int /*<<< orphan*/ close(int);
unsigned long file_open(char *, char *);
int open(char *, int);
unsigned long int file_new(char *path, char *mode) {
  int fd;
  fd = open(path, O_RDONLY | O_CREAT | O_EXCL);
  if (fd >= 0)
    close(fd);
  return file_open(path, mode);
}


x86 assembly (clang, -O0):
<file_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
or     (%rax),%esi
mov    0x2e73(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1179 <file_new+0x49>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <file_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_new>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rcx
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e7d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
call   1050 <open@plt>
test   %eax,%eax
js     1167 <file_new+0x37>
mov    %eax,%edi
call   1040 <close@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <file_open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i64 @file_new(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_RDONLY
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = load i32, i32* @O_EXCL
%11 = or i32 %9, %10
%12 = call i32 @open(i8* %6, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* %5
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %15, %2
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i64 @file_open(i8* %19, i8* %20)
ret i64 %21
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i64 @file_new(i8* %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_EXCL
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7)
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 @close(i32 %8)
br label %12
12: ; preds = %10, %2
%13 = tail call i64 @file_open(i8* %0, i8* %1)
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int PR19074(int x) {
  switch (x) {
  case 0:
    return 0;
  default:
    do {
      if (!(0)) {
        abort();
      }
    } while (0);
  }
}


x86 assembly (clang, -O0):
<PR19074>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1137 <PR19074+0x27>
jmp    112b <PR19074+0x1b>
movl   $0x0,-0x4(%rbp)
jmp    1143 <PR19074+0x33>
jmp    113c <PR19074+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR19074>:
test   %edi,%edi
jne    1117 <PR19074+0x7>
xor    %eax,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @PR19074(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i32 0, i32* %2
br label %10
6: ; preds = %1
br label %7
7: ; preds = %6
%8 = call i32 (...) @abort()
unreachable
9: ; No predecessors!
br label %10
10: ; preds = %5, %9
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @PR19074(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
ret i32 0
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *circle_name();
int unmarshall() {
  char *c = circle_name();
  return c[1];
}


x86 assembly (clang, -O0):
<unmarshall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <circle_name@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmarshall>:
push   %rax
xor    %eax,%eax
call   1030 <circle_name@plt>
movsbl 0x1(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unmarshall() {
%1 = alloca i8*
%2 = call i8* (...) @circle_name()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @unmarshall() {
%1 = tail call i8* (...) @circle_name()
%2 = getelementptr inbounds i8, i8* %1, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
extern unsigned short ReturnUint16() { return 0xFFFE; }


x86 assembly (clang, -O0):
<ReturnUint16>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffe,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnUint16>:
mov    $0xfffe,%ax
ret

LLVM IR (-O0):
define zeroext i16 @ReturnUint16() {
ret i16 -2
}

LLVM IR (-O2):
define zeroext i16 @ReturnUint16() {
ret i16 -2
}
/* Variables and functions */
double carlson_elliptic_rf(double, double, double);
double elliptic_incomplete_first(double sx, double ak) {
  double s2x, c2x, k2, p2;
  k2 = ak * ak;
  s2x = sx * sx;
  c2x = 1.0 - s2x;
  p2 = k2 * s2x;
  return (sx * carlson_elliptic_rf(c2x, 1.0 - p2, 1.0));
}


x86 assembly (clang, -O0):
<elliptic_incomplete_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb8(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm2
call   1030 <carlson_elliptic_rf@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elliptic_incomplete_first>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm1,%xmm1
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
movsd  0xed6(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm3
movapd %xmm2,%xmm1
subsd  %xmm3,%xmm1
call   1030 <carlson_elliptic_rf@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @elliptic_incomplete_first(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
store double %11, double* %7
%12 = load double, double* %3
%13 = load double, double* %3
%14 = fmul double %12, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = fsub double 1.000000e+00, %15
store double %16, double* %6
%17 = load double, double* %7
%18 = load double, double* %5
%19 = fmul double %17, %18
store double %19, double* %8
%20 = load double, double* %3
%21 = load double, double* %6
%22 = load double, double* %8
%23 = fsub double 1.000000e+00, %22
%24 = call double @carlson_elliptic_rf(double %21, double %23, double 1.000000e+00)
%25 = fmul double %20, %24
ret double %25
}

LLVM IR (-O2):
define double @elliptic_incomplete_first(double %0, double %1) {
%3 = fmul double %1, %1
%4 = fmul double %0, %0
%5 = fsub double 1.000000e+00, %4
%6 = fmul double %4, %3
%7 = fsub double 1.000000e+00, %6
%8 = tail call double @carlson_elliptic_rf(double %5, double %7, double 1.000000e+00)
%9 = fmul double %8, %0
ret double %9
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enable_lcd();
void atben_cleanup(struct atrf_dsc *dsc) { enable_lcd(); }


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

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

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
define void @atben_cleanup(%struct.atrf_dsc* %0) {
%2 = alloca %struct.atrf_dsc*
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %2
%3 = call i32 (...) @enable_lcd()
ret void
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
define void @atben_cleanup(%struct.atrf_dsc* nocapture readnone %0) {
%2 = tail call i32 (...) @enable_lcd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_car_dialog(int /*<<< orphan*/ *);
void roadmap_car(void) { roadmap_car_dialog(NULL); }


x86 assembly (clang, -O0):
<roadmap_car>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <roadmap_car_dialog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_car>:
xor    %edi,%edi
jmp    1030 <roadmap_car_dialog@plt>

LLVM IR (-O0):
define void @roadmap_car() {
%1 = call i32 @roadmap_car_dialog(i32* null)
ret void
}

LLVM IR (-O2):
define void @roadmap_car() {
%1 = tail call i32 @roadmap_car_dialog(i32* null)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t return_int64_2() { return -1073741825; }


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

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

LLVM IR (-O0):
define i32 @return_int64_2() {
ret i32 -1073741825
}

LLVM IR (-O2):
define i32 @return_int64_2() {
ret i32 -1073741825
}
/* Variables and functions */
char *malloc(int);
char *ftos(float f) {
  char *s = malloc(50 * sizeof(char));
  return s;
}


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

x86 assembly (clang, -O2):
<ftos>:
mov    $0x32,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ftos(float %0) {
%2 = alloca float
%3 = alloca i8*
store float %0, float* %2
%4 = call i8* @malloc(i32 50)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @ftos(float %0) {
%2 = tail call dereferenceable_or_null(50) i8* @malloc(i32 50)
ret i8* %2
}
int sn280x_get_bat_health(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sn280x_get_bat_health() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/HelloWorld/bin && /mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"cd /mnt/user/code/HelloWorld/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"cd /mnt/user/code/HelloWorld/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct obus_bus_event {
  int dummy;
};
struct net_interface {
  int dummy;
};
struct net_bus_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ net_interface_object(struct net_interface *);
int obus_bus_event_unregister_object(struct obus_bus_event *,
                                     int /*<<< orphan*/);
int net_bus_event_unregister_interface(struct net_bus_event *bus_event,
                                       struct net_interface *object) {
  return obus_bus_event_unregister_object((struct obus_bus_event *)bus_event,
                                          net_interface_object(object));
}


x86 assembly (clang, -O0):
<net_bus_event_unregister_interface>:
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    -0x10(%rbp),%rdi
call   1040 <net_interface_object@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <obus_bus_event_unregister_object@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_bus_event_unregister_interface>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <net_interface_object@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <obus_bus_event_unregister_object@plt>

LLVM IR (-O0):
%struct.net_bus_event = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_unregister_interface(%struct.net_bus_event* %0, %struct.net_interface* %1) {
%3 = alloca %struct.net_bus_event*
%4 = alloca %struct.net_interface*
store %struct.net_bus_event* %0, %struct.net_bus_event** %3
store %struct.net_interface* %1, %struct.net_interface** %4
%5 = load %struct.net_bus_event*, %struct.net_bus_event** %3
%6 = bitcast %struct.net_bus_event* %5 to %struct.obus_bus_event*
%7 = load %struct.net_interface*, %struct.net_interface** %4
%8 = call i32 @net_interface_object(%struct.net_interface* %7)
%9 = call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.net_bus_event = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_unregister_interface(%struct.net_bus_event* %0, %struct.net_interface* %1) {
%3 = bitcast %struct.net_bus_event* %0 to %struct.obus_bus_event*
%4 = tail call i32 @net_interface_object(%struct.net_interface* %1)
%5 = tail call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, char);
void t2() {
  char *c = "ab";
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "pointer.c",
          13, 97, *c);
  ;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed5(%rip),%rdi
mov    $0xd,%esi
mov    $0x61,%edx
movsbl (%rax),%ecx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
lea    0xee9(%rip),%rdi
mov    $0xd,%esi
mov    $0x61,%edx
mov    $0x61,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t2() {
%1 = alloca i8*
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8, i8* %2
%4 = call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 97, i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t2() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 97, i8 signext 97)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int OpenNetwork() {
  Log("OpenNetwork: Opening network");
  return 1;
}


x86 assembly (clang, -O0):
<OpenNetwork>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <Log@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenNetwork>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <Log@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"OpenNetwork: Opening network\00"
define i32 @OpenNetwork() {
%1 = call i32 @Log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [29 x i8] c"OpenNetwork: Opening network\00"
define i32 @OpenNetwork() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ salt;

/* Variables and functions */
char *int_to_base64(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char const *);
char *make_ext_salt_para(int rounds, const char *saltpara) {
  static char salt[10];
  snprintf(salt, sizeof(salt), "_%s%s", int_to_base64(rounds), saltpara);
  return salt;
}


x86 assembly (clang, -O0):
<make_ext_salt_para>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <int_to_base64@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%r8
lea    0x2eec(%rip),%rdi
mov    $0xa,%esi
lea    0xeaf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ed4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ext_salt_para>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <int_to_base64@plt>
lea    0x2efe(%rip),%r14
lea    0xec6(%rip),%rdx
mov    %r14,%rdi
mov    $0xa,%esi
mov    %rax,%rcx
mov    %rbx,%r8
call   1030 <snprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(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 = call i8* @int_to_base64(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_ext_salt_para.salt = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"_%s%s\00"
define i8* @make_ext_salt_para(i32 %0, i8* %1) {
%3 = tail call i8* @int_to_base64(i32 %0)
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @make_ext_salt_para.salt, i64 0, i64 0)
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/);
int thread_sleep_millis(int milliseconds) {
  struct timespec t;
  t.tv_sec = milliseconds / 1000;
  t.tv_nsec = (long)(milliseconds % 1000) * 1000 * 1000;
  return nanosleep(&t, 0);
}


x86 assembly (clang, -O0):
<thread_sleep_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0x3e8,%rax,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_sleep_millis>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,0x8(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
cltq
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @thread_sleep_millis(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 1000
%11 = mul nsw i64 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %11, i64* %12
%13 = call i32 @nanosleep(%struct.timespec* %3, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @thread_sleep_millis(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32 0)
ret i32 %10
}
/* Variables and functions */
float __infer_nondet_float();
float copysignf(float x, float y) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<copysignf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
int d_ge_rm2(double a1, double *a2) { return !(((a1) >= (*a2))); }


x86 assembly (clang, -O0):
<d_ge_rm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_rm2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ge_rm2(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = fcmp oge double %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ge_rm2(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ugt double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void USBHostRequestStatus(unsigned long ulBase) {
  ;
  (*((volatile unsigned char *)(ulBase + 0x00000102))) =
      0x00000020 | 0x00000040;
}


x86 assembly (clang, -O0):
<USBHostRequestStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x60,0x102(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestStatus>:
movb   $0x60,0x102(%rdi)
ret

LLVM IR (-O0):
define void @USBHostRequestStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 258
%5 = inttoptr i64 %4 to i8*
store volatile i8 96, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBHostRequestStatus(i64 %0) {
%2 = add i64 %0, 258
%3 = inttoptr i64 %2 to i8*
store volatile i8 96, i8* %3
ret void
}
extern void insb(unsigned short port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; ins"
                       "b"
                       : "=D"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
void XmbDrawText() {}


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

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

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

LLVM IR (-O2):
define void @XmbDrawText() {
ret void
}
int foo(int *a) { return *a; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
double total_scoring(unsigned int gap, double matrix_score,
                     double gap_open_penalty, double gap_extend_penalty) {
  return (matrix_score +
          ((gap > 0) ? (gap - 1) * gap_extend_penalty + gap_open_penalty : 0));
}


x86 assembly (clang, -O0):
<total_scoring>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1151 <total_scoring+0x51>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    115e <total_scoring+0x5e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    115e <total_scoring+0x5e>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<total_scoring>:
xorpd  %xmm3,%xmm3
sub    $0x1,%edi
jb     1119 <total_scoring+0x19>
xorps  %xmm3,%xmm3
cvtsi2sd %rdi,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @total_scoring(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load i32, i32* %5
%11 = icmp ugt i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i32, i32* %5
%14 = sub i32 %13, 1
%15 = uitofp i32 %14 to double
%16 = load double, double* %8
%17 = load double, double* %7
%18 = call double @llvm.fmuladd.f64(double %15, double %16, double %17)
br label %20
19: ; preds = %4
br label %20
20: ; preds = %19, %12
%21 = phi double [ %18, %12 ], [ 0.000000e+00, %19 ]
%22 = fadd double %9, %21
ret double %22
}

LLVM IR (-O2):
define double @total_scoring(i32 %0, double %1, double %2, double %3) {
%5 = icmp eq i32 %0, 0
%6 = add i32 %0, -1
%7 = uitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double %3, double %2)
%9 = select i1 %5, double 0.000000e+00, double %8
%10 = fadd double %9, %1
ret double %10
}
void SteamAPI_ISteamHTMLSurface_MouseUp(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamHTMLSurface_MouseUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_MouseUp>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_MouseUp = [35 x i8] c"SteamAPI_ISteamHTMLSurface_MouseUp\00"
define void @SteamAPI_ISteamHTMLSurface_MouseUp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_MouseUp, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_MouseUp = [35 x i8] c"SteamAPI_ISteamHTMLSurface_MouseUp\00"
define void @SteamAPI_ISteamHTMLSurface_MouseUp(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_MouseUp, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ConcatArgs(int);
int /*<<< orphan*/ G_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_SendServerCommand(int, int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void Svcmd_CenterPrint_f(void) {
  if (trap_Argc() < 2) {
    G_Printf("usage: cp <message>\n");
    return;
  }
  trap_SendServerCommand(-1, va("cp \"%s\"", ConcatArgs(1)));
}


x86 assembly (clang, -O0):
<Svcmd_CenterPrint_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <trap_Argc@plt>
cmp    $0x2,%eax
jge    1175 <Svcmd_CenterPrint_f+0x25>
lea    0xe95(%rip),%rdi
call   1060 <G_Printf@plt>
jmp    1199 <Svcmd_CenterPrint_f+0x49>
mov    $0x1,%edi
call   1050 <ConcatArgs@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1070 <va@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1030 <trap_SendServerCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_CenterPrint_f>:
push   %rax
xor    %eax,%eax
call   1040 <trap_Argc@plt>
cmp    $0x1,%eax
jg     116a <Svcmd_CenterPrint_f+0x1a>
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1060 <G_Printf@plt>
mov    $0x1,%edi
call   1050 <ConcatArgs@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1070 <va@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <trap_SendServerCommand@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: cp <message>\0A\00"
@.str.1 = [8 x i8] c"cp \22%s\22\00"
define void @Svcmd_CenterPrint_f() {
%1 = call i32 (...) @trap_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @G_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @ConcatArgs(i32 1)
%7 = call i32 @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @trap_SendServerCommand(i32 -1, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: cp <message>\0A\00"
@.str.1 = [8 x i8] c"cp \22%s\22\00"
define void @Svcmd_CenterPrint_f() {
%1 = tail call i32 (...) @trap_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @G_Printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @ConcatArgs(i32 1)
%7 = tail call i32 @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @trap_SendServerCommand(i32 -1, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int generate_seed(int min, int max) {
  int diff = max - min;
  return (int)(((double)(diff + 1) / RAND_MAX) * rand() + min);
}


x86 assembly (clang, -O0):
<generate_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    0x2eb0(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_seed>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %esi,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %ebx,%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @generate_seed(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* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = load double, double* @RAND_MAX
%13 = fdiv double %11, %12
%14 = call double (...) @rand()
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = call double @llvm.fmuladd.f64(double %13, double %14, double %16)
%18 = fptosi double %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @generate_seed(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
%8 = tail call double (...) @rand()
%9 = sitofp i32 %0 to double
%10 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %9)
%11 = fptosi double %10 to i32
ret i32 %11
}
int more_arguments(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
                   int a8, int a9, int a10) {
  return (int)(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + 10);
}


x86 assembly (clang, -O0):
<more_arguments>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    0x10(%rbp),%eax
add    0x18(%rbp),%eax
add    0x20(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_arguments>:
add    %esi,%edi
add    %edx,%edi
add    %ecx,%edi
add    %r8d,%edi
add    %r9d,%edi
add    0x8(%rsp),%edi
mov    0x18(%rsp),%eax
add    0x10(%rsp),%edi
add    %edi,%eax
add    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @more_arguments(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %13
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %14
%27 = add nsw i32 %25, %26
%28 = load i32, i32* %15
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %16
%31 = add nsw i32 %29, %30
%32 = load i32, i32* %17
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %18
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %19
%37 = add nsw i32 %35, %36
%38 = add nsw i32 %37, 10
ret i32 %38
}

LLVM IR (-O2):
define i32 @more_arguments(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = add i32 %0, 10
%12 = add i32 %11, %1
%13 = add i32 %12, %2
%14 = add i32 %13, %3
%15 = add i32 %14, %4
%16 = add i32 %15, %5
%17 = add i32 %16, %6
%18 = add i32 %17, %7
%19 = add i32 %18, %8
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawrect(int, int, int, int, int);
void j_drawrect(int arg0, int arg1, int arg2, int arg3, int arg4) {
  japi_drawrect(arg0, arg1, arg2, arg3, arg4);
}


x86 assembly (clang, -O0):
<j_drawrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <japi_drawrect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_drawrect>:
jmp    1030 <japi_drawrect@plt>

LLVM IR (-O0):
define void @j_drawrect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @japi_drawrect(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @j_drawrect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @japi_drawrect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
int blk_mq_debugfs_register_hctxs(struct request_queue *q) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define i32 @blk_mq_debugfs_register_hctxs(%struct.request_queue* nocapture readnone %0) {
ret i32 0
}
unsigned int Maj(const unsigned int *x, const unsigned int *y,
                 const unsigned int *z) {
  return (*x & *y) ^ (*x & *z) ^ (*y & *z);
}


x86 assembly (clang, -O0):
<Maj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
and    (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x18(%rbp),%rdx
and    (%rdx),%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x18(%rbp),%rdx
and    (%rdx),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maj>:
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,%edx
xor    %ecx,%edx
and    (%rdi),%edx
and    %ecx,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Maj(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* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = and i32 %8, %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = and i32 %13, %15
%17 = xor i32 %11, %16
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = and i32 %19, %21
%23 = xor i32 %17, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @Maj(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = xor i32 %6, %5
%8 = and i32 %7, %4
%9 = and i32 %6, %5
%10 = xor i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ die_in(int);
int /*<<< orphan*/ sleep(int);
void time_out_in_only_one_second() {
  die_in(1);
  sleep(10);
}


x86 assembly (clang, -O0):
<time_out_in_only_one_second>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <die_in@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_out_in_only_one_second>:
push   %rax
mov    $0x1,%edi
call   1030 <die_in@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
define void @time_out_in_only_one_second() {
%1 = call i32 @die_in(i32 1)
%2 = call i32 @sleep(i32 10)
ret void
}

LLVM IR (-O2):
define void @time_out_in_only_one_second() {
%1 = tail call i32 @die_in(i32 1)
%2 = tail call i32 @sleep(i32 10)
ret void
}
int main() {
  int a, b;
  scanf("%d %d", &a, &b), printf("%d", f(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %eax,%eax
call   1030 <f@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, ...)*)(i32 %4, i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int libutil_func(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libutil_func() {
ret i32 0
}
OP(dd, c1) { op_c1(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c1()
ret i32 undef
}