xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alrm(int signo) {
  printf("sig_alrm.\n");
  return;
}


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

x86 assembly (clang, -O2):
<sig_alrm>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [10 x i8] c"sig_alrm.\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void usb_wk_handler(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ dvb_bcd_set(int /*<<< orphan*/ *, unsigned int, int);
uint8_t dvb_bcd_set8(unsigned int i_int) {
  uint8_t i_result;
  dvb_bcd_set(&i_result, i_int, 8);
  return i_result;
}


x86 assembly (clang, -O0):
<dvb_bcd_set8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
mov    $0x8,%edx
call   1030 <dvb_bcd_set@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvb_bcd_set8>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
mov    $0x8,%edx
call   1030 <dvb_bcd_set@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dvb_bcd_set8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dvb_bcd_set(i32* %3, i32 %4, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @dvb_bcd_set8(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @dvb_bcd_set(i32* %2, i32 %0, i32 8)
%5 = load i32, i32* %2
ret i32 %5
}
float inHg2mmHg(float inHg) {
  if (inHg < 0)
    return inHg;
  return inHg * 25.4;
}


x86 assembly (clang, -O0):
<inHg2mmHg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1125 <inHg2mmHg+0x25>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1143 <inHg2mmHg+0x43>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inHg2mmHg>:
cvtss2sd %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm0
andnps %xmm1,%xmm3
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @inHg2mmHg(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %13
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fmul double %10, 2.540000e+01
%12 = fptrunc double %11 to float
store float %12, float* %2
br label %13
13: ; preds = %8, %6
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @inHg2mmHg(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = fmul double %3, 2.540000e+01
%5 = fptrunc double %4 to float
%6 = select i1 %2, float %0, float %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void _writes(int fd, char *s) { write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<_writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_writes>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @_writes(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @_writes(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int itr_print(void *n1, void *ctx) {
  int *i;
  i = (int *)n1;
  printf("%d ", *i);
  return 0;
}


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

x86 assembly (clang, -O2):
<itr_print>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @itr_print(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int *);
void f(int *i1, int *i2) { g(i1, i2); }


x86 assembly (clang, -O0):
<f>:
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 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f(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 @g(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @f(i32* %0, i32* %1) {
%3 = tail call i32 @g(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun1() {
  printf("you \n");
  return;
}


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

x86 assembly (clang, -O2):
<fun1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"you \00"
define void @fun1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Ellipse182(long, long, long, long, unsigned long,
                              unsigned long);
void ellipse(long x, long y, long rx, long ry, unsigned long cfg,
             unsigned long cbg) {
  Ellipse182(x, y, rx, ry, cfg, cbg);
}


x86 assembly (clang, -O0):
<ellipse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <Ellipse182@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellipse>:
jmp    1030 <Ellipse182@plt>

LLVM IR (-O0):
define void @ellipse(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = load i64, i64* %11
%18 = load i64, i64* %12
%19 = call i32 @Ellipse182(i64 %13, i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @ellipse(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i32 @Ellipse182(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret void
}
/* Type definitions */
typedef int wchar_t;
struct _Locale_numeric {
  int dummy;
};

/* Variables and functions */
wchar_t _WLocale_decimal_point(struct _Locale_numeric *lnum
                               __attribute__((__unused__))) {
  return L'.';
}


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

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

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

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
define i32 @_WLocale_decimal_point(%struct._Locale_numeric* nocapture readnone %0) {
ret i32 46
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_DSR;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ printf(char *, int);
bool serial_get_dsr(int fd) {
  int status;
  ioctl(fd, TIOCMGET, &status);
  printf("%d\n", status);
  return (status & TIOCM_DSR);
}


x86 assembly (clang, -O0):
<serial_get_dsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1040 <ioctl@plt>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    0x2e8f(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_get_dsr>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1040 <ioctl@plt>
mov    0x4(%rsp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
and    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@TIOCM_DSR = global i32 0
define i32 @serial_get_dsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @TIOCMGET
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* @TIOCM_DSR
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@TIOCM_DSR = global i32 0
define i32 @serial_get_dsr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCMGET
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* @TIOCM_DSR
%10 = and i32 %9, %8
ret i32 %10
}
/* Variables and functions */
char const *strong_n1();
const char *call_strong_n1(void) { return strong_n1() + 1; }


x86 assembly (clang, -O0):
<call_strong_n1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <strong_n1@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_strong_n1>:
push   %rax
xor    %eax,%eax
call   1030 <strong_n1@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_strong_n1() {
%1 = call i8* (...) @strong_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_strong_n1() {
%1 = tail call i8* (...) @strong_n1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
int gyroscope_open_calibration(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @gyroscope_open_calibration(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
void outw(unsigned short port, unsigned short v) {
  asm volatile("outw %1, %0" : : "d"(port), "a"(v));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $1, $0", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr) {
  int retval;
  assert(cond != NULL);
  retval = pthread_cond_init(cond, cond_attr);
  if (retval != 0)
    Sys_failure("pthread_cond_init");
}


x86 assembly (clang, -O0):
<Pthread_cond_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_cond_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1178 <Pthread_cond_init+0x48>
lea    0xe8d(%rip),%rdi
call   1050 <Sys_failure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_cond_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <pthread_cond_init@plt>
test   %eax,%eax
je     116a <Pthread_cond_init+0x3a>
lea    0xea2(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Sys_failure@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"pthread_cond_init\00"
define void @Pthread_cond_init(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = call i32 @pthread_cond_init(i32* %10, i32* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @Sys_failure(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"pthread_cond_init\00"
define void @Pthread_cond_init(i32* %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @pthread_cond_init(i32* %0, i32* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int write_codigo(char *arquivoAuxiliar, int codigo) {
  FILE *fp;
  fp = fopen(arquivoAuxiliar, "w");
  if (fp == NULL) {
    return (-1);
  }
  fprintf(fp, "%d", codigo);
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<write_codigo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116a <write_codigo+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <write_codigo+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_codigo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1166 <write_codigo+0x36>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    116b <write_codigo+0x3b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @write_codigo(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
fpubext(scptr) char *scptr;
{ ppubext(scptr); }


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

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

LLVM IR (-O0):
define i32 @fpubext(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ppubext to i32 (i8*, ...)*)(i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @fpubext(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ppubext to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int vsnprintf(int /*<<< orphan*/ *, size_t, char const *, int /*<<< orphan*/);
int vfprintf(FILE *stream, const char *format, va_list ap) {
  return vsnprintf(NULL, (size_t)stream, format, ap);
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i32* null, i64 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @vfprintf(i32* %0, i8* nocapture %1, i32 %2) {
%4 = ptrtoint i32* %0 to i64
%5 = tail call i32 @vsnprintf(i32* null, i64 %4, i8* %1, i32 %2)
ret i32 %5
}
double __cimag(double _Complex z) { return __imag__ z; }


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

x86 assembly (clang, -O2):
<__cimag>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__cimag(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @__cimag(double %0, double returned %1) {
ret double %1
}
int is_pulse(int data) { return (data & 0x01000000 ? 1 : 0); }


x86 assembly (clang, -O0):
<is_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1000000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pulse>:
mov    %edi,%eax
shr    $0x18,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_pulse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16777216
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_pulse(i32 %0) {
%2 = lshr i32 %0, 24
%3 = and i32 %2, 1
ret i32 %3
}
unsigned long long
unsignedlonglong_ignoring_signedlonglongint(unsigned long long x,
                                            signed long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_signedlonglongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_signedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int ft_wlen(const char *s, char c) {
  int len;
  len = 0;
  while (*s != c && *s != '\0') {
    len++;
    s++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_wlen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     113d <ft_wlen+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <ft_wlen+0x4d>
jmp    1167 <ft_wlen+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <ft_wlen+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_wlen>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    %sil,%cl
je     1122 <ft_wlen+0x22>
test   %cl,%cl
je     1122 <ft_wlen+0x22>
xor    %eax,%eax
nop
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1122 <ft_wlen+0x22>
test   %cl,%cl
jne    1110 <ft_wlen+0x10>
ret

LLVM IR (-O0):
define i32 @ft_wlen(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %13, label %18
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %6
%19 = phi i1 [ false, %6 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %6
25: ; preds = %18
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @ft_wlen(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
%5 = icmp eq i8 %3, 0
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add nuw nsw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %1
%14 = icmp eq i8 %12, 0
%15 = or i1 %13, %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %17
}
void EVP_CIPHER_key_length(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_key_length() {
ret void
}
unsigned char mouse_get_y(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @mouse_get_y() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @mouse_get_y() {
ret i8 0
}
/* Variables and functions */
double invsqrt(double const);
double vec3_invnorm(const double v[3]) {
  return invsqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<vec3_invnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <invsqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_invnorm>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
jmp    1030 <invsqrt@plt>

LLVM IR (-O0):
define double @vec3_invnorm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @invsqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @vec3_invnorm(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @invsqrt(double %9)
ret double %10
}
void rop3_190_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_190_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_190_0_0>:
xor    %edx,%esi
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_190_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_190_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  char buf[1000];
  printf("sftp> ");
  fgets(buf, sizeof buf, stdin);
  fwrite("foo\n", 2, 2, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%ecx
lea    0xe8f(%rip),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1050 <fwrite@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3e8,%rsp
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%ecx
lea    0xe9e(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1050 <fwrite@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sftp> \00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"foo\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 1000, i32 %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 2, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sftp> \00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"foo\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 1000, i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 2, i32 %6)
ret i32 0
}
void f(void) {
  int a, b;
  a &b;
  a | b;
  a ^ b;
  ~a;
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = and i32 %3, %4
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = or i32 %6, %7
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = xor i32 %9, %10
%12 = load i32, i32* %1
%13 = xor i32 %12, -1
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *msSmallMalloc(size_t nSize) { return malloc(nSize); }


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

x86 assembly (clang, -O2):
<msSmallMalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @msSmallMalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @msSmallMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
newline() { output_byte('\n'); }


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

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define i32 @newline() {
%1 = alloca i32
%2 = call i32 @output_byte(i8 signext 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @newline() {
%1 = tail call i32 @output_byte(i8 signext 10)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fs_univ_purge(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                 int /*<<< orphan*/);
uint8_t fs_mr_purge(uint32_t ts, uint32_t inode) {
  return fs_univ_purge(ts, 0, 0x80, inode);
}


x86 assembly (clang, -O0):
<fs_mr_purge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <fs_univ_purge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_purge>:
mov    %esi,%ecx
xor    %esi,%esi
mov    $0x80,%edx
jmp    1030 <fs_univ_purge@plt>

LLVM IR (-O0):
define i32 @fs_mr_purge(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 @fs_univ_purge(i32 %5, i32 0, i32 128, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fs_mr_purge(i32 %0, i32 %1) {
%3 = tail call i32 @fs_univ_purge(i32 %0, i32 0, i32 128, i32 %1)
ret i32 %3
}
long pass_long(long arg) { return arg; }


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

x86 assembly (clang, -O2):
<pass_long>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @pass_long(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
struct _int_list {
  int dummy;
};
struct _index_reader {
  int dummy;
};

/* Variables and functions */
struct _int_list *filter_bits(struct _index_reader *_is) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct._int_list = type { i32 }
%struct._index_reader = type { i32 }
define %struct._int_list* @filter_bits(%struct._index_reader* %0) {
%2 = alloca %struct._index_reader*
store %struct._index_reader* %0, %struct._index_reader** %2
ret %struct._int_list* null
}

LLVM IR (-O2):
%struct._int_list = type { i32 }
%struct._index_reader = type { i32 }
define noalias %struct._int_list* @filter_bits(%struct._index_reader* nocapture readnone %0) {
ret %struct._int_list* null
}
/* Variables and functions */
int fib_rec(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = 40;
  for (int i = 0; i <= n; i++) {
    int result = fib_rec(i);
    printf("Initvalue: %d Result: %d \n", i, result);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1174 <main+0x54>
mov    -0xc(%rbp),%edi
call   1040 <fib_rec@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <fib_rec@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x29,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Initvalue: %d Result: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @fib_rec(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [27 x i8] c"Initvalue: %d Result: %d \0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @fib_rec(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 41
br i1 %7, label %1, label %2
}
/* Variables and functions */
int linemode_set(int, int /*<<< orphan*/);
int clear(int bit) { return linemode_set(bit, 0); }


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

x86 assembly (clang, -O2):
<clear>:
xor    %esi,%esi
jmp    1030 <linemode_set@plt>

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

LLVM IR (-O2):
define i32 @clear(i32 %0) {
%2 = tail call i32 @linemode_set(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cat0();
int /*<<< orphan*/ cat1();
void rot63_sem() {
  cat0();
  cat1();
}


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

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

LLVM IR (-O0):
define void @rot63_sem() {
%1 = call i32 (...) @cat0()
%2 = call i32 (...) @cat1()
ret void
}

LLVM IR (-O2):
define void @rot63_sem() {
%1 = tail call i32 (...) @cat0()
%2 = tail call i32 (...) @cat1()
ret void
}
/* Variables and functions */
void flushinp() {}


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

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

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

LLVM IR (-O2):
define void @flushinp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("Please enter a value: ");
  scanf("%d", &x);
  if (x == 16)
    printf("\nYay, you did it.\n");
  else
    printf("\nMaybe next time.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x10,-0x8(%rbp)
jne    1166 <main+0x46>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x10,0x4(%rsp)
lea    0xed2(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Please enter a value: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\0AYay, you did it.\0A\00"
@.str.3 = [19 x i8] c"\0AMaybe next time.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 16
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Please enter a value: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"\0AMaybe next time.\00"
@str.4 = [18 x i8] c"\0AYay, you did it.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 16
%7 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_crc64_table();
int /*<<< orphan*/ print_crc64_table();
int main(void) {
  init_crc64_table();
  print_crc64_table();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_crc64_table()
%3 = call i32 (...) @print_crc64_table()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_crc64_table()
%2 = tail call i32 (...) @print_crc64_table()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pperror(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
char *do_error_if(int argc, char *argv[]) {
  if (!strcmp(argv[0], "y"))
    pperror("%s", argv[1]);
  return NULL;
}


x86 assembly (clang, -O0):
<do_error_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    115f <do_error_if+0x3f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea8(%rip),%rdi
call   1030 <pperror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_error_if>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xed2(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1147 <do_error_if+0x27>
mov    0x8(%rbx),%rsi
lea    0xec0(%rip),%rdi
call   1030 <pperror@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"y\00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @do_error_if(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @pperror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %2
ret i8* null
}

LLVM IR (-O2):
@.str = [2 x i8] c"y\00"
@.str.1 = [3 x i8] c"%s\00"
define noalias i8* @do_error_if(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @pperror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %2
ret i8* null
}