xunge/DecIR huggingface dataset:
float m_map(float sa, float sb, float da, float db, float value) {
  float res;
  res = ((db - da) * value) / (sb - sa) + da - ((db - da) * sa) / (sb - sa);
  return res;
}


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

x86 assembly (clang, -O2):
<m_map>:
subss  %xmm2,%xmm3
subss  %xmm0,%xmm1
shufps $0x0,%xmm3,%xmm3
unpcklps %xmm0,%xmm4
mulps  %xmm3,%xmm4
shufps $0x0,%xmm1,%xmm1
divps  %xmm1,%xmm4
addss  %xmm4,%xmm2
shufps $0x55,%xmm4,%xmm4
subss  %xmm4,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @m_map(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %9
%13 = load float, float* %8
%14 = fsub float %12, %13
%15 = load float, float* %10
%16 = fmul float %14, %15
%17 = load float, float* %7
%18 = load float, float* %6
%19 = fsub float %17, %18
%20 = fdiv float %16, %19
%21 = load float, float* %8
%22 = fadd float %20, %21
%23 = load float, float* %9
%24 = load float, float* %8
%25 = fsub float %23, %24
%26 = load float, float* %6
%27 = fmul float %25, %26
%28 = load float, float* %7
%29 = load float, float* %6
%30 = fsub float %28, %29
%31 = fdiv float %27, %30
%32 = fsub float %22, %31
store float %32, float* %11
%33 = load float, float* %11
ret float %33
}

