xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
void strcatc(char *string, char character) {
  int length = strlen(string);
  string[length] = character;
  string[length + 1] = '\0';
}


x86 assembly (clang, -O0):
<strcatc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @strcatc(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @strcatc(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void g_main_context_dispatch() {}


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

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

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

LLVM IR (-O2):
define void @g_main_context_dispatch() {
ret void
}
int dblcomp(const void *arg1, const void *arg2) {
  return (*(double *)arg1 > *(double *)arg2    ? 1
          : *(double *)arg1 == *(double *)arg2 ? 0
                                               : -1);
}


x86 assembly (clang, -O0):
<dblcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112f <dblcomp+0x2f>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115a <dblcomp+0x5a>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    $0xffffffff,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblcomp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dblcomp(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to double*
%16 = load double, double* %15
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to double*
%19 = load double, double* %18
%20 = fcmp oeq double %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 0, i32 -1
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ 1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @dblcomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp une double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_open_open(double *, int);
void fill_array_open_open(double array[], int size) {
  dsfmt_gv_fill_array_open_open(array, size);
}


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

x86 assembly (clang, -O2):
<fill_array_open_open>:
jmp    1030 <dsfmt_gv_fill_array_open_open@plt>

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

LLVM IR (-O2):
define void @fill_array_open_open(double* %0, i32 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_open_open(double* %0, i32 %1)
ret void
}
int test_imm_61int16_reg(short val) {
  return ((val) & (-0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61int16_reg>:
test   $0xff9f,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_61int16_reg(i16 signext %0) {
%2 = and i16 %0, -97
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void fdi_writeback(int drive, int track) { return; }


x86 assembly (clang, -O0):
<fdi_writeback>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fdi_writeback(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int *allocateLoop(int, int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ print(int *);
int main() {
  int *a = allocateLoop(2, (int *)malloc(2 * sizeof(int)));
  print(a);
  free(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1040 <allocateLoop@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <print@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1040 <allocateLoop@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32*
%4 = call i32* @allocateLoop(i32 2, i32* %3)
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32 @print(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32* @allocateLoop(i32 2, i32* %2)
%4 = tail call i32 @print(i32* %3)
%5 = tail call i32 @free(i32* %3)
ret i32 0
}
unsigned addval_392(unsigned x) { return x + 3222851209U; }


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

x86 assembly (clang, -O2):
<addval_392>:
lea    -0x3fe73177(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_392(i32 %0) {
%2 = add i32 %0, -1072116087
ret i32 %2
}
int gt(unsigned long a, unsigned long b) { return a > b; }


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
ret

LLVM IR (-O0):
define i32 @gt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gt(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
double test_rint(double x) { return __builtin_rint(x); }


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

x86 assembly (clang, -O2):
<test_rint>:
jmp    1030 <rint@plt>

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

LLVM IR (-O2):
define double @test_rint(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ format;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, unsigned int);
int /*<<< orphan*/ sprintf(char *, char *, float);
char *dtostrf(float val, int width, unsigned int precision, char *buf) {
  char format[10];
  snprintf(format, sizeof(format), "%%%i.%if", width, precision);
  sprintf(buf, format, val);
  return buf;
}


x86 assembly (clang, -O0):
<dtostrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    $0xa,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x22(%rbp),%rsi
movss  -0x4(%rbp),%xmm0
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtostrf>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%r8d
mov    %edi,%ecx
movss  %xmm0,0x8(%rsp)
lea    0xec4(%rip),%rdx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
movss  0x8(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%%%i.%if\00"
define i8* @dtostrf(float %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [10 x i8]
store float %0, float* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @snprintf(i8* %10, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i8*, i8** %8
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%16 = load float, float* %5
%17 = call i32 @sprintf(i8* %14, i8* %15, float %16)
%18 = load i8*, i8** %8
ret i8* %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"%%%i.%if\00"
define i8* @dtostrf(float %0, i32 %1, i32 %2, i8* returned writeonly %3) {
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%8 = call i32 @sprintf(i8* dereferenceable(1) %3, i8* %6, float %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
void file_cache_setumask(mode_t *m) {
  *m = umask(0);
  umask(*m);
}


x86 assembly (clang, -O0):
<file_cache_setumask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <umask@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <umask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_cache_setumask>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <umask@plt>
mov    %eax,(%rbx)
mov    %eax,%edi
pop    %rbx
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define void @file_cache_setumask(i32* nocapture writeonly %0) {
%2 = tail call i32 @umask(i32 0)
store i32 %2, i32* %0
%3 = tail call i32 @umask(i32 %2)
ret void
}
void local_mcu_ConsolePrint_targetInit__I() {}


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

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

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

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

/* Variables and functions */
void write_bits(char *dst, uint64_t offs, uint32_t val) {
  uint64_t *dst_w = (uint64_t *)&dst[offs >> 3];
  *dst_w |= ((uint64_t)val) << (offs & 7);
}


x86 assembly (clang, -O0):
<write_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bits>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
shl    %cl,%edx
cltq
or     %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @write_bits(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = ashr i32 %9, 3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %7
%14 = load i64, i64* %6
%15 = trunc i64 %14 to i32
%16 = load i32, i32* %5
%17 = and i32 %16, 7
%18 = shl i32 %15, %17
%19 = load i32*, i32** %7
%20 = load i32, i32* %19
%21 = or i32 %20, %18
store i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @write_bits(i8* nocapture %0, i32 %1, i64 %2) {
%4 = ashr i32 %1, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = bitcast i8* %6 to i32*
%8 = trunc i64 %2 to i32
%9 = and i32 %1, 7
%10 = shl i32 %8, %9
%11 = load i32, i32* %7
%12 = or i32 %11, %10
store i32 %12, i32* %7
ret void
}
void newstyle1(int a) { ; }


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

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

LLVM IR (-O0):
define void @newstyle1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @newstyle1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_test01();
int /*<<< orphan*/ do_test02();
int /*<<< orphan*/ do_test03();
int /*<<< orphan*/ do_test04();
int /*<<< orphan*/ do_test05();
int /*<<< orphan*/ do_test06();
int /*<<< orphan*/ do_test07();
int /*<<< orphan*/ do_test08();
int main(int argc, char *argv[]) {
  do_test01();
  do_test02();
  do_test03();
  do_test04();
  do_test05();
  do_test06();
  do_test07();
  do_test08();
  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   10a0 <do_test01@plt>
mov    $0x0,%al
call   1050 <do_test02@plt>
mov    $0x0,%al
call   1070 <do_test03@plt>
mov    $0x0,%al
call   1040 <do_test04@plt>
mov    $0x0,%al
call   1090 <do_test05@plt>
mov    $0x0,%al
call   1060 <do_test06@plt>
mov    $0x0,%al
call   1080 <do_test07@plt>
mov    $0x0,%al
call   1030 <do_test08@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10a0 <do_test01@plt>
xor    %eax,%eax
call   1050 <do_test02@plt>
xor    %eax,%eax
call   1070 <do_test03@plt>
xor    %eax,%eax
call   1040 <do_test04@plt>
xor    %eax,%eax
call   1090 <do_test05@plt>
xor    %eax,%eax
call   1060 <do_test06@plt>
xor    %eax,%eax
call   1080 <do_test07@plt>
xor    %eax,%eax
call   1030 <do_test08@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @do_test01()
%7 = call i32 (...) @do_test02()
%8 = call i32 (...) @do_test03()
%9 = call i32 (...) @do_test04()
%10 = call i32 (...) @do_test05()
%11 = call i32 (...) @do_test06()
%12 = call i32 (...) @do_test07()
%13 = call i32 (...) @do_test08()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_test01()
%4 = tail call i32 (...) @do_test02()
%5 = tail call i32 (...) @do_test03()
%6 = tail call i32 (...) @do_test04()
%7 = tail call i32 (...) @do_test05()
%8 = tail call i32 (...) @do_test06()
%9 = tail call i32 (...) @do_test07()
%10 = tail call i32 (...) @do_test08()
ret i32 0
}
void RTDbgModCreateFromImage(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModCreateFromImage() {
ret void
}
void complententodoselectionsort(int *vetor, int tamanho, int i) {}


x86 assembly (clang, -O0):
<complententodoselectionsort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @complententodoselectionsort(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 void
}

LLVM IR (-O2):
define void @complententodoselectionsort(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
bool in_range(int x, int lo, int hi) { return x >= lo && x < hi; }


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <in_range+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_range(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 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a, b, c, d;
  a = 5;
  b = 6;
  printf("Before Interchange a= %d    b=%d\n", a, b);
  c = a;
  d = b;
  a = d;
  b = c;
  printf("After Interchange a= %d    b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x6,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Before Interchange a= %d b=%d\0A\00"
@.str.1 = [33 x i8] c"After Interchange a= %d b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 6, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %2
store i32 %9, i32* %4
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %5
store i32 %11, i32* %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Before Interchange a= %d b=%d\0A\00"
@.str.1 = [33 x i8] c"After Interchange a= %d b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ get_uptime();
int /*<<< orphan*/ io_debug(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  time_t uptime;
  uptime = get_uptime();
  io_debug("uptime = %i\n", uptime);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_uptime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <io_debug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_uptime@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <io_debug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"uptime = %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @get_uptime()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @io_debug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"uptime = %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_uptime()
%4 = tail call i32 @io_debug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_read_shadow_stack_metadata_store(char **,
                                                                   int);
double strtod(char const *, char **);
__attribute__((__weak__, __always___)) double
softboundmpx_strtod(const char *nptr, char **endptr) {
  double temp = strtod(nptr, endptr);
  if (endptr != NULL) {
    __softboundmpx_read_shadow_stack_metadata_store(endptr, 1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<softboundmpx_strtod>:
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 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <softboundmpx_strtod+0x3b>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strtod>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <strtod@plt>
test   %rbx,%rbx
je     114b <softboundmpx_strtod+0x2b>
mov    %rbx,%rdi
mov    $0x1,%esi
movsd  %xmm0,0x8(%rsp)
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define weak double @softboundmpx_strtod(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca double
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8**, i8*** %4
%8 = call double @strtod(i8* %6, i8** %7)
store double %8, double* %5
%9 = load i8**, i8*** %4
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = call i32 @__softboundmpx_read_shadow_stack_metadata_store(i8** %12, i32 1)
br label %14
14: ; preds = %11, %2
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define weak double @softboundmpx_strtod(i8* %0, i8** %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
%4 = icmp eq i8** %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__softboundmpx_read_shadow_stack_metadata_store(i8** %1, i32 1)
br label %7
7: ; preds = %5, %2
ret double %3
}
void shift_and_trim(char **str) {
  *str += 2;
  while (**str == ' ')
    ++*str;
}


x86 assembly (clang, -O0):
<shift_and_trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113c <shift_and_trim+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1116 <shift_and_trim+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_and_trim>:
mov    (%rdi),%rax
add    $0x2,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rdi)
cmpb   $0x20,(%rax)
lea    0x1(%rax),%rax
je     1110 <shift_and_trim+0x10>
ret

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

LLVM IR (-O2):
define void @shift_and_trim(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 2
br label %4
4: ; preds = %4, %1
%5 = phi i8* [ %3, %1 ], [ %8, %4 ]
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
%8 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void UnknownModel(double speed) {
  printf("Sorry! The requested model has not yet been developed.\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Sorry! The requested model has not yet been developed.\0A\00"
define void @UnknownModel(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"Sorry! The requested model has not yet been developed.\00"
define void @UnknownModel(double %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void encode_json_long(FILE *fp, const char *label, long value, int first) {
  if (!first) {
    fprintf(fp, ",\n");
  }
  fprintf(fp, " \"%s\": %ld", label, value);
}


x86 assembly (clang, -O0):
<encode_json_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1143 <encode_json_long+0x33>
mov    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_json_long>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
test   %ecx,%ecx
jne    114b <encode_json_long+0x2b>
lea    0xec7(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c",\0A\00"
@.str.1 = [11 x i8] c" \22%s\22: %ld\00"
define void @encode_json_long(i32* nocapture %0, i8* %1, i64 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main() { write(STDOUT_FILENO, "bonjour la classe\n", 18); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [19 x i8] c"bonjour la classe\0A\00"
define i32 @main() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [19 x i8] c"bonjour la classe\0A\00"
define i32 @main() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret i32 0
}
int between(int l, int u, int x) { return (l > x ? l : x > u ? u : x); }


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <between+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <between+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113b <between+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <between+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @between(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* %6
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %22
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %6
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @between(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp sgt i32 %2, %1
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
unsigned long long __blsfill_u64(unsigned long long);
unsigned long long func_blsfill64(unsigned long long X) {
  return __blsfill_u64(X);
}


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

x86 assembly (clang, -O2):
<func_blsfill64>:
jmp    1030 <__blsfill_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blsfill64(i64 %0) {
%2 = tail call i64 @__blsfill_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void otherFunc(const char *msg) { printf("%s\n", msg); }


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

x86 assembly (clang, -O2):
<otherFunc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @otherFunc(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double rint(double);
double test1(double x) { return rint(x); }


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

x86 assembly (clang, -O2):
<test1>:
jmp    1030 <rint@plt>

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

LLVM IR (-O2):
define double @test1(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
void PWM_device_channel_stop_all() {}


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

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

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

LLVM IR (-O2):
define void @PWM_device_channel_stop_all() {
ret void
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ printlock_w39_common(struct flashctx *, int);
scalar_t__ unlock_w39_fwh(struct flashctx *);
int unlock_w39v080fa(struct flashctx *flash) {
  if (unlock_w39_fwh(flash))
    return -1;
  if (printlock_w39_common(flash, 0xffff2))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<unlock_w39v080fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlock_w39_fwh@plt>
cmp    $0x0,%rax
je     114b <unlock_w39v080fa+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <unlock_w39v080fa+0x56>
mov    -0x10(%rbp),%rdi
mov    $0xffff2,%esi
call   1040 <printlock_w39_common@plt>
cmp    $0x0,%rax
je     116f <unlock_w39v080fa+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <unlock_w39v080fa+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_w39v080fa>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlock_w39_fwh@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <unlock_w39v080fa+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0xffff2,%esi
call   1040 <printlock_w39_common@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @unlock_w39v080fa(%struct.flashctx* %0) {
%2 = alloca i32
%3 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %3
%4 = load %struct.flashctx*, %struct.flashctx** %3
%5 = call i64 @unlock_w39_fwh(%struct.flashctx* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load %struct.flashctx*, %struct.flashctx** %3
%10 = call i64 @printlock_w39_common(%struct.flashctx* %9, i32 1048562)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @unlock_w39v080fa(%struct.flashctx* %0) {
%2 = tail call i64 @unlock_w39_fwh(%struct.flashctx* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @printlock_w39_common(%struct.flashctx* %0, i32 1048562)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double M_PI_2;
double sin(double);
double JHKeyframeAnimationFunctionEaseOutSine(double t, double b, double c,
                                              double d) {
  return c * sin(t / d * (M_PI_2)) + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseOutSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    0x2ea1(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseOutSine>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
divsd  %xmm3,%xmm0
mov    0x2ebd(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @JHKeyframeAnimationFunctionEaseOutSine(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = load double, double* %8
%12 = fdiv double %10, %11
%13 = load double, double* @M_PI_2
%14 = fmul double %12, %13
%15 = call double @sin(double %14)
%16 = load double, double* %6
%17 = call double @llvm.fmuladd.f64(double %9, double %15, double %16)
ret double %17
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @JHKeyframeAnimationFunctionEaseOutSine(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = load double, double* @M_PI_2
%7 = fmul double %5, %6
%8 = tail call double @sin(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double %8, double %1)
ret double %9
}
int test_imm_72uint8_reg(unsigned char val) {
  return ((val) & (0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_72uint8_reg>:
test   $0x72,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_72uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 114
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void null_function() {}


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

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

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

LLVM IR (-O2):
define void @null_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    die("malloc failed");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sortMonth();
int /*<<< orphan*/ sortYear();
int /*<<< orphan*/ sortday();
void sort() {
  sortday();
  sortMonth();
  sortYear();
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sortday@plt>
mov    $0x0,%al
call   1030 <sortMonth@plt>
mov    $0x0,%al
call   1040 <sortYear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rax
xor    %eax,%eax
call   1050 <sortday@plt>
xor    %eax,%eax
call   1030 <sortMonth@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sortYear@plt>

LLVM IR (-O0):
define void @sort() {
%1 = call i32 (...) @sortday()
%2 = call i32 (...) @sortMonth()
%3 = call i32 (...) @sortYear()
ret void
}

LLVM IR (-O2):
define void @sort() {
%1 = tail call i32 (...) @sortday()
%2 = tail call i32 (...) @sortMonth()
%3 = tail call i32 (...) @sortYear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float toobig = 3.4E38 * 100.0f;
  printf("%e\n", toobig);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x7FF0000000000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal32array_(char *x, unsigned int *n) { lookNarray(x, (*n * 32)); }


x86 assembly (clang, -O0):
<lookreal32array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x5,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookreal32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal32array_(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 = load i32, i32* %6
%8 = mul i32 %7, 32
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookreal32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t arch_accel(uint32_t accel) { return accel; }


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

x86 assembly (clang, -O2):
<arch_accel>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @arch_accel(i32 returned %0) {
ret i32 %0
}