xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ aes_encrypt(unsigned char const *, int const,
                               unsigned char *, void *, unsigned char const *,
                               int);
void aes_128_encrypt(const unsigned char *plaintext, const int plaintext_len,
                     unsigned char ciphertext[], void *iv,
                     const unsigned char *key) {
  aes_encrypt(plaintext, plaintext_len, ciphertext, iv, key, 16);
}


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

x86 assembly (clang, -O2):
<aes_128_encrypt>:
mov    $0x10,%r9d
jmp    1030 <aes_encrypt@plt>

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

LLVM IR (-O2):
define void @aes_128_encrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @aes_encrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 16)
ret void
}
void gtk_combo_box_get_active_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_get_active_iter() {
ret void
}
/* Variables and functions */
double log(int);
int sqrt(int);
double aCsch(double x) { return log((1 + sqrt(1 + x * x)) / x); }


x86 assembly (clang, -O0):
<aCsch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aCsch>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeca(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @aCsch(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @sqrt(i32 %6)
%8 = add nsw i32 1, %7
%9 = sitofp i32 %8 to double
%10 = load double, double* %2
%11 = fdiv double %9, %10
%12 = fptosi double %11 to i32
%13 = call double @log(i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @aCsch(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call i32 @sqrt(i32 %3)
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, %0
%8 = fptosi double %7 to i32
%9 = tail call double @log(i32 %8)
ret double %9
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int GetTimerMS(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<GetTimerMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimerMS>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @GetTimerMS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @GetTimerMS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
float Sleef_tanf_u35(float x) { return __builtin_tanf(x); }


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

x86 assembly (clang, -O2):
<Sleef_tanf_u35>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @Sleef_tanf_u35(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ userInterfaceInit();
void coreInitUserInterface(void) { userInterfaceInit(); }


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

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

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

LLVM IR (-O2):
define void @coreInitUserInterface() {
%1 = tail call i32 (...) @userInterfaceInit()
ret void
}
void bar(int *x, int *y, int z) {
  if (z) {
    x = y;
  }
  *x = 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1121 <bar+0x21>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edx,%edx
cmovne %rsi,%rdi
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @bar(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* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32*, i32** %5
store i32* %10, i32** %4
br label %11
11: ; preds = %9, %3
%12 = load i32*, i32** %4
store i32 0, i32* %12
ret void
}

LLVM IR (-O2):
define void @bar(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32* %0, i32* %1
store i32 0, i32* %5
ret void
}
unsigned int imul(unsigned int flags) {
  int is_dma, type_dma, is_rec;
  is_dma = !!(flags & 1u);
  type_dma = is_dma * 2;
  is_rec = !!(flags & 0x10u);
  return type_dma + (is_rec * !is_dma) * 1;
}


x86 assembly (clang, -O0):
<imul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmpl   $0x0,-0x8(%rbp)
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
imul   %edx,%ecx
shl    $0x0,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imul>:
mov    %edi,%eax
and    $0x1,%eax
shr    $0x4,%edi
and    $0x1,%edi
mov    %eax,%ecx
xor    $0x1,%ecx
imul   %edi,%ecx
lea    (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @imul(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 2
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = and i32 %14, 16
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %5
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = mul nsw i32 %21, %25
%27 = mul nsw i32 %26, 1
%28 = add nsw i32 %20, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @imul(i32 %0) {
%2 = and i32 %0, 1
%3 = shl nuw nsw i32 %2, 1
%4 = lshr i32 %0, 4
%5 = and i32 %4, 1
%6 = xor i32 %2, 1
%7 = mul nuw nsw i32 %5, %6
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ CyIntDisable(int);
void ADC_SAR_1_IRQ_Disable(void) { CyIntDisable(2); }


x86 assembly (clang, -O0):
<ADC_SAR_1_IRQ_Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <CyIntDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_SAR_1_IRQ_Disable>:
mov    $0x2,%edi
jmp    1030 <CyIntDisable@plt>

LLVM IR (-O0):
define void @ADC_SAR_1_IRQ_Disable() {
%1 = call i32 @CyIntDisable(i32 2)
ret void
}

LLVM IR (-O2):
define void @ADC_SAR_1_IRQ_Disable() {
%1 = tail call i32 @CyIntDisable(i32 2)
ret void
}
float mediaPonderada(float nota_1, float peso_1, float nota_2, float peso_2) {
  return ((nota_1 * peso_1) + (nota_2 * peso_2)) / peso_1 + peso_2;
}


x86 assembly (clang, -O0):
<mediaPonderada>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
divss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mediaPonderada>:
mulss  %xmm3,%xmm2
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
divss  %xmm1,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @mediaPonderada(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %9, float %10, float %13)
%15 = load float, float* %6
%16 = fdiv float %14, %15
%17 = load float, float* %8
%18 = fadd float %16, %17
ret float %18
}

LLVM IR (-O2):
define float @mediaPonderada(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, %3
%6 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %5)
%7 = fdiv float %6, %1
%8 = fadd float %7, %3
ret float %8
}
int midi_setflag(int mode, int index, int val) { return (-1); }


x86 assembly (clang, -O0):
<midi_setflag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @midi_setflag(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @midi_setflag(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
void modulo_unsigned_Good(unsigned int i) {
  char arr[5];
  arr[i % 5] = 123;
}


x86 assembly (clang, -O0):
<modulo_unsigned_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
movb   $0x7b,-0x9(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_unsigned_Good(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = urem i32 %4, 5
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %6
store i8 123, i8* %7
ret void
}

LLVM IR (-O2):
define void @modulo_unsigned_Good(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ pow(double, double);
float sqrt(scalar_t__);
float calc_muf(float peak_height, float plasma_freq) {
  peak_height /= 6371.0;
  return plasma_freq / sqrt(1.0 - pow(1.0 / (1.0 + peak_height), 2.0));
}


x86 assembly (clang, -O0):
<calc_muf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe6b(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_muf>:
push   %rax
movss  %xmm1,0x4(%rsp)
divss  0xed1(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1040 <sqrt@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calc_muf(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 = fpext float %5 to double
%7 = fdiv double %6, 6.371000e+03
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fadd double 1.000000e+00, %11
%13 = fdiv double 1.000000e+00, %12
%14 = call i64 @pow(double %13, double 2.000000e+00)
%15 = sitofp i64 %14 to double
%16 = fsub double 1.000000e+00, %15
%17 = fptosi double %16 to i64
%18 = call float @sqrt(i64 %17)
%19 = fdiv float %9, %18
ret float %19
}

LLVM IR (-O2):
define float @calc_muf(float %0, float %1) {
%3 = fdiv float %0, 6.371000e+03
%4 = fpext float %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = tail call i64 @pow(double %6, double 2.000000e+00)
%8 = sitofp i64 %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = fptosi double %9 to i64
%11 = tail call float @sqrt(i64 %10)
%12 = fdiv float %1, %11
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_version(int *, int *, int *);
void nloptv_(int *major, int *minor, int *bugfix) {
  nlopt_version(major, minor, bugfix);
}


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

x86 assembly (clang, -O2):
<nloptv_>:
jmp    1030 <nlopt_version@plt>

LLVM IR (-O0):
define void @nloptv_(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 @nlopt_version(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @nloptv_(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @nlopt_version(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
void *render_byte(int, void *);
void *render_length(int, void *);
void *render_header(int type, int data_len, void *dest) {
  dest = render_byte(type, dest);
  return render_length(data_len, dest);
}


x86 assembly (clang, -O0):
<render_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <render_byte@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <render_length@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_header>:
push   %rbx
mov    %esi,%ebx
mov    %rdx,%rsi
call   1030 <render_byte@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <render_length@plt>

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

LLVM IR (-O2):
define i8* @render_header(i32 %0, i32 %1, i8* %2) {
%4 = tail call i8* @render_byte(i32 %0, i8* %2)
%5 = tail call i8* @render_length(i32 %1, i8* %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteCommand(int);
int /*<<< orphan*/ WriteData(int /*<<< orphan*/);
void Kentec320x240x16_SSD2119PixelDraw(void *pvDisplayData, int32_t i32X,
                                       int32_t i32Y, uint32_t ui32Value) {
  WriteCommand(0x4e);
  WriteData((i32X));
  WriteCommand(0x4f);
  WriteData((i32Y));
  WriteCommand(0x22);
  WriteData(ui32Value);
}


x86 assembly (clang, -O0):
<Kentec320x240x16_SSD2119PixelDraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x4e,%edi
call   1040 <WriteCommand@plt>
mov    -0xc(%rbp),%edi
call   1030 <WriteData@plt>
mov    $0x4f,%edi
call   1040 <WriteCommand@plt>
mov    -0x10(%rbp),%edi
call   1030 <WriteData@plt>
mov    $0x22,%edi
call   1040 <WriteCommand@plt>
mov    -0x14(%rbp),%edi
call   1030 <WriteData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kentec320x240x16_SSD2119PixelDraw>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    $0x4e,%edi
call   1040 <WriteCommand@plt>
mov    %ebx,%edi
call   1030 <WriteData@plt>
mov    $0x4f,%edi
call   1040 <WriteCommand@plt>
mov    %ebp,%edi
call   1030 <WriteData@plt>
mov    $0x22,%edi
call   1040 <WriteCommand@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <WriteData@plt>

LLVM IR (-O0):
define void @Kentec320x240x16_SSD2119PixelDraw(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @WriteCommand(i32 78)
%10 = load i32, i32* %6
%11 = call i32 @WriteData(i32 %10)
%12 = call i32 @WriteCommand(i32 79)
%13 = load i32, i32* %7
%14 = call i32 @WriteData(i32 %13)
%15 = call i32 @WriteCommand(i32 34)
%16 = load i32, i32* %8
%17 = call i32 @WriteData(i32 %16)
ret void
}

LLVM IR (-O2):
define void @Kentec320x240x16_SSD2119PixelDraw(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @WriteCommand(i32 78)
%6 = tail call i32 @WriteData(i32 %1)
%7 = tail call i32 @WriteCommand(i32 79)
%8 = tail call i32 @WriteData(i32 %2)
%9 = tail call i32 @WriteCommand(i32 34)
%10 = tail call i32 @WriteData(i32 %3)
ret void
}
unsigned f3(unsigned abcd[]) { return abcd[2] ^ (abcd[1] | ~abcd[3]); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x8(%rbp),%rdx
mov    0xc(%rdx),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    0xc(%rdi),%eax
not    %eax
or     0x4(%rdi),%eax
xor    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
%11 = load i32, i32* %10
%12 = xor i32 %11, -1
%13 = or i32 %8, %12
%14 = xor i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f3(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 3
%7 = load i32, i32* %6
%8 = xor i32 %7, -1
%9 = or i32 %5, %8
%10 = xor i32 %9, %3
ret i32 %10
}
int config_MODULE_CONSTCW(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_CONSTCW() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int);
int f(int a) {
  if (a > 0)
    g(a, 3);
  else
    g(a, 5);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <f+0x27>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <g@plt>
jmp    1144 <f+0x34>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
lea    (%rax,%rax,1),%esi
add    $0x3,%esi
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @g(i32 %7, i32 3)
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @g(i32 %10, i32 5)
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 3, i32 5
%4 = tail call i32 @g(i32 %0, i32 %3)
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t le_to_h_u16(const uint8_t *buf) {
  return (uint16_t)(buf[0] | buf[1] << 8);
}


x86 assembly (clang, -O0):
<le_to_h_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_h_u16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le_to_h_u16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @le_to_h_u16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strstr(char *, char *);
ssize_t strFindFirst(char *string, char *search) {
  char *pos;
  assert(string != NULL);
  assert(search != NULL);
  pos = strstr(string, search);
  if (pos)
    return (size_t)(pos - string);
  else
    return -1;
}


x86 assembly (clang, -O0):
<strFindFirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1184 <strFindFirst+0x64>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    118c <strFindFirst+0x6c>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strFindFirst>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
cmp    $0x1,%rax
sbb    %rax,%rax
or     %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strFindFirst(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = call i8* @strstr(i8* %15, i8* %16)
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %26
20: ; preds = %2
%21 = load i8*, i8** %6
%22 = load i8*, i8** %4
%23 = ptrtoint i8* %21 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
store i64 %25, i64* %3
br label %27
26: ; preds = %2
store i64 -1, i64* %3
br label %27
27: ; preds = %26, %20
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @strFindFirst(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%10 = icmp eq i8* %9, null
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = select i1 %10, i64 -1, i64 %13
ret i64 %14
}
int set_compare(const void *a, const void *b) {
  return (*(char *)a - *(char *)b);
}


x86 assembly (clang, -O0):
<set_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_compare>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @set_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fooA(int *iptr) {
  printf("The value of the integer pointed to by iptr is %d\n", *iptr);
  printf("The address pointed to by iptr is %p\n", iptr);
  printf("The address of iptr itself is %p\n", &iptr);
}


x86 assembly (clang, -O0):
<fooA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooA>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
mov    (%rdi),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"The value of the integer pointed to by iptr is %d\0A\00"
@.str.1 = [38 x i8] c"The address pointed to by iptr is %p\0A\00"
@.str.2 = [34 x i8] c"The address of iptr itself is %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"The value of the integer pointed to by iptr is %d\0A\00"
@.str.1 = [38 x i8] c"The address pointed to by iptr is %p\0A\00"
@.str.2 = [34 x i8] c"The address of iptr itself is %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Application Usage \n");
  printf("./video_library_cmd [for 1080p] \n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Application Usage \0A\00"
@.str.1 = [34 x i8] c"./video_library_cmd [for 1080p] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [19 x i8] c"Application Usage \00"
@str.2 = [33 x i8] c"./video_library_cmd [for 1080p] \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removerEspacosEsquerda(char *);
int main() {
  char string[] = " teste";
  removerEspacosEsquerda(string);
  printf("%s", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
call   1040 <removerEspacosEsquerda@plt>
lea    -0x7(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x657473,0xb(%rsp)
movl   $0x73657420,0x8(%rsp)
73
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <removerEspacosEsquerda@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.string = [7 x i8] c" teste\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @removerEspacosEsquerda(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int main() {
  ungetc(23, stdin);
  if (fgetc(stdin) != 23)
    return 1;
  ungetc(230, stdin);
  if (fgetc(stdin) != 230)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x17,%edi
call   1040 <ungetc@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
cmp    $0x17,%eax
je     1165 <main+0x45>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <main+0x84>
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    $0xe6,%edi
call   1040 <ungetc@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
cmp    $0xe6,%eax
je     119d <main+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <main+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%esi
mov    $0x17,%edi
call   1040 <ungetc@plt>
mov    (%rbx),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x17,%ecx
jne    1167 <main+0x47>
mov    (%rbx),%esi
mov    $0xe6,%edi
call   1040 <ungetc@plt>
mov    (%rbx),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xe6,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @ungetc(i32 23, i32 %2)
%4 = load i32, i32* @stdin
%5 = call i32 @fgetc(i32 %4)
%6 = icmp ne i32 %5, 23
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %16
8: ; preds = %0
%9 = load i32, i32* @stdin
%10 = call i32 @ungetc(i32 230, i32 %9)
%11 = load i32, i32* @stdin
%12 = call i32 @fgetc(i32 %11)
%13 = icmp ne i32 %12, 230
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 1, i32* %1
br label %16
15: ; preds = %8
store i32 0, i32* %1
br label %16
16: ; preds = %15, %14, %7
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @ungetc(i32 23, i32 %1)
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgetc(i32 %3)
%5 = icmp eq i32 %4, 23
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* @stdin
%8 = tail call i32 @ungetc(i32 230, i32 %7)
%9 = load i32, i32* @stdin
%10 = tail call i32 @fgetc(i32 %9)
%11 = icmp ne i32 %10, 230
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %0
%14 = phi i32 [ 1, %0 ], [ %12, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ offset;

/* Variables and functions */
int min(int, int);
int get_trans_len(uint32_t offset, uint32_t len) {
  if (!(0 == ((offset) & (64 - 1)))) {
    return min((((offset) + (64 - 1)) & ~(64 - 1)) - offset, len);
  }
  return min(64, len);
}


x86 assembly (clang, -O0):
<get_trans_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x3f,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     114a <get_trans_len+0x3a>
mov    -0x8(%rbp),%edi
add    $0x3f,%edi
and    $0xffffffc0,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <min@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <get_trans_len+0x4a>
mov    -0xc(%rbp),%esi
mov    $0x40,%edi
call   1030 <min@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_trans_len>:
lea    0x3f(%rdi),%eax
and    $0xffffffc0,%eax
sub    %edi,%eax
test   $0x3f,%dil
mov    $0x40,%edi
cmovne %eax,%edi
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @get_trans_len(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = and i32 %6, 63
%8 = icmp eq i32 0, %7
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 63
%12 = and i32 %11, -64
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %5
%16 = call i32 @min(i32 %14, i32 %15)
store i32 %16, i32* %3
br label %20
17: ; preds = %2
%18 = load i32, i32* %5
%19 = call i32 @min(i32 64, i32 %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_trans_len(i32 %0, i32 %1) {
%3 = and i32 %0, 63
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %0, 63
%6 = and i32 %5, -64
%7 = sub nsw i32 %6, %0
%8 = select i1 %4, i32 64, i32 %7
%9 = tail call i32 @min(i32 %8, i32 %1)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_connect_upload() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_connect_upload"
         "\n");
}


x86 assembly (clang, -O0):
<pa_stream_connect_upload>:
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_stream_connect_upload>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_stream_connect_upload\00"
define i32 @pa_stream_connect_upload() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ expres();
int /*<<< orphan*/ getsym();
void symexpres(void) {
  getsym();
  expres();
}


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

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

LLVM IR (-O0):
define void @symexpres() {
%1 = call i32 (...) @getsym()
%2 = call i32 (...) @expres()
ret void
}

LLVM IR (-O2):
define void @symexpres() {
%1 = tail call i32 (...) @getsym()
%2 = tail call i32 (...) @expres()
ret void
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ speedmusic(int);
void basSpeedMusic() {
  int v;
  v = popNumber();
  pushNumber(speedmusic(v));
}


x86 assembly (clang, -O0):
<basSpeedMusic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <speedmusic@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSpeedMusic>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <speedmusic@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basSpeedMusic() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @speedmusic(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basSpeedMusic() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @speedmusic(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ cfgetospeed(struct termios const *);
speed_t cfgetispeed(const struct termios *tio) { return cfgetospeed(tio); }


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

x86 assembly (clang, -O2):
<cfgetispeed>:
jmp    1030 <cfgetospeed@plt>

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

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = tail call i32 @cfgetospeed(%struct.termios* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB5_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB5_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRB5_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void position(int line, int col) { printf("\033[%d;%dH", line, col); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @position(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @position(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int mod1();
int mod2();
int mod3();
int mod4();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("\t%d\n", mod1());
  printf("\t%d\n", mod2());
  printf("\t%d\n", mod3());
  printf("\t%d\n", mod4());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <mod1@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <mod2@plt>
mov    %eax,%esi
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <mod3@plt>
mov    %eax,%esi
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <mod4@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <mod1@plt>
lea    0xea1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <mod2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <mod3@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <mod4@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @mod1()
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @mod2()
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @mod3()
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @mod4()
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mod1()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @mod2()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @mod3()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @mod4()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
struct shmm_blk {
  int dummy;
};
struct _mm_section_impl {
  int dummy;
};

/* Variables and functions */
scalar_t__ shmm_begin_addr(struct shmm_blk *);
struct _mm_section_impl *_get_section(struct shmm_blk *shm) {
  return (struct _mm_section_impl *)shmm_begin_addr(shm);
}


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

x86 assembly (clang, -O2):
<_get_section>:
jmp    1030 <shmm_begin_addr@plt>

LLVM IR (-O0):
%struct._mm_section_impl = type { i32 }
%struct.shmm_blk = type { i32 }
define %struct._mm_section_impl* @_get_section(%struct.shmm_blk* %0) {
%2 = alloca %struct.shmm_blk*
store %struct.shmm_blk* %0, %struct.shmm_blk** %2
%3 = load %struct.shmm_blk*, %struct.shmm_blk** %2
%4 = call i64 @shmm_begin_addr(%struct.shmm_blk* %3)
%5 = inttoptr i64 %4 to %struct._mm_section_impl*
ret %struct._mm_section_impl* %5
}

LLVM IR (-O2):
%struct._mm_section_impl = type { i32 }
%struct.shmm_blk = type { i32 }
define %struct._mm_section_impl* @_get_section(%struct.shmm_blk* %0) {
%2 = tail call i64 @shmm_begin_addr(%struct.shmm_blk* %0)
%3 = inttoptr i64 %2 to %struct._mm_section_impl*
ret %struct._mm_section_impl* %3
}