xunge/DecIR huggingface dataset:
int test_imm_6Bint16_reg(short val) {
  return ((val) & (-0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -107
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "Hello World!\n", 13);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
void bset(unsigned int nr, unsigned long *addr) {
  asm volatile("lock bts %1, %0"
               : "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
}


x86 assembly (clang, -O0):
<bset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock bts %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bset>:
lock bts %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @bset(i32 %0, i64* %1) {
tail call void asm sideeffect "lock bts $1, $0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
const char *get_if_device(void *sel) { return "eth0"; }


x86 assembly (clang, -O0):
<get_if_device>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"eth0\00"
define i8* @get_if_device(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"eth0\00"
define i8* @get_if_device(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int mapif_parse_PartyCheck(int fd, int party_id, int account_id, int char_id) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @mapif_parse_PartyCheck(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_parse_PartyCheck(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int *array, int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xnoexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xnoexpose_send_event(void *_p) {
  return (int)((XEvent *)_p)->xnoexpose.send_event;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xnoexpose_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xnoexpose_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xnoexpose_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
float voltConvert(unsigned char reading, float range) {
  return ((2.0 + (((float)(reading * 3)) / 255.0)) * (range / 5.0));
}


x86 assembly (clang, -O0):
<voltConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movss  %xmm0,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x3,%eax,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeea(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb9(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltConvert>:
lea    (%rdi,%rdi,2),%eax
cvtsi2ss %eax,%xmm1
unpcklps %xmm1,%xmm0
cvtps2pd %xmm0,%xmm0
divpd  0xeeb(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  0xeeb(%rip),%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @voltConvert(i8 zeroext %0, float %1) {
%3 = alloca i8
%4 = alloca float
store i8 %0, i8* %3
store float %1, float* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 3
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = fdiv double %9, 2.550000e+02
%11 = fadd double 2.000000e+00, %10
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fdiv double %13, 5.000000e+00
%15 = fmul double %11, %14
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @voltConvert(i8 zeroext %0, float %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 3
%5 = sitofp i32 %4 to float
%6 = insertelement <2 x float> poison, float %1, i64 0
%7 = insertelement <2 x float> %6, float %5, i64 1
%8 = fpext <2 x float> %7 to <2 x double>
%9 = fdiv <2 x double> %8, <double 5.000000e+00, double 2.550000e+02>
%10 = extractelement <2 x double> %9, i64 1
%11 = fadd double %10, 2.000000e+00
%12 = extractelement <2 x double> %9, i64 0
%13 = fmul double %12, %11
%14 = fptrunc double %13 to float
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_status_254(int *A, int *B, int *C) {
  int len_a, len_b, len_c;
  len_a = A[0];
  len_b = B[0];
  len_c = C[0];
  printf("%d %d %d\n", len_a, len_b, len_c);
}


x86 assembly (clang, -O0):
<print_status_254>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status_254>:
mov    (%rdi),%eax
mov    (%rsi),%r8d
mov    (%rdx),%ecx
lea    0xee2(%rip),%rdi
mov    %eax,%esi
mov    %r8d,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @print_status_254(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
store i32 %18, i32* %9
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @print_status_254(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
ret void
}
/* Type definitions */
typedef int uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ arr_malloc_size(int, int);
int /*<<< orphan*/ assert(int);
char *malloc_or_die(int /*<<< orphan*/);
char *int_as_dec_digit(const uintmax_t i) {
  assert(i < 10);
  char *const c = malloc_or_die(arr_malloc_size((2), sizeof(char)));
  c[0] = i + '0';
  c[1] = 0;
  return c;
}


x86 assembly (clang, -O0):
<int_as_dec_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1050 <malloc_or_die@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_as_dec_digit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xa,%ebx
setl   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1050 <malloc_or_die@plt>
add    $0x30,%bl
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @int_as_dec_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @arr_malloc_size(i32 2, i32 1)
%9 = call i8* @malloc_or_die(i32 %8)
store i8* %9, i8** %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @int_as_dec_digit(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @arr_malloc_size(i32 2, i32 1)
%6 = tail call i8* @malloc_or_die(i32 %5)
%7 = trunc i32 %0 to i8
%8 = add i8 %7, 48
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %9
ret i8* %6
}
int _toupper(int c) { return (c - 'a' + 'A'); }


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

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

LLVM IR (-O0):
define i32 @_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 97
%5 = add nsw i32 %4, 65
ret i32 %5
}

LLVM IR (-O2):
define i32 @_toupper(i32 %0) {
%2 = add nsw i32 %0, -32
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Simple differential equations!");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Simple differential equations!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [31 x i8] c"Simple differential equations!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fld_preg64_dword(int reg64) {
  put8(0xD9);
  put8(reg64);
}


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

x86 assembly (clang, -O2):
<fld_preg64_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

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

LLVM IR (-O2):
define void @fld_preg64_dword(i32 %0) {
%2 = tail call i32 @put8(i32 217)
%3 = tail call i32 @put8(i32 %0)
ret void
}
int recurse_countdown(int i) {
  if (i == 0)
    return 1;
  int ret = recurse_countdown(i - 1);
  return ret + 1;
}


x86 assembly (clang, -O0):
<recurse_countdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <recurse_countdown+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1148 <recurse_countdown+0x38>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <recurse_countdown@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @recurse_countdown(i32 %0) {
%2 = add i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *ultoa(unsigned long, char *, int /*<<< orphan*/);
char *ustoa(unsigned short a, char *buffer, uint8_t radix) {
  return ultoa((unsigned long)a, buffer, radix);
}


x86 assembly (clang, -O0):
<ustoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustoa>:
mov    %edi,%edi
jmp    1030 <ultoa@plt>

LLVM IR (-O0):
define i8* @ustoa(i16 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i16, i16* %4
%8 = zext i16 %7 to i64
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @ultoa(i64 %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @ustoa(i16 zeroext %0, i8* %1, i32 %2) {
%4 = zext i16 %0 to i64
%5 = tail call i8* @ultoa(i64 %4, i8* %1, i32 %2)
ret i8* %5
}
puts(str) register char *str;
{
  while (*str)
    if (putchar(*str++) == -1)
      return -1;
  return putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <puts+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
cmp    $0xffffffff,%eax
jne    1157 <puts+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <puts+0x5b>
jmp    111c <puts+0xc>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     113e <puts+0x2e>
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <putchar@plt>
cmp    $0xffffffff,%eax
jne    1120 <puts+0x10>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 -1, i32* %2
br label %19
16: ; preds = %8
br label %4
17: ; preds = %4
%18 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %2
11: ; preds = %2
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
br label %13
13: ; preds = %6, %11
%14 = phi i32 [ %12, %11 ], [ -1, %6 ]
ret i32 %14
}
/* Type definitions */
struct ipv6hdr {
  int dummy;
};
typedef int __u8;
typedef int /*<<< orphan*/ __be16;

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
__u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h) {
  return ntohs(*(__be16 *)ipv6h) >> 4;
}


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

x86 assembly (clang, -O2):
<ipv6_get_dsfield>:
push   %rax
mov    (%rdi),%edi
call   1030 <ntohs@plt>
sar    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ipv6hdr = type { i32 }
define i32 @ipv6_get_dsfield(%struct.ipv6hdr* %0) {
%2 = alloca %struct.ipv6hdr*
store %struct.ipv6hdr* %0, %struct.ipv6hdr** %2
%3 = load %struct.ipv6hdr*, %struct.ipv6hdr** %2
%4 = bitcast %struct.ipv6hdr* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
%7 = ashr i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
%struct.ipv6hdr = type { i32 }
define i32 @ipv6_get_dsfield(%struct.ipv6hdr* nocapture %0) {
%2 = getelementptr %struct.ipv6hdr, %struct.ipv6hdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
%5 = ashr i32 %4, 4
ret i32 %5
}
int ld_bge_rc1(long double a1) { return (__builtin_isgreaterequal(a1, 100)); }


x86 assembly (clang, -O0):
<ld_bge_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bge_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_bge_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oge x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_bge_rc1(x86_fp80 %0) {
%2 = fcmp oge x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail(char const *, int, char *, int, int);
void assert_int_equal_(const char *file, int line, int ex, int ac) {
  if (ex != ac) {
    assert_fail(file, line, "Expected <%d> but was <%d>", ex, ac);
  }
}


x86 assembly (clang, -O0):
<assert_int_equal_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     114b <assert_int_equal_+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xeba(%rip),%rdx
call   1030 <assert_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_int_equal_>:
mov    %ecx,%r8d
cmp    %ecx,%edx
jne    1118 <assert_int_equal_+0x8>
ret
mov    %edx,%ecx
lea    0xedf(%rip),%rdx
jmp    1030 <assert_fail@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"Expected <%d> but was <%d>\00"
define void @assert_int_equal_(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @assert_fail(i8* %0, i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
br label %8
8: ; preds = %6, %4
ret void
}
int main() {
  int a;
  int b;
  int c;
  if (a || (b + a)) {
    c = -a;
  } else {
    b = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <main+0x24>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1131 <main+0x31>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x38>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gdb_kill(void) {}


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

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

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

LLVM IR (-O2):
define void @gdb_kill() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int local_read_meminfo(char *);
int /*<<< orphan*/ printf(char *, int);
void local_check_free_huge_pages(int needed_pages) {
  int free = local_read_meminfo("HugePages_Free:");
  if (free < needed_pages)
    do {
      cleanup();
      printf("Bad configuration: "
             "Must have at least %i free hugepages"
             "\n",
             needed_pages);
      exit(1);
    } while (0);
}


x86 assembly (clang, -O0):
<local_check_free_huge_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <local_read_meminfo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118b <local_check_free_huge_pages+0x4b>
jmp    116b <local_check_free_huge_pages+0x2b>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_check_free_huge_pages>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1030 <local_read_meminfo@plt>
cmp    %ebx,%eax
jl     1155 <local_check_free_huge_pages+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1050 <cleanup@plt>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"HugePages_Free:\00"
@.str.1 = [57 x i8] c"Bad configuration: Must have at least %i free hugepages\0A\00"
define void @local_check_free_huge_pages(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @local_read_meminfo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = call i32 (...) @cleanup()
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"HugePages_Free:\00"
@.str.1 = [57 x i8] c"Bad configuration: Must have at least %i free hugepages\0A\00"
define void @local_check_free_huge_pages(i32 %0) {
%2 = tail call i32 @local_read_meminfo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @cleanup()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
float fazMedia(float n1, float n2) { return (n1 + n2) / 2; }


x86 assembly (clang, -O0):
<fazMedia>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fazMedia>:
addss  %xmm1,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fazMedia(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fdiv float %7, 2.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @fazMedia(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fmul float %3, 5.000000e-01
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 0xdeadbee;
  int b = 0;
  int c = 1;
  while (c) {
    if (b == 0)
      goto L;
    test_assert(a == 1);
    if (a == 1) {
      c = 0;
    L:
      a = 1;
      b = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xdeadbee,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1182 <main+0x72>
cmpl   $0x0,-0xc(%rbp)
jne    114d <main+0x3d>
jmp    116f <main+0x5f>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
cmpl   $0x1,-0x8(%rbp)
jne    117d <main+0x6d>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 233495534, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %20
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @test_assert(i32 %15)
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %12
store i32 0, i32* %4
br label %20
20: ; preds = %19, %11
store i32 1, i32* %2
store i32 1, i32* %3
br label %21
21: ; preds = %20, %12
br label %5
22: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void CheckChr(struct connection *c, int Chr) {
  if (Chr < 32 && Chr != 9 && Chr != 10) {
  } else {
    fprintf(stdout, "%c", Chr);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<CheckChr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1152 <CheckChr+0x32>
cmpl   $0x9,-0xc(%rbp)
je     1152 <CheckChr+0x32>
cmpl   $0xa,-0xc(%rbp)
je     1152 <CheckChr+0x32>
jmp    1178 <CheckChr+0x58>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckChr>:
mov    %esi,%edx
cmp    $0x1f,%esi
jg     1130 <CheckChr+0x10>
lea    -0xb(%rdx),%eax
cmp    $0xfffffffe,%eax
jae    1130 <CheckChr+0x10>
ret
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.connection = type { i32 }
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @CheckChr(%struct.connection* %0, i32 %1) {
%3 = alloca %struct.connection*
%4 = alloca i32
store %struct.connection* %0, %struct.connection** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 9
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %10
br label %20
14: ; preds = %10, %7, %2
%15 = load i32, i32* @stdout
%16 = load i32, i32* %4
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
br label %20
20: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define void @CheckChr(%struct.connection* nocapture readnone %0, i32 %1) {
%3 = icmp slt i32 %1, 32
%4 = add i32 %1, -11
%5 = icmp ult i32 %4, -2
%6 = and i1 %3, %5
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
br label %12
12: ; preds = %2, %7
ret void
}
/* Variables and functions */
size_t inc(void **mem) {
  size_t *cnt = (size_t *)((*mem) - sizeof(size_t));
  return ++(*cnt);
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
add    $0x1,%rax
mov    %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
mov    (%rdi),%rcx
mov    -0x8(%rcx),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rcx)
ret

LLVM IR (-O0):
define i64 @inc(i8** %0) {
%2 = alloca i8**
%3 = alloca i64*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr i8, i8* %5, i64 -8
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %3
%8 = load i64*, i64** %3
%9 = load i64, i64* %8
%10 = add i64 %9, 1
store i64 %10, i64* %8
ret i64 %10
}

LLVM IR (-O2):
define i64 @inc(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 -8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = add i64 %5, 1
store i64 %6, i64* %4
ret i64 %6
}
main() { return ((~(unsigned)0) >> 1) == -1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dumb_memfile_close(void *f) { free(f); }


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

x86 assembly (clang, -O2):
<dumb_memfile_close>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dumb_memfile_close(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double round_zero(double, double);
double rs_rainflow_round_zero(double x, double scale) {
  return (x == 0.0 ? 0.0 : round_zero(x, scale));
}


x86 assembly (clang, -O0):
<rs_rainflow_round_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <rs_rainflow_round_zero+0x37>
jp     1147 <rs_rainflow_round_zero+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115b <rs_rainflow_round_zero+0x4b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <round_zero@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_rainflow_round_zero>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1121 <rs_rainflow_round_zero+0x11>
jp     1121 <rs_rainflow_round_zero+0x11>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <round_zero@plt>

LLVM IR (-O0):
define double @rs_rainflow_round_zero(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 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @round_zero(double %9, double %10)
br label %12
12: ; preds = %8, %7
%13 = phi double [ 0.000000e+00, %7 ], [ %11, %8 ]
ret double %13
}

LLVM IR (-O2):
define double @rs_rainflow_round_zero(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call double @round_zero(double %0, double %1)
br label %6
6: ; preds = %2, %4
%7 = phi double [ %5, %4 ], [ 0.000000e+00, %2 ]
ret double %7
}
void __gps_ensure_valid_output(void) {}


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

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

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

LLVM IR (-O2):
define void @__gps_ensure_valid_output() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(char *);
char *line_reading(int);
char *longest_word(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Enter text\n");
  char *line = line_reading(100);
  char *longestWord = longest_word(line);
  printf("Longest word -> %s", longestWord);
  free(line);
  free(longestWord);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x64,%edi
call   1060 <line_reading@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <longest_word@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1070 <line_reading@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1060 <longest_word@plt>
mov    %rax,%rbx
lea    0xe81(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Enter text\0A\00"
@.str.1 = [19 x i8] c"Longest word -> %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i8* @line_reading(i32 100)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @longest_word(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Longest word -> %s\00"
@EXIT_SUCCESS = global i32 0
@str = [11 x i8] c"Enter text\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* @line_reading(i32 100)
%3 = tail call i8* @longest_word(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @free(i8* %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void g_type_name_from_class() {}


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

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

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

LLVM IR (-O2):
define void @g_type_name_from_class() {
ret void
}
/* Variables and functions */
double pow(double, double);
double lab_g_inverse(double v) {
  if (v >= (6.0 * 6.0 * 6.0) / (29 * 29 * 29))
    return pow(v, 1.0 / 3);
  else
    return (v * (841.0 / 108) + 4.0 / 29);
}


x86 assembly (clang, -O0):
<lab_g_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1150 <lab_g_inverse+0x40>
movsd  -0x10(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <lab_g_inverse+0x62>
movsd  -0x10(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lab_g_inverse>:
ucomisd 0xee8(%rip),%xmm0
jae    112b <lab_g_inverse+0x1b>
mulsd  0xeee(%rip),%xmm0
addsd  0xeee(%rip),%xmm0
ret
movsd  0xed5(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @lab_g_inverse(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0x3F822354D28F7CD6
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double 0x3FD5555555555555)
store double %8, double* %2
br label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %10, double 0x401F25ED097B425F, double 0x3FC1A7B9611A7B96)
store double %11, double* %2
br label %12
12: ; preds = %9, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @lab_g_inverse(double %0) {
%2 = fcmp ult double %0, 0x3F822354D28F7CD6
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 0x3FD5555555555555)
br label %7
5: ; preds = %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double 0x401F25ED097B425F, double 0x3FC1A7B9611A7B96)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
void *mz_ext_alloc(size_t);
void *def_alloc_func(void *opaque, size_t items, size_t size) {
  (void)opaque, (void)items, (void)size;
  return mz_ext_alloc(items * size);
}


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

x86 assembly (clang, -O2):
<def_alloc_func>:
mov    %rsi,%rdi
imul   %rdx,%rdi
jmp    1030 <mz_ext_alloc@plt>

LLVM IR (-O0):
define i8* @def_alloc_func(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = call i8* @mz_ext_alloc(i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @def_alloc_func(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @mz_ext_alloc(i64 %4)
ret i8* %5
}
char *procprt_EGID_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-       ";
}


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

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_EGID_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_EGID_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int _end(int board_size) { return board_size; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ spin_init(int /*<<< orphan*/ volatile *);
void futex_init(volatile uint32_t *lock) { spin_init(lock); }


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

x86 assembly (clang, -O2):
<futex_init>:
jmp    1030 <spin_init@plt>

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

LLVM IR (-O2):
define void @futex_init(i32* %0) {
%2 = tail call i32 @spin_init(i32* %0)
ret void
}