LLVM IR (-O2):
define float @m_map(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %3, %2
%7 = fsub float %1, %0
%8 = insertelement <2 x float> poison, float %6, i64 0
%9 = shufflevector <2 x float> %8, <2 x float> poison, <2 x i32> zeroinitializer
%10 = insertelement <2 x float> poison, float %4, i64 0
%11 = insertelement <2 x float> %10, float %0, i64 1
%12 = fmul <2 x float> %9, %11
%13 = insertelement <2 x float> poison, float %7, i64 0
%14 = shufflevector <2 x float> %13, <2 x float> poison, <2 x i32> zeroinitializer
%15 = fdiv <2 x float> %12, %14
%16 = extractelement <2 x float> %15, i64 0
%17 = fadd float %16, %2
%18 = extractelement <2 x float> %15, i64 1
%19 = fsub float %17, %18
ret float %19
}
/* Variables and functions */
int /*<<< orphan*/ dummy(int);
int /*<<< orphan*/ runGame();
int /*<<< orphan*/ setup_sound();
int kernel_main(void) {
  setup_sound();
  runGame();
  while (1) {
    dummy(1);
  }
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <setup_sound@plt>
mov    $0x0,%al
call   1050 <runGame@plt>
mov    $0x1,%edi
call   1030 <dummy@plt>
jmp    1142 <kernel_main+0x12>

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <setup_sound@plt>
xor    %eax,%eax
call   1050 <runGame@plt>
nop
mov    $0x1,%edi
call   1030 <dummy@plt>
jmp    1140 <kernel_main+0x10>

LLVM IR (-O0):
define i32 @kernel_main() {
%1 = call i32 (...) @setup_sound()
%2 = call i32 (...) @runGame()
br label %3
3: ; preds = %0, %3
%4 = call i32 @dummy(i32 1)
br label %3
}

LLVM IR (-O2):
define i32 @kernel_main() {
%1 = tail call i32 (...) @setup_sound()
%2 = tail call i32 (...) @runGame()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @dummy(i32 1)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void screen_end(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @screen_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
char *strcpy(char *s1, char *s2) {
  int i;
  for (i = 0; s2[i] != '\0'; i++)
    s1[i] = s2[i];
  s1[i] = '\0';
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
int calculoSegundoGrau(float a, float b, float c, float *d, float *x1,
                       float *x2) {}


x86 assembly (clang, -O0):
<calculoSegundoGrau>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @calculoSegundoGrau(float %0, float %1, float %2, float* %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @calculoSegundoGrau(float %0, float %1, float %2, float* nocapture readnone %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int sum(int, int, int, int /*<<< orphan*/);
main() { return sum(1, 2, 3, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1030 <sum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
jmp    1030 <sum@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2, i32 3, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int volatile uint32_t;

/* Variables and functions */
uint32_t async_poll_key(uint32_t key) {
  return ~((*(volatile uint32_t *)0x4000130)) & key;
}


x86 assembly (clang, -O0):
<async_poll_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x4000130,%eax
mov    (%rax),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<async_poll_key>:
mov    %edi,-0x4(%rsp)
mov    0x4000130,%eax
not    %eax
and    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @async_poll_key(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 67109168 to i32*)
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* %2
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @async_poll_key(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 67109168 to i32*)
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* %2
%6 = and i32 %5, %4
ret i32 %6
}
void endianSwapInt32(unsigned long i, char *out) {
  unsigned char *ia = (unsigned char *)&i;
  out[0] = ia[3];
  out[1] = ia[2];
  out[2] = ia[1];
  out[3] = ia[0];
}


x86 assembly (clang, -O0):
<endianSwapInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<endianSwapInt32>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @endianSwapInt32(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = bitcast i64* %3 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @endianSwapInt32(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %0, 16
%7 = trunc i64 %6 to i8
%8 = lshr i64 %0, 24
%9 = trunc i64 %8 to i8
store i8 %9, i8* %1
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %5, i8* %11
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %12
ret void
}
/* Variables and functions */
int check(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", check(123, 3421)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
mov    $0xd5d,%esi
call   1040 <check@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
mov    $0xd5d,%esi
call   1040 <check@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = call i32 @check(i32 123, i32 3421)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @check(i32 123, i32 3421)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void L2_cache_set_mode(unsigned int mode) {
  unsigned int ccfg = *((volatile unsigned int *)(0x01840000));
  ccfg &= ~7;
  ccfg |= (mode & 7);
  do {
    *((volatile unsigned int *)(0x01840000)) = (ccfg);
    (ccfg) = *((volatile unsigned int *)(0x01840000));
  } while (0);
  ccfg = *((volatile unsigned int *)(0x01840000));
  ;
}


x86 assembly (clang, -O0):
<L2_cache_set_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1840000,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffff8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1840000,%eax
mov    %ecx,(%rax)
mov    $0x1840000,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1840000,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<L2_cache_set_mode>:
mov    0x1840000,%eax
and    $0xfffffff8,%eax
and    $0x7,%edi
or     %eax,%edi
mov    %edi,0x1840000
mov    0x1840000,%eax
mov    0x1840000,%eax
ret

LLVM IR (-O0):
define void @L2_cache_set_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -8
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 7
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %1
%12 = load i32, i32* %3
store volatile i32 %12, i32* inttoptr (i64 25427968 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
store i32 %13, i32* %3
br label %14
14: ; preds = %11
%15 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
store i32 %15, i32* %3
ret void
}

LLVM IR (-O2):
define void @L2_cache_set_mode(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
%3 = and i32 %2, -8
%4 = and i32 %0, 7
%5 = or i32 %3, %4
store volatile i32 %5, i32* inttoptr (i64 25427968 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 25427968 to i32*)
ret void
}
int g_DUMMY_popup_container_show(int cont_id) {
  cont_id = cont_id;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_popup_container_show(i32 %0) {
ret i32 0
}
void gdk_x11_atom_to_xatom_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_atom_to_xatom_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asm_gototxtmode();
void gototxtmode() { asm_gototxtmode(); }


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

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

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

LLVM IR (-O2):
define void @gototxtmode() {
%1 = tail call i32 (...) @asm_gototxtmode()
ret void
}
unsigned char xtime(unsigned char a) {
  unsigned char b;
  if (a & 0x80)
    b = 0x1B;
  else
    b = 0;
  a <<= 1;
  a ^= b;
  return a;
}


x86 assembly (clang, -O0):
<xtime>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1125 <xtime+0x25>
movb   $0x1b,-0x2(%rbp)
jmp    1129 <xtime+0x29>
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%ecx
movzbl -0x1(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtime>:
lea    (%rdi,%rdi,1),%eax
mov    %edi,%ecx
sar    $0x7,%cl
and    $0x1b,%cl
xor    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @xtime(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 27, i8* %3
br label %10
9: ; preds = %1
store i8 0, i8* %3
br label %10
10: ; preds = %9, %8
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = xor i32 %18, %16
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @xtime(i8 zeroext %0) {
%2 = icmp slt i8 %0, 0
%3 = select i1 %2, i8 27, i8 0
%4 = shl i8 %0, 1
%5 = xor i8 %3, %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_truncl();
scalar_t__ truncl(long double);
void test_truncl(long double ld) {
  if (truncl(ld) != truncl(ld))
    link_failure_truncl();
}


x86 assembly (clang, -O0):
<test_truncl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <truncl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <truncl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_truncl+0x43>
mov    $0x0,%al
call   1030 <link_failure_truncl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_truncl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <truncl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <truncl@plt>
cmp    %rax,%rbx
jne    1151 <test_truncl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_truncl@plt>

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

LLVM IR (-O2):
define void @test_truncl(x86_fp80 %0) {
%2 = tail call i64 @truncl(x86_fp80 %0)
%3 = tail call i64 @truncl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_truncl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xd3() {
  Assert_real((isspace(211) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1060, ("isspace should be 0 for 0xd3"));
}


x86 assembly (clang, -O0):
<t_isspace_0xd3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd3,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x424,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd3\00"
define void @t_isspace_0xd3() {
%1 = call i64 @isspace(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd3\00"
define void @t_isspace_0xd3() {
%1 = tail call i64 @isspace(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int pci_enable_device(struct pci_dev *dev) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_enable_device(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
%3 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_enable_device(%struct.pci_dev* nocapture readnone %0) {
ret i32 undef
}
int one_way(int a, int b, int c) { return a * (b + c); }


x86 assembly (clang, -O0):
<one_way>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_way>:
lea    (%rsi,%rdx,1),%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @one_way(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 = add nsw i32 %8, %9
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @one_way(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = mul nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ bioskey(int /*<<< orphan*/);
int vgetc() { return ((char)bioskey(0)); }


x86 assembly (clang, -O0):
<vgetc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <bioskey@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vgetc>:
push   %rax
xor    %edi,%edi
call   1030 <bioskey@plt>
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vgetc() {
%1 = call i64 @bioskey(i32 0)
%2 = trunc i64 %1 to i8
%3 = sext i8 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @vgetc() {
%1 = tail call i64 @bioskey(i32 0)
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 24
%4 = ashr exact i32 %3, 24
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void writeLeftTower(int n, int max) {
  if (n == max) {
    return;
  } else {
    writeLeftTower(n + 1, max);
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<writeLeftTower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113f <writeLeftTower+0x1f>
jmp    1159 <writeLeftTower+0x39>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <writeLeftTower@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLeftTower>:
cmp    %esi,%edi
jne    1125 <writeLeftTower+0x5>
ret
push   %rax
add    $0x1,%edi
call   1040 <writeLeftTower@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @writeLeftTower(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %8, %9
ret void
}

LLVM IR (-O2):
define void @writeLeftTower(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %0, 1
tail call void @writeLeftTower(i32 %6, i32 %1)
%7 = tail call i32 @putchar(i32 32)
br label %4
}
int getrow(int i, int rows) { return i - (i / rows) * rows; }


x86 assembly (clang, -O0):
<getrow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrow>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @getrow(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* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getrow(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          void *(*)(void *), void *);
pthread_t pthread_start(void *(*fn)(void *), uintptr_t arg) {
  pthread_t th;
  assert(pthread_create(&th, 0, fn, (void *)arg) == 0);
  return th;
}


x86 assembly (clang, -O0):
<pthread_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
call   1040 <pthread_create@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_start>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1040 <pthread_create@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pthread_start(i8* (i8*)* %0, i64 %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i64
%5 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %3
store i64 %1, i64* %4
%6 = load i8* (i8*)*, i8* (i8*)** %3
%7 = load i64, i64* %4
%8 = inttoptr i64 %7 to i8*
%9 = call i64 @pthread_create(i32* %5, i32 0, i8* (i8*)* %6, i8* %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @pthread_start(i8* (i8*)* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = inttoptr i64 %1 to i8*
%6 = call i64 @pthread_create(i32* %3, i32 0, i8* (i8*)* %0, i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int elibPause(void) {
  printf("\nPress Any Key To Continue\n");
  char ak00 = '0';
  ak00 = '0';
  while (ak00 == '0') {
    scanf("%c", &ak00);
  }
}


x86 assembly (clang, -O0):
<elibPause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movb   $0x30,-0x5(%rbp)
movb   $0x30,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    115e <elibPause+0x3e>
lea    0xecc(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
jmp    113c <elibPause+0x1c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elibPause>:
push   %r14
push   %rbx
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
movb   $0x30,0x7(%rsp)
lea    0xec4(%rip),%r14
lea    0x7(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpb   $0x30,0x7(%rsp)
je     1150 <elibPause+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0APress Any Key To Continue\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @elibPause() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8 48, i8* %2
store i8 48, i8* %2
br label %4
4: ; preds = %8, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 48
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %4
10: ; preds = %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [27 x i8] c"\0APress Any Key To Continue\00"
define i32 @elibPause() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
store i8 48, i8* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 48
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 undef
}
void I422AlphaToARGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422AlphaToARGBRow_Any_SSSE3() {
ret void
}
unsigned int call_load(unsigned int descriptor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_load(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int main() {
  int array[] = {2, 3, 5, 22, 1, 15, 4};
  int arrayLen = sizeof(array) / sizeof(array[0]);
  printArray(array, arrayLen);
  quickSort(array, 0, arrayLen - 1);
  printArray(array, arrayLen);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quickSort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printArray@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <quickSort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 2, i32 3, i32 5, i32 22, i32 1, i32 15, i32 4]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = bitcast [7 x i32]* %1 to i8*
store i32 7, i32* %2
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @printArray(i32* %4, i32 %5)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @quickSort(i32* %7, i32 0, i32 %9)
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%12 = load i32, i32* %2
%13 = call i32 @printArray(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 2, i32 3, i32 5, i32 22, i32 1, i32 15, i32 4]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 7)
%5 = call i32 @quickSort(i32* %3, i32 0, i32 6)
%6 = call i32 @printArray(i32* %3, i32 7)
ret i32 0
}
int sdcard_readsect(int lba, char *buf) {}


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

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

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

LLVM IR (-O2):
define i32 @sdcard_readsect(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
double sqrt(double const);
double length(const double *v) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


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

x86 assembly (clang, -O2):
<length>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <length+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @length(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ lsd_process();
void mw_process(void) { lsd_process(); }


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

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

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

LLVM IR (-O2):
define void @mw_process() {
%1 = tail call i32 (...) @lsd_process()
ret void
}
double fgrteq(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<fgrteq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgrteq>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fgrteq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @fgrteq(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
char *langRomTypeSvi328RsIde() { return "SVI-328 RS IDE"; }


x86 assembly (clang, -O0):
<langRomTypeSvi328RsIde>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeSvi328RsIde>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"SVI-328 RS IDE\00"
define i8* @langRomTypeSvi328RsIde() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"SVI-328 RS IDE\00"
define i8* @langRomTypeSvi328RsIde() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
const char *SkipSpacesTabs(const char *const start) {
  const char *p;
  for (p = start; *p == ' ' || *p == '\t'; ++p)
    ;
  return p;
}


x86 assembly (clang, -O0):
<SkipSpacesTabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1135 <SkipSpacesTabs+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <SkipSpacesTabs+0x45>
jmp    115b <SkipSpacesTabs+0x5b>
jmp    114a <SkipSpacesTabs+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <SkipSpacesTabs+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipSpacesTabs>:
mov    %rdi,%rax
jmp    1114 <SkipSpacesTabs+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <SkipSpacesTabs+0x10>
cmp    $0x9,%cl
je     1110 <SkipSpacesTabs+0x10>
ret

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

LLVM IR (-O2):
define i8* @SkipSpacesTabs(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *argv0) {
  fprintf(stderr, "Usage: %s [-s] <interface to echo> <...>\n", argv0);
  fprintf(stderr, "  -s option makes this program work as a sink\n");
  exit(2);
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s [-s] <interface to echo> <...>\0A\00"
@.str.1 = [47 x i8] c" -s option makes this program work as a sink\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s [-s] <interface to echo> <...>\0A\00"
@.str.1 = [47 x i8] c" -s option makes this program work as a sink\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *g_DUMMY_cons_fgets(char *string, int maxchar, FILE *file) {
  string = string;
  maxchar = maxchar;
  file = file;
  return NULL;
}


x86 assembly (clang, -O0):
<g_DUMMY_cons_fgets>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @g_DUMMY_cons_fgets(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int stricmp(const char *a, const char *b) { return strcasecmp(a, b); }


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

x86 assembly (clang, -O2):
<stricmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *, double *);
double scan_data(char *operator, double * operand) {
  scanf(" %c %lf", operator, operand);
}


x86 assembly (clang, -O0):
<scan_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_data>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c" %c %lf\00"
define double @scan_data(i8* %0, double* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, double* %1)
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ingresarCantBotellas() {
  int cantBotellas;
  printf(" \nIngrese la cantidad de botellas  \n");
  scanf("%d", &cantBotellas);
  return cantBotellas;
}


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

x86 assembly (clang, -O2):
<ingresarCantBotellas>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c" \0AIngrese la cantidad de botellas \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ingresarCantBotellas() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c" \0AIngrese la cantidad de botellas \00"
define i32 @ingresarCantBotellas() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}