xunge/DecIR huggingface dataset:
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_write(struct ac_buffer *, char *, int);
int buffer_write_char(struct ac_buffer *buffer, char value) {
  return _buffer_write(buffer, &value, sizeof(char));
}


x86 assembly (clang, -O0):
<buffer_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_buffer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_write_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_buffer_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_char(%struct.ac_buffer* %0, i8 signext %1) {
%3 = alloca %struct.ac_buffer*
%4 = alloca i8
store %struct.ac_buffer* %0, %struct.ac_buffer** %3
store i8 %1, i8* %4
%5 = load %struct.ac_buffer*, %struct.ac_buffer** %3
%6 = call i32 @_buffer_write(%struct.ac_buffer* %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_char(%struct.ac_buffer* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @_buffer_write(%struct.ac_buffer* %0, i8* %3, i32 1)
ret i32 %4
}
yyLineAtPos(pos) long pos;
{
  long l;
  l = pos / 1000L;
  return l;
}


x86 assembly (clang, -O0):
<yyLineAtPos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyLineAtPos>:
mov    %rdi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x7,%rdx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @yyLineAtPos(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @yyLineAtPos(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = trunc i64 %2 to i32
ret i32 %3
}
void ASN1_PRINTABLE_type(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_PRINTABLE_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ nocrmode();
int /*<<< orphan*/ refresh();
void exit1() {
  move(23, 0);
  refresh();
  nocrmode();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<exit1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
xor    %esi,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1030 <nocrmode@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<exit1>:
push   %rax
mov    $0x17,%edi
xor    %esi,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1030 <nocrmode@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @exit1() {
%1 = call i32 @move(i32 23, i32 0)
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @nocrmode()
%4 = call i32 (...) @endwin()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit1() {
%1 = tail call i32 @move(i32 23, i32 0)
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @nocrmode()
%4 = tail call i32 (...) @endwin()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, ...);
int /*<<< orphan*/ stderr;
void error(const char *s1, const char *s2) {
  fprintf(stderr, "sorted-doc: ");
  fprintf(stderr, s1, s2);
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"sorted-doc: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"sorted-doc: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void process_error() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @intel_cln_imr_runt_setparams() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void CANRetrySet(uint32_t ui32Base, bool bAutoRetry) {
  uint32_t ui32CtlReg;
  ;
  ui32CtlReg = (*((volatile uint32_t *)(ui32Base + 0x00000000)));
  if (bAutoRetry) {
    ui32CtlReg &= ~0x00000020;
  } else {
    ui32CtlReg |= 0x00000020;
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32CtlReg;
}


x86 assembly (clang, -O0):
<CANRetrySet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <CANRetrySet+0x2f>
mov    -0xc(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <CANRetrySet+0x38>
mov    -0xc(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRetrySet>:
movslq %edi,%rax
mov    (%rax),%ecx
xor    %edx,%edx
test   %esi,%esi
sete   %dl
and    $0xffffffdf,%ecx
shl    $0x5,%edx
or     %ecx,%edx
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @CANRetrySet(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 = add nsw i32 %6, 0
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = and i32 %14, -33
store i32 %15, i32* %5
br label %19
16: ; preds = %2
%17 = load i32, i32* %5
%18 = or i32 %17, 32
store i32 %18, i32* %5
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %5
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 0
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %20, i32* %24
ret void
}

LLVM IR (-O2):
define void @CANRetrySet(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = icmp eq i32 %1, 0
%7 = and i32 %5, -33
%8 = select i1 %6, i32 32, i32 0
%9 = or i32 %7, %8
store volatile i32 %9, i32* %4
ret void
}
int max_int(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
float FastExp2(float);
float FastLog2(float);
float FastPow(float x, float y) { return FastExp2(FastLog2(x) * y); }


x86 assembly (clang, -O0):
<FastPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <FastLog2@plt>
mulss  -0x8(%rbp),%xmm0
call   1040 <FastExp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastPow>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <FastLog2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <FastExp2@plt>

LLVM IR (-O0):
define float @FastPow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @FastLog2(float %5)
%7 = load float, float* %4
%8 = fmul float %6, %7
%9 = call float @FastExp2(float %8)
ret float %9
}

LLVM IR (-O2):
define float @FastPow(float %0, float %1) {
%3 = tail call float @FastLog2(float %0)
%4 = fmul float %3, %1
%5 = tail call float @FastExp2(float %4)
ret float %5
}
/* Variables and functions */
double fabs(double);
double abs_fun(double lhs) { return fabs(lhs); }


x86 assembly (clang, -O0):
<abs_fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_fun>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @abs_fun(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @abs_fun(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8901_mpp_config_analog_output(unsigned mpp, unsigned level,
                                    unsigned control) {
  return pm8901_mpp_config(mpp, 4, level, control);
}


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

x86 assembly (clang, -O2):
<pm8901_mpp_config_analog_output>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <pm8901_mpp_config@plt>

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

LLVM IR (-O2):
define i32 @pm8901_mpp_config_analog_output(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 4, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double my_difftime(time_t left, time_t right) {
  double diff = (double)left - (double)right;
  return diff;
}


x86 assembly (clang, -O0):
<my_difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_difftime>:
cvtsi2sd %rdi,%xmm0
cvtsi2sd %rsi,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to double
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @my_difftime(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fsub double %3, %4
ret double %5
}
/* Variables and functions */
size_t __ctype_get_mb_cur_max() { return 4; }


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

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

LLVM IR (-O0):
define i64 @__ctype_get_mb_cur_max() {
ret i64 4
}

LLVM IR (-O2):
define i64 @__ctype_get_mb_cur_max() {
ret i64 4
}
/* Variables and functions */
long ClockTicks();
long msGettick(void) { return ClockTicks(); }


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

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

LLVM IR (-O0):
define i64 @msGettick() {
%1 = call i64 (...) @ClockTicks()
ret i64 %1
}

LLVM IR (-O2):
define i64 @msGettick() {
%1 = tail call i64 (...) @ClockTicks()
ret i64 %1
}
void OCSP_CERTID_free(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @libretro_dummy_retro_unload_game() {
ret void
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ err(int, char *, char const *);
int /*<<< orphan*/ exit(int);
int open(char const *, int, int);
void createFile(const char *path) {
  int fd = open(path, O_WRONLY | O_CREAT, 0777);
  if (fd < 0) {
    err(1, "open(%s)", path);
    exit(1);
  } else {
    close(fd);
  }
}


x86 assembly (clang, -O0):
<createFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
mov    $0x1ff,%edx
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1198 <createFile+0x58>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xe77(%rip),%rsi
call   1040 <err@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFile>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e85(%rip),%rax
mov    0x2ea6(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1ff,%edx
call   1050 <open@plt>
test   %eax,%eax
js     116c <createFile+0x2c>
mov    %eax,%edi
pop    %rbx
jmp    1030 <close@plt>
lea    0xe8d(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <err@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str = [9 x i8] c"open(%s)\00"
define void @createFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7, i32 511)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %3
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %15
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str = [9 x i8] c"open(%s)\00"
define void @createFile(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 511)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
char *malloc(int);
int main() {
  char *p;
  int i = 0;
  for (; i < 1024 * 1024; i++) {
    p = malloc(sizeof(char));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100000,-0x14(%rbp)
jge    114f <main+0x3f>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1048576
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %2
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "Usage: %s MODE keylen [file]\n"
          "Find the most probable key for a Caesar or a Vigenère cipher.\n"
          "\n"
          "MODE:\n"
          "  --freqs,   -f  prints the letter frequencies of the text\n"
          "  --shift,   -s  find the most probable key for a Caesar or a\n"
          "                 Vigenère cipher, the assumed key length is to be\n"
          "                 provided.\n"
          "  --version, -v  prints information about this program\n"
          "  --help,    -h  prints this help page\n",
          name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [409 x i8] c"Usage: %s MODE keylen [file]\0AFind the most probable key for a Caesar or a Vigen\C3\A8re cipher.\0A\0AMODE:\0A --freqs, -f prints the letter frequencies of the text\0A --shift, -s find the most probable key for a Caesar or a\0A Vigen\C3\A8re cipher, the assumed key length is to be\0A provided.\0A --version, -v prints information about this program\0A --help, -h prints this help page\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([409 x i8], [409 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [409 x i8] c"Usage: %s MODE keylen [file]\0AFind the most probable key for a Caesar or a Vigen\C3\A8re cipher.\0A\0AMODE:\0A --freqs, -f prints the letter frequencies of the text\0A --shift, -s find the most probable key for a Caesar or a\0A Vigen\C3\A8re cipher, the assumed key length is to be\0A provided.\0A --version, -v prints information about this program\0A --help, -h prints this help page\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([409 x i8], [409 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
int p_error(char *err, int ret) {
  fprintf(stderr, "Error %d : %s failure\n", errno, err);
  return (ret);
}


x86 assembly (clang, -O0):
<p_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error %d : %s failure\0A\00"
@errno = global i32 0
define i32 @p_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error %d : %s failure\0A\00"
@errno = global i32 0
define i32 @p_error(i8* %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int b(int i, jmp_buf env) {
  printf("In B: i=%d.  Calling longjmp(env, i)\n", i);
  longjmp(env, i);
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<b>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"In B: i=%d. Calling longjmp(env, i)\0A\00"
define i32 @b(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 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @longjmp(i32 %7, i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"In B: i=%d. Calling longjmp(env, i)\0A\00"
define i32 @b(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @longjmp(i32 %1, i32 %0)
unreachable
}
void ff_hevc_put_hevc_bi_qpel_hv48_10_avx2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @tcp_socket_quit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freeWakeLock(int);
void foo2(void (*F)(int)) {
  F(3);
  freeWakeLock(1);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
mov    $0x1,%edi
call   1030 <freeWakeLock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
mov    %rdi,%rax
mov    $0x3,%edi
call   *%rax
mov    $0x1,%edi
pop    %rax
jmp    1030 <freeWakeLock@plt>

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

LLVM IR (-O2):
define void @foo2(void (i32)* nocapture %0) {
tail call void %0(i32 3)
%2 = tail call i32 @freeWakeLock(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: terminal <n>         where n = 0..3\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"usage: terminal <n> where n = 0..3\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"usage: terminal <n> where n = 0..3\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_set_prop_string_array() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_set_prop_string_array"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"NOT IMPLEMENTED:pa_format_info_set_prop_string_array\0A\00"
define i32 @pa_format_info_set_prop_string_array() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [53 x i8] c"NOT IMPLEMENTED:pa_format_info_set_prop_string_array\00"
define i32 @pa_format_info_set_prop_string_array() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void nguraInitialize() {}


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

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

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

LLVM IR (-O2):
define void @nguraInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printLoop(int *, int);
int main(int argc, char **argv) {
  int x[] = {9, 4, 0, 1, 2, 8};
  printLoop(x, 6);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <printLoop@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [6 x i32] [i32 9, i32 4, i32 0, i32 1, i32 2, i32 8]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [6 x i32]* %6 to i8*
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%9 = call i32 @printLoop(i32* %8, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [6 x i32] [i32 9, i32 4, i32 0, i32 1, i32 2, i32 8]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @printLoop(i32* %5, i32 6)
ret i32 0
}
float recip(float x) { return 1.0 / x; }


x86 assembly (clang, -O0):
<recip>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recip>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @recip(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @recip(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Imprimindo_Valores_Array(int *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ ler_arquivo(int *, int /*<<< orphan*/ *);
int main() {
  FILE *fp;
  int vetor1[50000];
  fp = fopen("arquivo_50000.bin", "rb");
  ler_arquivo(vetor1, fp);
  Imprimindo_Valores_Array(vetor1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30d50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x30d50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <ler_arquivo@plt>
lea    -0x30d50(%rbp),%rdi
call   1030 <Imprimindo_Valores_Array@plt>
xor    %eax,%eax
add    $0x30d50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30d40,%rsp
lea    0xec1(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <ler_arquivo@plt>
mov    %rbx,%rdi
call   1030 <Imprimindo_Valores_Array@plt>
xor    %eax,%eax
add    $0x30d40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"arquivo_50000.bin\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [50000 x i32]
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = getelementptr inbounds [50000 x i32], [50000 x i32]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @ler_arquivo(i32* %5, i32* %6)
%8 = getelementptr inbounds [50000 x i32], [50000 x i32]* %3, i64 0, i64 0
%9 = call i32 @Imprimindo_Valores_Array(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"arquivo_50000.bin\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @main() {
%1 = alloca [50000 x i32]
%2 = bitcast [50000 x i32]* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [50000 x i32], [50000 x i32]* %1, i64 0, i64 0
%5 = call i32 @ler_arquivo(i32* %4, i32* %3)
%6 = call i32 @Imprimindo_Valores_Array(i32* %4)
ret i32 0
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ system_error(char *);
int check_error(int return_value, char *func_name) {
  if (return_value == -1)
    errno = return_value;
  system_error(func_name);
  return return_value;
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1135 <check_error+0x25>
mov    -0x4(%rbp),%ecx
mov    0x2ead(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <system_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
push   %rbx
mov    %edi,%ebx
cmp    $0xffffffff,%edi
jne    1125 <check_error+0x15>
mov    0x2ec1(%rip),%rax
movl   $0xffffffff,(%rax)
mov    %rsi,%rdi
call   1030 <system_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @check_error(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 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %4
%11 = call i32 @system_error(i8* %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @check_error(i32 returned %0, i8* %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %5
4: ; preds = %2
store i32 -1, i32* @errno
br label %5
5: ; preds = %4, %2
%6 = tail call i32 @system_error(i8* %1)
ret i32 %0
}
/* Variables and functions */
long native___NativeString_fetch_4h_ffi___impl(char *, long);
long core___core__NativeString___fetch_95d4h_ffi(char *self, long p0) {
  long var;
  long var1;
  var1 = native___NativeString_fetch_4h_ffi___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core___core__NativeString___fetch_95d4h_ffi>:
jmp    1030 <native___NativeString_fetch_4h_ffi___impl@plt>

LLVM IR (-O0):
define i64 @core___core__NativeString___fetch_95d4h_ffi(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @native___NativeString_fetch_4h_ffi___impl(i8* %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core___core__NativeString___fetch_95d4h_ffi(i8* %0, i64 %1) {
%3 = tail call i64 @native___NativeString_fetch_4h_ffi___impl(i8* %0, i64 %1)
ret i64 %3
}
void GPMCECCResultRegClear(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x1F8)))) |= ((0x00000100u));
}


x86 assembly (clang, -O0):
<GPMCECCResultRegClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCECCResultRegClear>:
add    $0x1f8,%edi
orl    $0x100,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCECCResultRegClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 504
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 256
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPMCECCResultRegClear(i32 %0) {
%2 = add i32 %0, 504
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 256
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void abspath(char *path, char *rel) {
  if (rel[0] != '/') {
    getcwd(path, 1024);
    strcat(path, "/");
    strcat(path, rel);
  } else {
    strcpy(path, rel);
  }
}


x86 assembly (clang, -O0):
<abspath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1180 <abspath+0x50>
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
jmp    118d <abspath+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abspath>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x2f,(%rsi)
jne    1151 <abspath+0x21>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @abspath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %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 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 47
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @getcwd(i8* %11, i32 1024)
%13 = load i8*, i8** %3
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %15, i8* %16)
br label %22
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %19, i8* %20)
br label %22
22: ; preds = %18, %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @abspath(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 47
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @getcwd(i8* %0, i32 1024)
%7 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %0, i8* %1)
br label %11
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("usage: i2p-ping [-amqv?] [-c count] [-h samhost] [-p samport] "
       "<b64dest|name>\n\t[b64dest|name] [b64dest|name] ...");
}


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

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

LLVM IR (-O0):
@.str = [112 x i8] c"usage: i2p-ping [-amqv?] [-c count] [-h samhost] [-p samport] <b64dest|name>\0A\09[b64dest|name] [b64dest|name] ...\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [112 x i8] c"usage: i2p-ping [-amqv?] [-c count] [-h samhost] [-p samport] <b64dest|name>\0A\09[b64dest|name] [b64dest|name] ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int time_t;
struct timespec {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ perror(char *);
time_t time_monotonic(void) {
  struct timespec t;
  if (clock_gettime(CLOCK_MONOTONIC, &t)) {
    perror("time_monotonic clock_gettime");
    return -1;
  }
  return t.tv_sec + 604800;
}


x86 assembly (clang, -O0):
<time_monotonic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     115c <time_monotonic+0x3c>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <time_monotonic+0x47>
mov    -0x8(%rbp),%eax
add    $0x93a80,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_monotonic>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
jne    1141 <time_monotonic+0x21>
mov    $0x93a80,%eax
add    (%rsp),%eax
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [29 x i8] c"time_monotonic clock_gettime\00"
define i32 @time_monotonic() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %12
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 604800
store i32 %11, i32* %1
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [29 x i8] c"time_monotonic clock_gettime\00"
define i32 @time_monotonic() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 604800
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ -1, %6 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int LONG_MAX;
int test_tmax(void) { return LONG_MAX; }


x86 assembly (clang, -O0):
<test_tmax>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tmax>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@LONG_MAX = global i32 0
define i32 @test_tmax() {
%1 = load i32, i32* @LONG_MAX
ret i32 %1
}

LLVM IR (-O2):
@LONG_MAX = global i32 0
define i32 @test_tmax() {
%1 = load i32, i32* @LONG_MAX
ret i32 %1
}
/* Variables and functions */
int func7b(int);
__attribute__((always_)) int func7a(int x) { return func7b(x * 29); }


x86 assembly (clang, -O0):
<func7a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x1d,-0x4(%rbp),%edi
call   1030 <func7b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func7a>:
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,2),%eax
add    %edi,%eax
add    %eax,%edi
jmp    1030 <func7b@plt>

LLVM IR (-O0):
define i32 @func7a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 29
%5 = call i32 @func7b(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func7a(i32 %0) {
%2 = mul nsw i32 %0, 29
%3 = tail call i32 @func7b(i32 %2)
ret i32 %3
}
_Complex double test_csqrt(_Complex double x) { return __builtin_csqrt(x); }


x86 assembly (clang, -O0):
<test_csqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <csqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csqrt>:
jmp    1030 <csqrt@plt>

LLVM IR (-O0):
define { double, double } @test_csqrt(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @csqrt(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_csqrt(double %0, double %1) {
%3 = tail call { double, double } @csqrt(double %0, double %1)
ret { double, double } %3
}
void undo_clear(void) {}


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

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

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

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