xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int wl_iovar_set(char *, char *, int *, int);
int wl_iovar_setint(char *ifname, char *iovar, int val) {
  return wl_iovar_set(ifname, iovar, &val, sizeof(val));
}


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

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

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

LLVM IR (-O2):
define i32 @wl_iovar_setint(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @wl_iovar_set(i8* %0, i8* %1, i32* %4, i32 4)
ret i32 %5
}
void tegra_fb_suspend(struct tegra_fb_info *tegra_fb) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_fb_info = type opaque
define void @tegra_fb_suspend(%struct.tegra_fb_info* nocapture %0) {
ret void
}
int security_sem_associate(struct sem_array *sma, int semflg) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sem_array = type opaque
define i32 @security_sem_associate(%struct.sem_array* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
double M_PI;
double radians2degrees(double radians) { return radians * 180 / M_PI; }


x86 assembly (clang, -O0):
<radians2degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians2degrees>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @radians2degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @radians2degrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
int test_imm_33int8_mem(signed char *val) {
  return ((*val) & (0x33 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_33int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
int /*<<< orphan*/ RDP_E(char *);
void uc0_rdphalf_cont() {
  RDP_E("uc0:rdphalf_cont - IGNORED\n");
  RDP("uc0:rdphalf_cont - IGNORED\n");
}


x86 assembly (clang, -O0):
<uc0_rdphalf_cont>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <RDP_E@plt>
lea    0xec9(%rip),%rdi
call   1040 <RDP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc0_rdphalf_cont>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <RDP_E@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <RDP@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"uc0:rdphalf_cont - IGNORED\0A\00"
define void @uc0_rdphalf_cont() {
%1 = call i32 @RDP_E(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @RDP(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"uc0:rdphalf_cont - IGNORED\0A\00"
define void @uc0_rdphalf_cont() {
%1 = tail call i32 @RDP_E(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @RDP(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ g_time3();
int /*<<< orphan*/ g_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ g_writeln(char *);
int /*<<< orphan*/ xfuse_deinit();
void segfault_signal_handler(int sig) {
  {
    if (0 < 5) {
      g_write("xrdp-chansrv [%10.10u]: ", g_time3());
      g_writeln("segfault_signal_handler: entered.......");
    }
  };
  xfuse_deinit();
  exit(0);
}


x86 assembly (clang, -O0):
<segfault_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <g_time3@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1060 <g_write@plt>
lea    0xea2(%rip),%rdi
call   1040 <g_writeln@plt>
mov    $0x0,%al
call   1050 <xfuse_deinit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<segfault_signal_handler>:
push   %rax
xor    %eax,%eax
call   1030 <g_time3@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1060 <g_write@plt>
lea    0xeac(%rip),%rdi
call   1040 <g_writeln@plt>
xor    %eax,%eax
call   1050 <xfuse_deinit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"xrdp-chansrv [%10.10u]: \00"
@.str.1 = [40 x i8] c"segfault_signal_handler: entered.......\00"
define void @segfault_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @g_time3()
%4 = call i32 @g_write(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @g_writeln(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @xfuse_deinit()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"xrdp-chansrv [%10.10u]: \00"
@.str.1 = [40 x i8] c"segfault_signal_handler: entered.......\00"
define void @segfault_signal_handler(i32 %0) {
%2 = tail call i32 (...) @g_time3()
%3 = tail call i32 @g_write(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @g_writeln(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @xfuse_deinit()
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int shmget(int, int, int);
int shm_del() {
  int shmid = shmget(4321, 512, IPC_CREAT | 0600);
  if (shmctl(shmid, IPC_RMID, NULL) == -1) {
    perror("shmdel");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<shm_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
or     $0x180,%edx
mov    $0x10e1,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    119d <shm_del+0x5d>
lea    0xe72(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_del>:
push   %rax
mov    0x2e90(%rip),%rax
mov    $0x180,%edx
or     (%rax),%edx
mov    $0x10e1,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1179 <shm_del+0x39>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe80(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmdel\00"
define i32 @shm_del() {
%1 = alloca i32
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 384
%4 = call i32 @shmget(i32 4321, i32 512, i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* @IPC_RMID
%7 = call i32 @shmctl(i32 %5, i32 %6, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmdel\00"
define i32 @shm_del() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 384
%3 = tail call i32 @shmget(i32 4321, i32 512, i32 %2)
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @shmctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ print_error(char *, char *);
int id3_open_file(FILE **fp, char *fn, char *mode) {
  *fp = fopen(fn, mode);
  if (*fp == NULL) {
    print_error("id3_open_file: Error opening file %s", fn);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<id3_open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1175 <id3_open_file+0x55>
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
jmp    117c <id3_open_file+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id3_open_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    %rax,(%rbx)
mov    $0x1,%eax
test   %rcx,%rcx
jne    1156 <id3_open_file+0x36>
lea    0xeb4(%rip),%rdi
mov    %r14,%rsi
call   1030 <print_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"id3_open_file: Error opening file %s\00"
define i32 @id3_open_file(i32** nocapture writeonly %0, i8* %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %1, i8* %2)
store i32* %4, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @print_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
void fault_isr(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<fault_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fault_isr+0x9>
jmp    1109 <fault_isr+0x9>

x86 assembly (clang, -O2):
<fault_isr>:
jmp    1100 <fault_isr>

LLVM IR (-O0):
define void @fault_isr() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @fault_isr() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ system();
int main() { system(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @system()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @system()
ret i32 0
}
void gdk_get_display_arg_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_get_display_arg_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprint(int, char *, char *);
void regerror(char *s) { fprint(2, "scanmail: %s\n", s); }


x86 assembly (clang, -O0):
<regerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <fprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <fprint@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"scanmail: %s\0A\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fprint(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"scanmail: %s\0A\00"
define void @regerror(i8* %0) {
%2 = tail call i32 @fprint(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int qcs_max_double(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<qcs_max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <qcs_max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <qcs_max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcs_max_double>:
maxsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @qcs_max_double(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
%14 = fptosi double %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @qcs_max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int sig) { printf("Signal Handler is called %d\n", sig); }


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

x86 assembly (clang, -O2):
<signal_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Signal Handler is called %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Signal Handler is called %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void get(void *data) {
  int *pInt;
  pInt = (int *)(data);
  printf(">>>>>>>>>>>>>> %d\n", *pInt);
}


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

x86 assembly (clang, -O2):
<get>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c">>>>>>>>>>>>>> %d\0A\00"
define void @get(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int racine(int);
int premier(int nb) {
  int a;
  int res;
  res = racine(nb);
  a = 3;
  while (a <= res) {
    if (nb % a == 0 || nb <= 1) {
      return (0);
    }
    a += 2;
  }
  return (1);
}


x86 assembly (clang, -O0):
<premier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <racine@plt>
mov    %eax,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     116d <premier+0x5d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1153 <premier+0x43>
cmpl   $0x1,-0x8(%rbp)
jg     115f <premier+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <premier+0x64>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <premier+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<premier>:
push   %rbx
mov    %edi,%ebx
call   1030 <racine@plt>
mov    $0x1,%ecx
cmp    $0x3,%eax
jl     1150 <premier+0x40>
cmp    $0x2,%ebx
jge    112b <premier+0x1b>
xor    %ecx,%ecx
jmp    1150 <premier+0x40>
mov    %eax,%esi
mov    $0x3,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1127 <premier+0x17>
add    $0x2,%edi
cmp    %esi,%edi
jle    1140 <premier+0x30>
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @premier(i32 %0) {
%2 = tail call i32 @racine(i32 %0)
%3 = icmp slt i32 %2, 3
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = icmp slt i32 %0, 2
br i1 %5, label %13, label %8
6: ; preds = %8
%7 = icmp sgt i32 %12, %2
br i1 %7, label %13, label %8
8: ; preds = %4, %6
%9 = phi i32 [ %12, %6 ], [ 3, %4 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 2
br i1 %11, label %13, label %6
13: ; preds = %8, %6, %4, %1
%14 = phi i32 [ 1, %1 ], [ 0, %4 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAKE;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, void *, int /*<<< orphan*/, int,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wake(void *addr, int n) {
  return syscall(SYS_futex, addr, FUTEX_WAKE, n, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_wake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wake>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_futex
%6 = load i8*, i8** %3
%7 = load i32, i32* @FUTEX_WAKE
%8 = load i32, i32* %4
%9 = call i32 @syscall(i32 %5, i8* %6, i32 %7, i32 %8, i32* null, i32* null, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_WAKE = global i32 0
define i32 @futex_wake(i8* %0, i32 %1) {
%3 = load i32, i32* @SYS_futex
%4 = load i32, i32* @FUTEX_WAKE
%5 = tail call i32 @syscall(i32 %3, i8* %0, i32 %4, i32 %1, i32* null, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_2x4(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 2, 4);
}


x86 assembly (clang, -O0):
<pixel_avg_2x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_2x4>:
mov    $0x2,%r8d
mov    $0x4,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_2x4(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 2, i32 4)
ret void
}
__attribute__((gnu_)) __attribute__((always_)) int func6b(int x) {
  return x < 14 ? 3 : 2;
}


x86 assembly (clang, -O0):
<func6b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x3,%ecx
cmp    $0xe,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6b>:
xor    %eax,%eax
cmp    $0xe,%edi
setl   %al
or     $0x2,%eax
ret

LLVM IR (-O0):
define i32 @func6b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 14
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 3, i32 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @func6b(i32 %0) {
%2 = icmp slt i32 %0, 14
%3 = select i1 %2, i32 3, i32 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int fun_call_align_1(char a) {
  printf("a = %d\n", a);
  return a;
}


x86 assembly (clang, -O0):
<fun_call_align_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"a = %d\0A\00"
define i32 @fun_call_align_1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
define i32 @fun_call_align_1(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = sext i8 %0 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ nios_pkt_8x32_pack(int *, int, int, int, int /*<<< orphan*/);
void nios_pkt_8x32_resp_pack(uint8_t *buf, uint8_t target, bool write,
                             uint8_t addr, uint32_t data, bool success) {
  nios_pkt_8x32_pack(buf, target, write, addr, data);
  if (success) {
    buf[2] |= (1 << 1);
  }
}


x86 assembly (clang, -O0):
<nios_pkt_8x32_resp_pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <nios_pkt_8x32_pack@plt>
cmpl   $0x0,-0x1c(%rbp)
je     115a <nios_pkt_8x32_resp_pack+0x4a>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_8x32_resp_pack>:
push   %rbp
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %rdi,%rbx
call   1030 <nios_pkt_8x32_pack@plt>
test   %ebp,%ebp
je     1126 <nios_pkt_8x32_resp_pack+0x16>
orb    $0x2,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @nios_pkt_8x32_resp_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = call i32 @nios_pkt_8x32_pack(i32* %13, i32 %14, i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %12
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %6
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = or i32 %24, 2
store i32 %25, i32* %23
br label %26
26: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
define void @nios_pkt_8x32_resp_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @nios_pkt_8x32_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = icmp eq i32 %5, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = or i32 %11, 2
store i32 %12, i32* %10
br label %13
13: ; preds = %9, %6
ret void
}
int fun1248() { return 1248; }


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

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

LLVM IR (-O0):
define i32 @fun1248() {
ret i32 1248
}

LLVM IR (-O2):
define i32 @fun1248() {
ret i32 1248
}
unsigned char inb(unsigned short _port) {
  unsigned char data;
  __asm__ __volatile__("in %%dx, %%al" : "=a"(data) : "dN"(_port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "in %dx, %al", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "in %dx, %al", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
void signed_char_rem_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) %= RHS;
}


x86 assembly (clang, -O0):
<signed_char_rem_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl (%rax),%eax
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %dl,%cl
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_rem_signed_char_signed_int>:
movsbl (%rdi),%eax
cltd
idiv   %esi
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_rem_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = srem i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_rem_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = srem i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XFocusChangeEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XFocusChangeEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XFocusChangeEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XFocusChangeEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XFocusChangeEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XFocusChangeEvent>:
test   %rdi,%rdi
je     112a <free_XFocusChangeEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XFocusChangeEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XFocusChangeEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PACKSSWB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x63);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}


x86 assembly (clang, -O0):
<MMX_PACKSSWB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x63,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PACKSSWB>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x63,%edi
call   1030 <addbyte@plt>
mov    %r14d,%ebx
or     $0x18,%ebx
shl    $0x3,%ebx
or     %ebx,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
or     %r14d,%ebx
mov    %ebx,%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PACKSSWB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 99)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
%14 = call i32 @addbyte(i32 102)
%15 = call i32 @addbyte(i32 15)
%16 = call i32 @addbyte(i32 112)
%17 = load i32, i32* %3
%18 = shl i32 %17, 3
%19 = or i32 192, %18
%20 = load i32, i32* %3
%21 = or i32 %19, %20
%22 = call i32 @addbyte(i32 %21)
%23 = call i32 @addbyte(i32 8)
ret void
}

LLVM IR (-O2):
define void @MMX_PACKSSWB(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 99)
%6 = shl i32 %0, 3
%7 = or i32 %6, 192
%8 = or i32 %7, %1
%9 = tail call i32 @addbyte(i32 %8)
%10 = tail call i32 @addbyte(i32 102)
%11 = tail call i32 @addbyte(i32 15)
%12 = tail call i32 @addbyte(i32 112)
%13 = or i32 %7, %0
%14 = tail call i32 @addbyte(i32 %13)
%15 = tail call i32 @addbyte(i32 8)
ret void
}
/* Variables and functions */
bool isValidValue(char *val) {
  if (val == NULL)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<isValidValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <isValidValue+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <isValidValue+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidValue>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isValidValue(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *string) {
  if (string)
    free(string);
}


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

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

LLVM IR (-O0):
define void @xfree(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 @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int int32_t;

/* Variables and functions */
int writeBase128Int(int /*<<< orphan*/ *, int);
int32_t writeVSInt(int8_t *out, int32_t i) {
  return writeBase128Int(out, (i << 1) ^ (i >> 31));
}


x86 assembly (clang, -O0):
<writeVSInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
mov    -0xc(%rbp),%eax
sar    $0x1f,%eax
xor    %eax,%esi
call   1030 <writeBase128Int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeVSInt>:
lea    (%rsi,%rsi,1),%eax
sar    $0x1f,%esi
xor    %eax,%esi
jmp    1030 <writeBase128Int@plt>

LLVM IR (-O0):
define i32 @writeVSInt(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 = shl i32 %6, 1
%8 = load i32, i32* %4
%9 = ashr i32 %8, 31
%10 = xor i32 %7, %9
%11 = call i32 @writeBase128Int(i32* %5, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @writeVSInt(i32* %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = ashr i32 %1, 31
%5 = xor i32 %3, %4
%6 = tail call i32 @writeBase128Int(i32* %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigalarm_handler(int sig) {
  fprintf(stderr, "\n\n Time limit exceeded!\n\n");
  signal(sig, SIG_DFL);
  raise(sig);
}


x86 assembly (clang, -O0):
<sigalarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigalarm_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"\0A\0A Time limit exceeded!\0A\0A\00"
@SIG_DFL = global i32 0
define void @sigalarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @raise(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"\0A\0A Time limit exceeded!\0A\0A\00"
@SIG_DFL = global i32 0
define void @sigalarm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %0, i32 %4)
%6 = tail call i32 @raise(i32 %0)
ret void
}
putw1(w) int w;
{
  putb(w >> 8);
  putb(w);
  return w;
}


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

x86 assembly (clang, -O2):
<putw1>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
xor    %eax,%eax
call   1030 <putb@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <putb@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putw1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 (i32, ...) bitcast (i32 (...)* @putb to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putb to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @putw1(i32 returned %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @putb to i32 (i32, ...)*)(i32 %2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putb to i32 (i32, ...)*)(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(unsigned char);
void print_notice_hex8(unsigned char value) { __console_tx_hex8(value); }


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

x86 assembly (clang, -O2):
<print_notice_hex8>:
jmp    1030 <__console_tx_hex8@plt>

LLVM IR (-O0):
define void @print_notice_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__console_tx_hex8(i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_notice_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_date(char *, char *, char *);
void rfc822_date(char *date) {
  do_date(date, "%s, ", "%d %s %d %02d:%02d:%02d %+03d%02d");
}


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

x86 assembly (clang, -O2):
<rfc822_date>:
lea    0xee9(%rip),%rsi
lea    0xee7(%rip),%rdx
jmp    1030 <do_date@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s, \00"
@.str.1 = [34 x i8] c"%d %s %d %02d:%02d:%02d %+03d%02d\00"
define void @rfc822_date(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @do_date(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s, \00"
@.str.1 = [34 x i8] c"%d %s %d %02d:%02d:%02d %+03d%02d\00"
define void @rfc822_date(i8* %0) {
%2 = tail call i32 @do_date(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mystrcpy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char x[] = "now is the time";
  char y[100];
  mystrcpy(x, y);
  printf("%s\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <mystrcpy@plt>
lea    -0x90(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <mystrcpy@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [16 x i8] c"now is the time\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @mystrcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [16 x i8] c"now is the time\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @mystrcpy(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_user_module_valid();
int /*<<< orphan*/ module_user_init();
void system_part2_post_init() {
  if (is_user_module_valid()) {
    module_user_init();
  }
}


x86 assembly (clang, -O0):
<system_part2_post_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_user_module_valid@plt>
cmp    $0x0,%rax
je     113c <system_part2_post_init+0x1c>
mov    $0x0,%al
call   1040 <module_user_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_part2_post_init>:
push   %rax
xor    %eax,%eax
call   1030 <is_user_module_valid@plt>
test   %rax,%rax
je     1135 <system_part2_post_init+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <module_user_init@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @system_part2_post_init() {
%1 = call i64 (...) @is_user_module_valid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @module_user_init()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @system_part2_post_init() {
%1 = tail call i64 (...) @is_user_module_valid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @module_user_init()
br label %5
5: ; preds = %3, %0
ret void
}