xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long nibble_sort_word(unsigned long);
void nibble_sort_mike(unsigned long *buf) {
  unsigned long *b = buf;
  for (int i = 0; i < 1024; i++) {
    buf[i] = nibble_sort_word(b[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_mike>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1166 <nibble_sort_mike+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <nibble_sort_mike+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_mike>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_mike+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nibble_sort_mike(i64* %0) {
%2 = alloca i64*
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %2
%5 = load i64*, i64** %2
store i64* %5, i64** %3
store i32 0, i32* %4
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1024
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i64*, i64** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
%14 = load i64, i64* %13
%15 = call i64 @nibble_sort_word(i64 %14)
%16 = load i64*, i64** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i64, i64* %16, i64 %18
store i64 %15, i64* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nibble_sort_mike(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @nibble_sort_word(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
int fun1372() { return 1372; }


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

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

LLVM IR (-O0):
define i32 @fun1372() {
ret i32 1372
}

LLVM IR (-O2):
define i32 @fun1372() {
ret i32 1372
}
/* Variables and functions */
int /*<<< orphan*/ smatch(char *, char const *);
int equalstr(char *pattern, const char *str) { return !smatch(pattern, str); }


x86 assembly (clang, -O0):
<equalstr>:
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 <smatch@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalstr>:
push   %rax
call   1030 <smatch@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equalstr(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 @smatch(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equalstr(i8* %0, i8* %1) {
%3 = tail call i32 @smatch(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int myfnptr(int (*foobar)(void)) { return foobar(); }


x86 assembly (clang, -O0):
<myfnptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfnptr>:
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @myfnptr(i32 ()* nocapture %0) {
%2 = tail call i32 %0()
ret i32 %2
}
float InvSqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<InvSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvSqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @InvSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @InvSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void printBinary(unsigned int x) {
  for (int i = 8 * sizeof(x) - 1; i >= 0; i--)
    x &(1 << i) ? putchar('1') : putchar('0');
  printf("\n");
}


x86 assembly (clang, -O0):
<printBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     117d <printBinary+0x5d>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1165 <printBinary+0x45>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    116f <printBinary+0x4f>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <printBinary+0x12>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinary>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1f,%ebp
nopw   0x0(%rax,%rax,1)
bt     %ebp,%ebx
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jb     1120 <printBinary+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printBinary(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = shl i32 1, %9
%11 = and i32 %8, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @putchar(i8 signext 49)
br label %17
15: ; preds = %7
%16 = call i32 @putchar(i8 signext 48)
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
br label %19
19: ; preds = %17
%20 = load i32, i32* %3
%21 = add nsw i32 %20, -1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printBinary(i32 %0) {
br label %4
2: ; preds = %4
%3 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
4: ; preds = %1, %4
%5 = phi i32 [ 31, %1 ], [ %11, %4 ]
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8 48, i8 49
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nsw i32 %5, -1
%12 = icmp eq i32 %5, 0
br i1 %12, label %2, label %4
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgshr(void) { gen("sar\tax,cl"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"sar\09ax,cl\00"
define void @cgshr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"sar\09ax,cl\00"
define void @cgshr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void lose_func() {}


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

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

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

LLVM IR (-O2):
define void @lose_func() {
ret void
}
void outsw(unsigned short port, const void *addr, unsigned long count) {
  asm volatile("rep ; outs"
               "w"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int *px = NULL;
  int i = 0;
  ++i;
  ++i;
  printf("x=%d\n", *px);
  ++i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"x=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  int result = 0;
  for (;;) {
    scanf("%d", &n);
    if (n < 0) {
      break;
    }
    result += n;
  }
  printf("souwa=%d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1155 <main+0x35>
jmp    1163 <main+0x43>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
lea    0xece(%rip),%r14
lea    0xc(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
lea    (%rcx,%rbx,1),%eax
test   %ecx,%ecx
jns    1140 <main+0x20>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"souwa=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %8, %3 ]
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
%8 = add nsw i32 %6, %4
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void main() {
  int a = 200;
  int b = 300;
  float x[1000];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf30,%rsp
movl   $0xc8,-0x4(%rbp)
movl   $0x12c,-0x8(%rbp)
add    $0xf30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x float]
store i32 200, i32* %1
store i32 300, i32* %2
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int bigint_uint_gcd(unsigned int, unsigned int);
int bigint_int_gcd(int a, int b) {
  return bigint_uint_gcd(((a) < 0 ? -(unsigned int)(a) : (unsigned int)(a)),
                         ((b) < 0 ? -(unsigned int)(b) : (unsigned int)(b)));
}


x86 assembly (clang, -O0):
<bigint_int_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1135 <bigint_int_gcd+0x25>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <bigint_int_gcd+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1158 <bigint_int_gcd+0x48>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115e <bigint_int_gcd+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <bigint_uint_gcd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigint_int_gcd>:
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
mov    %esi,%eax
neg    %eax
cmovns %eax,%esi
jmp    1030 <bigint_uint_gcd@plt>

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

LLVM IR (-O2):
define i32 @bigint_int_gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 false)
%5 = tail call i32 @bigint_uint_gcd(i32 %3, i32 %4)
ret i32 %5
}
int comp(const void *a, const void *b) { return *(char *)b - *(char *)a; }


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

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

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_out(int, int, char *);
void clearLine(int x) { Lcd_out(x, 1, "                "); }


x86 assembly (clang, -O0):
<clearLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
lea    0xed6(%rip),%rdx
call   1030 <Lcd_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearLine>:
lea    0xee9(%rip),%rdx
mov    $0x1,%esi
jmp    1030 <Lcd_out@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c" \00"
define void @clearLine(i32 %0) {
%2 = tail call i32 @Lcd_out(i32 %0, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int is_one_two_or_three(int t) { return (t >= 1 && t <= 3) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_one_two_or_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_one_two_or_three+0x20>
cmpl   $0x3,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_one_two_or_three>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_one_two_or_three(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_one_two_or_three(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
int bar(int i) {
  int j = 2;
  asm("bar_label: .globl bar_label");
  return foo(i, j);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)

x86 assembly (clang, -O2):
<bar>:
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
tail call void asm sideeffect "bar_label: .globl bar_label", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, ...)*)(i32 %0, i32 2)
ret i32 %2
}
signed char can_decode_ot(const unsigned char object_type) {
  switch (object_type) {
  case 2:
    return 0;
  case 1:
    return 0;
  case 3:
    return -1;
  case 4:
    return 0;
  case 17:
    return 0;
  case 19:
    return 0;
  case 23:
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<can_decode_ot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x16,%eax
ja     1173 <can_decode_ot+0x73>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0xff,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0x0,-0x1(%rbp)
jmp    1177 <can_decode_ot+0x77>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_decode_ot>:
cmp    $0x17,%dil
ja     111a <can_decode_ot+0x1a>
mov    %edi,%eax
mov    $0x8a0016,%ecx
bt     %rax,%rcx
jae    1116 <can_decode_ot+0x16>
xor    %eax,%eax
ret
cmp    $0x3,%rax
mov    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @can_decode_ot(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %13 [
i32 2, label %6
i32 1, label %7
i32 3, label %8
i32 4, label %9
i32 17, label %10
i32 19, label %11
i32 23, label %12
]
6: ; preds = %1
store i8 0, i8* %2
br label %14
7: ; preds = %1
store i8 0, i8* %2
br label %14
8: ; preds = %1
store i8 -1, i8* %2
br label %14
9: ; preds = %1
store i8 0, i8* %2
br label %14
10: ; preds = %1
store i8 0, i8* %2
br label %14
11: ; preds = %1
store i8 0, i8* %2
br label %14
12: ; preds = %1
store i8 0, i8* %2
br label %14
13: ; preds = %1
store i8 -1, i8* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @can_decode_ot(i8 zeroext %0) {
switch i8 %0, label %3 [
i8 2, label %4
i8 1, label %4
i8 3, label %2
i8 4, label %4
i8 17, label %4
i8 19, label %4
i8 23, label %4
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3, %2
%5 = phi i8 [ -1, %3 ], [ -1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i8 %5
}
void foo14() {}


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

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

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

LLVM IR (-O2):
define void @foo14() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
void quicksort(int a[], int length) { qsort(a, 0, length - 1); }


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

x86 assembly (clang, -O2):
<quicksort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qsort@plt>

LLVM IR (-O0):
define void @quicksort(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 = sub nsw i32 %6, 1
%8 = call i32 @qsort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qsort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
struct _pthread_cleanup_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void _pthread_cleanup_push(struct _pthread_cleanup_buffer *__buffer,
                           void (*__routine)(void *), void *__arg) {
  assert(0);
}


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

x86 assembly (clang, -O2):
<_pthread_cleanup_push>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct._pthread_cleanup_buffer = type { i32 }
define void @_pthread_cleanup_push(%struct._pthread_cleanup_buffer* %0, void (i8*)* %1, i8* %2) {
%4 = alloca %struct._pthread_cleanup_buffer*
%5 = alloca void (i8*)*
%6 = alloca i8*
store %struct._pthread_cleanup_buffer* %0, %struct._pthread_cleanup_buffer** %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
%7 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
%struct._pthread_cleanup_buffer = type { i32 }
define void @_pthread_cleanup_push(%struct._pthread_cleanup_buffer* nocapture readnone %0, void (i8*)* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
char *realpathat2(int, char *, char const *, char *, struct stat *);
char *realpathat(int dirfd, char *dirfdpath, const char *name, char *resolved) {
  struct stat st;
  return realpathat2(dirfd, dirfdpath, name, resolved, &st);
}


x86 assembly (clang, -O0):
<realpathat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <realpathat2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realpathat>:
push   %rax
mov    %rsp,%r8
call   1030 <realpathat2@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i8* @realpathat(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.stat
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i8* @realpathat2(i32 %10, i8* %11, i8* %12, i8* %13, %struct.stat* %9)
ret i8* %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i8* @realpathat(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.stat
%6 = bitcast %struct.stat* %5 to i8*
%7 = call i8* @realpathat2(i32 %0, i8* %1, i8* %2, i8* %3, %struct.stat* %5)
ret i8* %7
}
/* Variables and functions */
#define EINVAL 128
int /*<<< orphan*/ printf(char *, char *);
void validaCondSignal(int e) {
  char *mensaje = "\n\t-Se produjo el error";
  switch (e) {
  case EINVAL:
    printf("%s EINVAL (The value specified by cond is invalid.) \n\n", mensaje);
    break;
  }
}


x86 assembly (clang, -O0):
<validaCondSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1149 <validaCondSignal+0x39>
jmp    1139 <validaCondSignal+0x29>
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validaCondSignal>:
cmp    $0x80,%edi
jne    112b <validaCondSignal+0x1b>
lea    0xef8(%rip),%rdi
lea    0xeda(%rip),%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [55 x i8] c"%s EINVAL (The value specified by cond is invalid.) \0A\0A\00"
define void @validaCondSignal(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 128, label %5
]
5: ; preds = %1
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %1, %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [55 x i8] c"%s EINVAL (The value specified by cond is invalid.) \0A\0A\00"
define void @validaCondSignal(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("USAGE: Not really usable yet\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"USAGE: Not really usable yet\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"USAGE: Not really usable yet\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int closeF(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @closeF(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shell_insert(int *, int, int);
void shell_sort(int *a, int a_len, int *d, int t) {
  int i = 0;
  for (i = 0; i < t; i++)
    shell_insert(a, a_len, d[i]);
}


x86 assembly (clang, -O0):
<shell_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1165 <shell_sort+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1030 <shell_insert@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1134 <shell_sort+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_sort>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
jle    1148 <shell_sort+0x38>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%r12
mov    %ecx,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %r15d,%esi
call   1030 <shell_insert@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <shell_sort+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @shell_sort(i32* %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %2, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @shell_insert(i32* %0, i32 %1, i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printValue(int v) { printf("Value: %d\n", v); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Value: %d\0A\00"
define void @printValue(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int LPCChannelValid(unsigned long);
void LPCChannelDisable(unsigned long ulBase, unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT(LPCChannelValid(ulChannel));
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~(1 << ulChannel);
}


x86 assembly (clang, -O0):
<LPCChannelDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
cltq
and    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCChannelDisable(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 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @LPCChannelValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = sext i32 %15 to i64
%17 = load i64, i64* %3
%18 = add i64 %17, 0
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, %16
store volatile i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @LPCChannelDisable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @LPCChannelValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = trunc i64 %1 to i32
%9 = shl nuw i32 1, %8
%10 = xor i32 %9, -1
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %0 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %11
store volatile i64 %14, i64* %12
ret void
}
void glBindRenderbuffer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBindRenderbuffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void mf_print_version() {
  printf("Version %s\n"
         "Compiled date: %s\n",
         "UNKNOWN", "Mar 15 2022");
}


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

x86 assembly (clang, -O2):
<mf_print_version>:
lea    0xee9(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    0xf01(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Version %s\0ACompiled date: %s\0A\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define void @mf_print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Version %s\0ACompiled date: %s\0A\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define void @mf_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double ModDiff(double f1, double f2) {
  double f3;
  f3 = f1 - f2;
  if (f3 > 3.14159265358979323846) {
    f3 -= 6.28318530717958647692;
  } else if (f3 <= -3.14159265358979323846) {
    f3 += 6.28318530717958647692;
  }
  return (f3);
}


x86 assembly (clang, -O0):
<ModDiff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114f <ModDiff+0x4f>
movsd  -0x18(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1179 <ModDiff+0x79>
movsd  0xeb1(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1174 <ModDiff+0x74>
movsd  0xea6(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1179 <ModDiff+0x79>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModDiff>:
subsd  %xmm1,%xmm0
ucomisd 0xef4(%rip),%xmm0
jbe    1117 <ModDiff+0x17>
addsd  0xf02(%rip),%xmm0
ret
movsd  0xee9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     112d <ModDiff+0x2d>
addsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ModDiff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp ogt double %9, 0x400921FB54442D18
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %5
%13 = fsub double %12, 0x401921FB54442D18
store double %13, double* %5
br label %21
14: ; preds = %2
%15 = load double, double* %5
%16 = fcmp ole double %15, 0xC00921FB54442D18
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load double, double* %5
%19 = fadd double %18, 0x401921FB54442D18
store double %19, double* %5
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20, %11
%22 = load double, double* %5
ret double %22
}

LLVM IR (-O2):
define double @ModDiff(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp ogt double %3, 0x400921FB54442D18
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = fadd double %3, 0xC01921FB54442D18
br label %11
7: ; preds = %2
%8 = fcmp ugt double %3, 0xC00921FB54442D18
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = fadd double %3, 0x401921FB54442D18
br label %11
11: ; preds = %7, %9, %5
%12 = phi double [ %6, %5 ], [ %10, %9 ], [ %3, %7 ]
ret double %12
}
void glVertexAttrib4f(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttrib4f() {
ret void
}
int lerp_integers(int a, int b, float t) { return (int)(a + (b - a) * t); }


x86 assembly (clang, -O0):
<lerp_integers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm1
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp_integers>:
cvtsi2ss %edi,%xmm1
sub    %edi,%esi
cvtsi2ss %esi,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm1,%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @lerp_integers(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = sitofp i32 %11 to float
%13 = load float, float* %6
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float %8)
%15 = fptosi float %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @lerp_integers(i32 %0, i32 %1, float %2) {
%4 = sitofp i32 %0 to float
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to float
%7 = tail call float @llvm.fmuladd.f32(float %6, float %2, float %4)
%8 = fptosi float %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
void warnings_after_loop() {
  int i;
  for (i = 0; i < 10; ++i) {
  }
  char *m = (char *)malloc(12);
}


x86 assembly (clang, -O0):
<warnings_after_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113c <warnings_after_loop+0x2c>
jmp    112e <warnings_after_loop+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <warnings_after_loop+0xf>
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warnings_after_loop>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @warnings_after_loop() {
%1 = tail call i64 @malloc(i32 12)
ret void
}
/* Variables and functions */
char *strncpy(char *, char *, int);
char *libc_strncpy(char *dest, char *src, int n) {
  return strncpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<libc_strncpy>:
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define i8* @libc_strncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
void av_buffer_default_free() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_default_free() {
ret void
}
double cos_integ1(const double x, const double sinx, const double cosx) {
  return x * sinx + cosx;
}


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

x86 assembly (clang, -O2):
<cos_integ1>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @cos_integ1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @cos_integ1(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ R_InitPlanarShadows();
int /*<<< orphan*/ R_InitShadowmaps();
void R_InitShadows(void) {
  R_InitPlanarShadows();
  R_InitShadowmaps();
}


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

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

LLVM IR (-O0):
define void @R_InitShadows() {
%1 = call i32 (...) @R_InitPlanarShadows()
%2 = call i32 (...) @R_InitShadowmaps()
ret void
}

LLVM IR (-O2):
define void @R_InitShadows() {
%1 = tail call i32 (...) @R_InitPlanarShadows()
%2 = tail call i32 (...) @R_InitShadowmaps()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\\\\\\\\c");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\\\\\\\\c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}