xunge/DecIR huggingface dataset:
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSELECTCLIPPATH_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSELECTCLIPPATH_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSELECTCLIPPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  return strcmp((char *)s1, (char *)s2) ? 0 : 1;
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ fabs(float);
float Max(float f_x, float f_a) {
  f_x -= f_a;
  f_x += fabs(f_x);
  f_x *= 0.5;
  f_x += f_a;
  return f_x;
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
push   %rax
movss  %xmm1,0x4(%rsp)
subss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  (%rsp),%xmm0
mulss  0xec6(%rip),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %6, %5
store float %7, float* %3
%8 = load float, float* %3
%9 = call i64 @fabs(float %8)
%10 = sitofp i64 %9 to float
%11 = load float, float* %3
%12 = fadd float %11, %10
store float %12, float* %3
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fmul double %14, 5.000000e-01
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load float, float* %4
%18 = load float, float* %3
%19 = fadd float %18, %17
store float %19, float* %3
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @Max(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i64 @fabs(float %3)
%5 = sitofp i64 %4 to float
%6 = fadd float %3, %5
%7 = fmul float %6, 5.000000e-01
%8 = fadd float %7, %1
ret float %8
}
/* Variables and functions */
char *ctime(long *);
int /*<<< orphan*/ time(long *);
char *get_time() {
  long ltime;
  time(&ltime);
  return ctime(&ltime);
}


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

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_time() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = call i8* @ctime(i64* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_time() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = call i8* @ctime(i64* %1)
ret i8* %4
}
void plote(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_io_channel_unix_new() {
ret void
}
int dbg_check_idx_size(struct ubifs_info *c, long long idx_size) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_check_idx_size(%struct.ubifs_info* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
void TSIL_SkipLine(FILE *foo) {
  int s;
  while ((s = getc(foo)) != '\n')
    ;
  return;
}


x86 assembly (clang, -O0):
<TSIL_SkipLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1136 <TSIL_SkipLine+0x26>
jmp    111c <TSIL_SkipLine+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TSIL_SkipLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
jne    1120 <TSIL_SkipLine+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @TSIL_SkipLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pRender_PutSync(int, int);
void Render_PutSync(int HorizontalCount, int Line) {
  pRender_PutSync(HorizontalCount, Line);
}


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

x86 assembly (clang, -O2):
<Render_PutSync>:
jmp    1030 <pRender_PutSync@plt>

LLVM IR (-O0):
define void @Render_PutSync(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 = call i32 @pRender_PutSync(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @Render_PutSync(i32 %0, i32 %1) {
%3 = tail call i32 @pRender_PutSync(i32 %0, i32 %1)
ret void
}
void ff_vdpau_h264_picture_start() {}


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

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

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

LLVM IR (-O2):
define void @ff_vdpau_h264_picture_start() {
ret void
}
int cmp(const void *x, const void *y) { return (x < y) ? -1 : (x > y) ? 1 : 0; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <cmp+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <cmp+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp ugt i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *ALT_hstrerror(int err) {
  static char buf[100];
  snprintf(buf, 100, "hstrerror-%d", err);
  return buf;
}


x86 assembly (clang, -O0):
<ALT_hstrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x64,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALT_hstrerror>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ALT_hstrerror.buf = internal global [100 x i8] zeroinitializer
@.str = [13 x i8] c"hstrerror-%d\00"
define i8* @ALT_hstrerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @ALT_hstrerror.buf, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @ALT_hstrerror.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@ALT_hstrerror.buf = internal global [100 x i8] zeroinitializer
@.str = [13 x i8] c"hstrerror-%d\00"
define i8* @ALT_hstrerror(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @ALT_hstrerror.buf, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @ALT_hstrerror.buf, i64 0, i64 0)
}
int gappedscore(char charx, char chary) {
  if ((charx == ' ') || (chary == ' ')) {
    return -3;
  } else {
    return -5;
  }
}


x86 assembly (clang, -O0):
<gappedscore>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     112a <gappedscore+0x2a>
movsbl -0x6(%rbp),%eax
cmp    $0x20,%eax
jne    1136 <gappedscore+0x36>
movl   $0xfffffffd,-0x4(%rbp)
jmp    113d <gappedscore+0x3d>
movl   $0xfffffffb,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gappedscore>:
xor    %eax,%eax
cmp    $0x20,%sil
sete   %al
cmp    $0x20,%dil
lea    -0x5(%rax,%rax,1),%ecx
mov    $0xfffffffd,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gappedscore(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 -3, i32* %3
br label %15
14: ; preds = %9
store i32 -5, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gappedscore(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 32
%4 = icmp eq i8 %1, 32
%5 = or i1 %3, %4
%6 = select i1 %5, i32 -3, i32 -5
ret i32 %6
}
void __up_read(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__up_read>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__up_read>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__up_read = [10 x i8] c"__up_read\00"
define void @__up_read() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.__up_read, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__up_read = [10 x i8] c"__up_read\00"
define void @__up_read() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.__up_read, i64 0, i64 0))
ret void
}
void bl2_arch_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @bl2_arch_setup() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_quaddobl_Laurent_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(773, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_quaddobl_Laurent_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x305,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_quaddobl_Laurent_data>:
mov    $0x305,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_quaddobl_Laurent_data() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 773, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_quaddobl_Laurent_data() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 773, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ nand_device_init();
void module_init() { nand_device_init(); }


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

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

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

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @nand_device_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ XGclose();
int /*<<< orphan*/ XGputstring(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit() {
  int i;
  XGputstring("^D\n");
  XGclose();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <XGputstring@plt>
mov    $0x0,%al
call   1030 <XGclose@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <XGputstring@plt>
xor    %eax,%eax
call   1030 <XGclose@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"^D\0A\00"
define void @quit() {
%1 = alloca i32
%2 = call i32 @XGputstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @XGclose()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"^D\0A\00"
define void @quit() {
%1 = tail call i32 @XGputstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @XGclose()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
scalar_t__ malloc(int);
char *ft_strnew(size_t size) {
  char *s;
  if ((s = (char *)malloc(sizeof(char) * (size + 1)))) {
    bzero((void *)s, size + 1);
    return (s);
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <ft_strnew+0x4b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1040 <bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <ft_strnew+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %ebx,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1147 <ft_strnew+0x27>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
jmp    114a <ft_strnew+0x2a>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 1
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i64, i64* %3
%15 = add i64 %14, 1
%16 = call i32 @bzero(i8* %13, i64 %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %19
18: ; preds = %1
store i8* null, i8** %2
br label %19
19: ; preds = %18, %12
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = trunc i64 %2 to i32
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @bzero(i8* %5, i64 %2)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void pad(int n) {
  putchar('\n');
  while (n--)
    putchar(' ');
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1148 <pad+0x38>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1125 <pad+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
je     113f <pad+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <pad+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @pad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putchar(i8 signext 10)
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 32)
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @pad(i32 %0) {
%2 = tail call i32 @putchar(i8 signext 10)
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putchar(i8 signext 32)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int do_135() { return 135; }


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

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

LLVM IR (-O0):
define i32 @do_135() {
ret i32 135
}

LLVM IR (-O2):
define i32 @do_135() {
ret i32 135
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi64_1(__m128i A) { return _mm_srli_epi64(A, -1); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi64_1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_srli_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi64_1(i32 %0) {
%2 = tail call i32 @_mm_srli_epi64(i32 %0, i32 -1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int /*<<< orphan*/ pw_uid;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
struct passwd *getpwnam(char *);
int /*<<< orphan*/ stderr;
uid_t get_user_id(char *user) {
  struct passwd *pw;
  pw = getpwnam(user);
  if (!pw) {
    fprintf(stderr, "no such user: %s\n", user);
    exit(1);
  }
  return pw->pw_uid;
}


x86 assembly (clang, -O0):
<get_user_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <get_user_id+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_id>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1142 <get_user_id+0x12>
mov    (%rax),%eax
pop    %rbx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"no such user: %s\0A\00"
define i32 @get_user_id(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.passwd* @getpwnam(i8* %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp ne %struct.passwd* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load %struct.passwd*, %struct.passwd** %3
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %14, i32 0, i32 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"no such user: %s\0A\00"
define i32 @get_user_id(i8* %0) {
%2 = tail call %struct.passwd* @getpwnam(i8* %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ recv_resp();
int /*<<< orphan*/ send_req();
void handle_cmd() {
  send_req();
  recv_resp();
}


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

x86 assembly (clang, -O2):
<handle_cmd>:
push   %rax
xor    %eax,%eax
call   1040 <send_req@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <recv_resp@plt>

LLVM IR (-O0):
define void @handle_cmd() {
%1 = call i32 (...) @send_req()
%2 = call i32 (...) @recv_resp()
ret void
}

LLVM IR (-O2):
define void @handle_cmd() {
%1 = tail call i32 (...) @send_req()
%2 = tail call i32 (...) @recv_resp()
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint16_t;

/* Variables and functions */
int factorial(int, int);
uint64_t combination(uint16_t n, uint16_t r) {
  return factorial((n - r + 1), n) / factorial(1, r);
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0x4(%rbp),%esi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%esi
sub    %ebx,%edi
add    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ebp
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @combination(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = call i32 @factorial(i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @factorial(i32 1, i32 %11)
%13 = sdiv i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @combination(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = sub i32 %3, %1
%5 = tail call i32 @factorial(i32 %4, i32 %0)
%6 = tail call i32 @factorial(i32 1, i32 %1)
%7 = sdiv i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ goto_test();
void main(void) {
  goto_test();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <goto_test@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <goto_test@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @goto_test()
%2 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @goto_test()
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ puts(char *);
void pulsa_enter() {
  char enter = 0;
  puts("\x1b[36m"
       "Pulsa [Enter \u21B2] para continuar."
       "\x1b[0m");
  while (enter != '\r' && enter != '\n') {
    enter = getchar();
  }
}


x86 assembly (clang, -O0):
<pulsa_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1157 <pulsa_enter+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1167 <pulsa_enter+0x47>
jmp    1176 <pulsa_enter+0x56>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    1138 <pulsa_enter+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulsa_enter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
cmp    $0xa,%al
je     114f <pulsa_enter+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0xd,%al
je     114f <pulsa_enter+0x2f>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <pulsa_enter+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\1B[36mPulsa [Enter \E2\86\B2] para continuar.\1B[0m\00"
define void @pulsa_enter() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %13, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 13
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = call signext i8 (...) @getchar()
store i8 %14, i8* %1
br label %3
15: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"\1B[36mPulsa [Enter \E2\86\B2] para continuar.\1B[0m\00"
define void @pulsa_enter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %4, %0
%3 = phi i8 [ 0, %0 ], [ %5, %4 ]
switch i8 %3, label %4 [
i8 13, label %6
i8 10, label %6
]
4: ; preds = %2
%5 = tail call signext i8 (...) @getchar()
br label %2
6: ; preds = %2, %2
ret void
}
double fband(double a, double b) { return (int)a & (int)b; }


x86 assembly (clang, -O0):
<fband>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvttsd2si -0x10(%rbp),%ecx
and    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fband>:
cvttsd2si %xmm0,%eax
cvttsd2si %xmm1,%ecx
and    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
ret

LLVM IR (-O0):
define double @fband(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 = fptosi double %5 to i32
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = and i32 %6, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @fband(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = fptosi double %1 to i32
%5 = and i32 %4, %3
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("picovm -- a miniscule virtual machine\n");
  printf("USAGE: picovm [FILE]\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"picovm -- a miniscule virtual machine\0A\00"
@.str.1 = [22 x i8] c"USAGE: picovm [FILE]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"picovm -- a miniscule virtual machine\00"
@str.2 = [21 x i8] c"USAGE: picovm [FILE]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *p = strdup(s);
  if (p == NULL)
    error(EXIT_FAILURE, errno, "xstrdup failed");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <xstrdup+0x42>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdx
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xstrdup+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1030 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"xstrdup failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i32, i32* @errno
%11 = call i32 @error(i32 %9, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"xstrdup failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ Bdisp_GetPoint_VRAM(int, int);
char getPixel1(int x, int y) { return (char)Bdisp_GetPoint_VRAM(x, y); }


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

x86 assembly (clang, -O2):
<getPixel1>:
push   %rax
call   1030 <Bdisp_GetPoint_VRAM@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getPixel1(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 = call i64 @Bdisp_GetPoint_VRAM(i32 %5, i32 %6)
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @getPixel1(i32 %0, i32 %1) {
%3 = tail call i64 @Bdisp_GetPoint_VRAM(i32 %0, i32 %1)
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
ssize_t write(int fd, const void *buf, size_t count) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "write");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
lea    0xee2(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"write\00"
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @assert(i32 0)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"write\00"
define i32 @write(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
ret i32 undef
}
int *f10(int *p, signed char x, int y) {
  x &= y;
  if (!x) {
    if (!p)
      return 0;
    *p = 10;
  } else
    p = 0;
  if (!x)
    *p = 5;
  return p;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
movsbl -0x11(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x11(%rbp)
cmpb   $0x0,-0x11(%rbp)
jne    114e <f10+0x4e>
cmpq   $0x0,-0x10(%rbp)
jne    113f <f10+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1172 <f10+0x72>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
jmp    1156 <f10+0x56>
movq   $0x0,-0x10(%rbp)
cmpb   $0x0,-0x11(%rbp)
jne    116a <f10+0x6a>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
xor    %eax,%eax
test   %rdi,%rdi
je     1116 <f10+0x16>
and    %esi,%edx
test   %dl,%dl
jne    1116 <f10+0x16>
movl   $0x5,(%rdi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32* @f10(i32* %0, i8 signext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
store i32* %0, i32** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = and i32 %10, %8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = load i8, i8* %6
%14 = icmp ne i8 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %3
%16 = load i32*, i32** %5
%17 = icmp ne i32* %16, null
br i1 %17, label %19, label %18
18: ; preds = %15
store i32* null, i32** %4
br label %29
19: ; preds = %15
%20 = load i32*, i32** %5
store i32 10, i32* %20
br label %22
21: ; preds = %3
store i32* null, i32** %5
br label %22
22: ; preds = %21, %19
%23 = load i8, i8* %6
%24 = icmp ne i8 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = load i32*, i32** %5
store i32 5, i32* %26
br label %27
27: ; preds = %25, %22
%28 = load i32*, i32** %5
store i32* %28, i32** %4
br label %29
29: ; preds = %27, %18
%30 = load i32*, i32** %4
ret i32* %30
}

LLVM IR (-O2):
define i32* @f10(i32* writeonly %0, i8 signext %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = and i8 %4, %1
%6 = icmp ne i8 %5, 0
%7 = icmp eq i32* %0, null
%8 = or i1 %7, %6
br i1 %8, label %10, label %9
9: ; preds = %3
store i32 5, i32* %0
br label %10
10: ; preds = %3, %9
%11 = phi i32* [ %0, %9 ], [ null, %3 ]
ret i32* %11
}
/* Variables and functions */
int registers_get_register_code(char const *);
int registers_umode(const char *reg) {
  int code = registers_get_register_code(reg);
  if (code < 0)
    return 0;
  if (code >= 20 && code <= 23)
    return 0;
  if (code >= 27 && code <= 27)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<registers_umode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <registers_get_register_code@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    113e <registers_umode+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <registers_umode+0x75>
cmpl   $0x14,-0x14(%rbp)
jl     115e <registers_umode+0x4e>
cmpl   $0x17,-0x14(%rbp)
jg     115e <registers_umode+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <registers_umode+0x75>
cmpl   $0x1b,-0x14(%rbp)
jl     117e <registers_umode+0x6e>
cmpl   $0x1b,-0x14(%rbp)
jg     117e <registers_umode+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <registers_umode+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registers_umode>:
push   %rax
call   1030 <registers_get_register_code@plt>
test   %eax,%eax
setns  %cl
mov    %eax,%edx
and    $0xfffffffc,%edx
cmp    $0x14,%edx
setne  %dl
cmp    $0x1b,%eax
setne  %al
and    %cl,%al
and    %dl,%al
movzbl %al,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @registers_umode(i8* %0) {
%2 = tail call i32 @registers_get_register_code(i8* %0)
%3 = icmp sgt i32 %2, -1
%4 = and i32 %2, -4
%5 = icmp ne i32 %4, 20
%6 = icmp ne i32 %2, 27
%7 = and i1 %3, %5
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
long double expl(int);
int isReadWriteable(char *);
int /*<<< orphan*/ printf(char *, long double);
int main(int argc, char const *argv[]) {
  printf("Open file ... %d\n", isReadWriteable("Makefile"));
  long double xxl = expl(800);
  printf("e to the power of 1000 is %.2Le\n", xxl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <isReadWriteable@plt>
mov    %eax,-0x24(%rbp)
fildl  -0x24(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x320,%edi
call   1050 <expl@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed7(%rip),%rdi
call   1030 <isReadWriteable@plt>
mov    %eax,0x14(%rsp)
fildl  0x14(%rsp)
fstpt  (%rsp)
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x320,%edi
call   1050 <expl@plt>
fstpt  (%rsp)
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Open file ... %d\0A\00"
@.str.1 = [9 x i8] c"Makefile\00"
@.str.2 = [33 x i8] c"e to the power of 1000 is %.2Le\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @isReadWriteable(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = sitofp i32 %7 to x86_fp80
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), x86_fp80 %8)
%10 = call x86_fp80 @expl(i32 800)
store x86_fp80 %10, x86_fp80* %6
%11 = load x86_fp80, x86_fp80* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Open file ... %d\0A\00"
@.str.1 = [9 x i8] c"Makefile\00"
@.str.2 = [33 x i8] c"e to the power of 1000 is %.2Le\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isReadWriteable(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = sitofp i32 %3 to x86_fp80
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), x86_fp80 %4)
%6 = tail call x86_fp80 @expl(i32 800)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int dl_o1_callback(const char *message, int count) {
  printf("dl_o1_callback: %s\n", message);
  return count + 1;
}


x86 assembly (clang, -O0):
<dl_o1_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_o1_callback>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"dl_o1_callback: %s\0A\00"
define i32 @dl_o1_callback(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
@.str = [20 x i8] c"dl_o1_callback: %s\0A\00"
define i32 @dl_o1_callback(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = add nsw i32 %1, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
int main(int argc, char const *argv[]) {
  pr_mask("Signal: ");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Signal: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @pr_mask(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Signal: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @pr_mask(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}