xunge/DecIR huggingface dataset:
int is_slice_type(int slice_type, int cmp_type) {
  if (slice_type >= 5) {
    slice_type -= 5;
  }
  if (cmp_type >= 5) {
    cmp_type -= 5;
  }
  if (slice_type == cmp_type) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_slice_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     111d <is_slice_type+0x1d>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0xc(%rbp)
jl     1130 <is_slice_type+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1148 <is_slice_type+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <is_slice_type+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_slice_type>:
lea    -0x5(%rdi),%ecx
cmp    $0x5,%edi
cmovl  %edi,%ecx
lea    -0x5(%rsi),%edx
cmp    $0x5,%esi
cmovl  %esi,%edx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_slice_type(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 4
%4 = add nsw i32 %0, -5
%5 = select i1 %3, i32 %4, i32 %0
%6 = icmp sgt i32 %1, 4
%7 = add nsw i32 %1, -5
%8 = select i1 %6, i32 %7, i32 %1
%9 = icmp eq i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
float remap(float value, float inputMin, float inputMax, float outputMin,
            float outputMax) {
  return (value - inputMin) *
             ((outputMax - outputMin) / (inputMax - inputMin)) +
         outputMin;
}


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

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

LLVM IR (-O0):
define float @remap(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %10
%15 = load float, float* %9
%16 = fsub float %14, %15
%17 = load float, float* %8
%18 = load float, float* %7
%19 = fsub float %17, %18
%20 = fdiv float %16, %19
%21 = load float, float* %9
%22 = call float @llvm.fmuladd.f32(float %13, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @remap(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %1
%7 = fsub float %4, %3
%8 = fsub float %2, %1
%9 = fdiv float %7, %8
%10 = tail call float @llvm.fmuladd.f32(float %6, float %9, float %3)
ret float %10
}
void rop3_148_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T | S;
  stk3 = *D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_148_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_148_0_0>:
mov    %edx,%eax
or     %sil,%al
and    (%rdi),%al
xor    %sil,%dl
xor    %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_148_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %10
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8, i8* %6
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = xor i32 %31, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %7
%36 = load i8, i8* %7
%37 = load i8*, i8** %4
store i8 %36, i8* %37
ret void
}

LLVM IR (-O2):
define void @rop3_148_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %2, %1
%8 = xor i8 %7, %6
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_error(char *);
void ft_error_if(int boo, char *error_str) {
  if (boo)
    ft_error(error_str);
}


x86 assembly (clang, -O0):
<ft_error_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <ft_error_if+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <ft_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_error_if>:
test   %edi,%edi
je     111c <ft_error_if+0xc>
mov    %rsi,%rdi
jmp    1030 <ft_error@plt>
ret

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

LLVM IR (-O2):
define void @ft_error_if(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ft_error(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *Sys_FindNext(unsigned musthave, unsigned canthave) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @Sys_FindNext(i32 %0, i32 %1) {
ret i8* null
}
char *driver_version(void) {
  static char *dv = "linux pf_packet";
  return dv;
}


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

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

LLVM IR (-O0):
@driver_version.dv = internal global i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0)
@.str = [16 x i8] c"linux pf_packet\00"
define i8* @driver_version() {
%1 = load i8*, i8** @driver_version.dv
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"linux pf_packet\00"
define i8* @driver_version() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_assignment() { write("json-task.json", "\t{", NULL); }


x86 assembly (clang, -O0):
<pre_assignment>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_assignment>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"\09{\00"
define void @pre_assignment() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"\09{\00"
define void @pre_assignment() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ srandom(int);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void utils_init_random(void) {
  time_t now = time(0);
  struct tm *tm_struct = localtime(&now);
  int seed = tm_struct->tm_sec;
  srandom(seed);
}


x86 assembly (clang, -O0):
<utils_init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <srandom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_init_random>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%edi
call   1040 <srandom@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @utils_init_random() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = call i32 @time(i32 0)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @srandom(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @utils_init_random() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @srandom(i32 %6)
ret void
}
int isleap(int year) {
  return (!(year % 4) && ((year % 100) || !(year % 400)));
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <isleap+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114f <isleap+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isleap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isleap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ true, %6 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ false, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *, ...);
void Cmd_Echo_f(void) {
  int i;
  for (i = 1; i < Cmd_Argc(); ++i)
    Com_Printf("%s ", Cmd_Argv(i));
  Com_Printf("\n");
}


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    117f <Cmd_Echo_f+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <Com_Printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <Cmd_Echo_f+0xf>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     1171 <Cmd_Echo_f+0x41>
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <Cmd_Argv@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <Com_Printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    %eax,%ebx
jl     1150 <Cmd_Echo_f+0x20>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = call i32 (...) @Cmd_Argc()
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @Cmd_Argv(i32 %7)
%9 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = call i32 (i8*, ...) @Com_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"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = tail call i32 @Cmd_Argv(i32 %4)
%6 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 (...) @Cmd_Argc()
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xxtoa(long long, char *, int, int);
char *lltoa(long long val, char *buf, int radix) {
  xxtoa(val, buf, radix, (radix == 10 && val < 0));
  return buf;
}


x86 assembly (clang, -O0):
<lltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1153 <lltoa+0x43>
cmpq   $0x0,-0x8(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <xxtoa@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lltoa>:
push   %rbx
mov    %rsi,%rbx
cmp    $0xa,%edx
sete   %al
test   %rdi,%rdi
sets   %cl
and    %al,%cl
movzbl %cl,%ecx
call   1030 <xxtoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i64, i64* %4
%14 = icmp slt i64 %13, 0
br label %15
15: ; preds = %12, %3
%16 = phi i1 [ false, %3 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @xxtoa(i64 %7, i8* %8, i32 %9, i32 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @lltoa(i64 %0, i8* returned %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = icmp slt i64 %0, 0
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
%8 = tail call i32 @xxtoa(i64 %0, i8* %1, i32 %2, i32 %7)
ret i8* %1
}
unsigned long long IEEE_mantissa_to_EPFP_mantissa(unsigned long long d) {
  return d >> 13;
}


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

x86 assembly (clang, -O2):
<IEEE_mantissa_to_EPFP_mantissa>:
mov    %rdi,%rax
shr    $0xd,%rax
ret

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

LLVM IR (-O2):
define i64 @IEEE_mantissa_to_EPFP_mantissa(i64 %0) {
%2 = lshr i64 %0, 13
ret i64 %2
}
int ParseHeaderLine(line, entry1, entry2)
char *entry1, *entry2, *line;
{
  string_copy(entry1, &line[0], 14);
  string_copy(entry2, &line[14], 10);
  return 0;
}


x86 assembly (clang, -O0):
<ParseHeaderLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xe,%edx
mov    $0x0,%al
call   1030 <string_copy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xe,%rsi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <string_copy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseHeaderLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0xe,%edx
xor    %eax,%eax
call   1030 <string_copy@plt>
add    $0xe,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <string_copy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ParseHeaderLine(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @string_copy to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %9, i32 14)
%11 = load i8*, i8** %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 14
%14 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @string_copy to i32 (i8*, i8*, i32, ...)*)(i8* %11, i8* %13, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @ParseHeaderLine(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @string_copy to i32 (i8*, i8*, i32, ...)*)(i8* %1, i8* %0, i32 14)
%5 = getelementptr inbounds i8, i8* %0, i64 14
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @string_copy to i32 (i8*, i8*, i32, ...)*)(i8* %2, i8* %5, i32 10)
ret i32 0
}
unsigned char op_or(unsigned char n1, unsigned char n2) { return n1 | n2; }


x86 assembly (clang, -O0):
<op_or>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @op_or(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @op_or(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tr_trans_usage() {
  fprintf(stderr, "Usage: treebest trans <nucl_alignment>\n");
  return 1;
}


x86 assembly (clang, -O0):
<tr_trans_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_trans_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: treebest trans <nucl_alignment>\0A\00"
define i32 @tr_trans_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: treebest trans <nucl_alignment>\0A\00"
define i32 @tr_trans_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int _outs(char *s, void *_op, int len) {
  memcpy(*((char **)_op), s, len);
  *((char **)_op) += len;
  return len;
}


x86 assembly (clang, -O0):
<_outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_outs>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    (%r14),%rdi
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_outs(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** %5
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
%10 = load i8*, i8** %4
%11 = load i32, i32* %6
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i32, i32* %6
%14 = load i8*, i8** %5
%15 = bitcast i8* %14 to i8**
%16 = load i8*, i8** %15
%17 = sext i32 %13 to i64
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8* %18, i8** %15
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @_outs(i8* %0, i8* nocapture %1, i32 returned %2) {
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %2)
%7 = load i8*, i8** %4
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %4
ret i32 %2
}
double physmem_total(void) { return 0; }


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

x86 assembly (clang, -O2):
<physmem_total>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @physmem_total() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @physmem_total() {
ret double 0.000000e+00
}
int do_876() { return 876; }


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

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

LLVM IR (-O0):
define i32 @do_876() {
ret i32 876
}

LLVM IR (-O2):
define i32 @do_876() {
ret i32 876
}
void joystick_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @joystick_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int);
void RST08() { RST(0x08); }


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

x86 assembly (clang, -O2):
<RST08>:
mov    $0x8,%edi
jmp    1030 <RST@plt>

LLVM IR (-O0):
define void @RST08() {
%1 = call i32 @RST(i32 8)
ret void
}

LLVM IR (-O2):
define void @RST08() {
%1 = tail call i32 @RST(i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main(void) {
  int x = 0;
  int y = 0xF;
  int p = 7;
  int n = 4;
  printf("0x%x\n", setbits(x, p, n, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7,%esi
mov    $0x4,%edx
mov    $0xf,%ecx
call   1040 <setbits@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 0, i32 7, i32 4, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int set_channel(char *, int /*<<< orphan*/);
int usage(char *);
int main(int argc, char **argv) {
  if (argc != 3)
    return usage(argv[0]);
  return set_channel(argv[1], atoi(argv[2]));
}


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)
cmpl   $0x3,-0x8(%rbp)
je     1164 <main+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    118b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <set_channel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jne    114e <main+0x1e>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <set_channel@plt>
mov    (%rsi),%rdi
pop    %rbx
jmp    1030 <usage@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %14
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @set_channel(i8* %9, i32 %12)
br label %14
14: ; preds = %7, %4
%15 = phi i32 [ %6, %4 ], [ %13, %7 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ strlen(char const *);
scalar_t__ strspn(char const *, char const *);
int consistsof(const char *string, const char *accept) {
  return strspn(string, accept) == strlen(string);
}


x86 assembly (clang, -O0):
<consistsof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consistsof>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @consistsof(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 i64 @strspn(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = icmp eq i64 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @consistsof(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strspn(i8* %0, i8* %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ xop(char *, long double, long double, long double);
void fdiv(long double a, long double b) { xop("div", a, b, a / b); }


x86 assembly (clang, -O0):
<fdiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fldt   -0x20(%rbp)
fld    %st(0)
fxch   %st(3)
fdivp  %st,%st(1)
mov    %rsp,%rax
fstpt  0x20(%rax)
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xeba(%rip),%rdi
call   1030 <xop@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiv>:
sub    $0x38,%rsp
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fld    %st(0)
fdiv   %st(2),%st
fstpt  0x20(%rsp)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xecc(%rip),%rdi
call   1030 <xop@plt>
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"div\00"
define void @fdiv(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
%4 = tail call i32 @xop(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %0, x86_fp80 %1, x86_fp80 %3)
ret void
}
/* Variables and functions */
int frand();
double nfrand(void) { return frand() * 2 - 1; }


x86 assembly (clang, -O0):
<nfrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <frand@plt>
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfrand>:
push   %rax
xor    %eax,%eax
call   1030 <frand@plt>
add    %eax,%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nfrand() {
%1 = call i32 (...) @frand()
%2 = mul nsw i32 %1, 2
%3 = sub nsw i32 %2, 1
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @nfrand() {
%1 = tail call i32 (...) @frand()
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
%4 = sitofp i32 %3 to double
ret double %4
}
int compare(const void *arg1, const void *arg2) {
  if (*(int *)arg1 > *(int *)arg2)
    return 1;
  else if (*(int *)arg1 == *(int *)arg2)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <compare+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %24
23: ; preds = %14
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void poly_(n, parray) int *n;
float parray[][3];
{ poly((long)*n, parray); }


x86 assembly (clang, -O0):
<poly_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <poly@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <poly@plt>

LLVM IR (-O0):
define void @poly_(i32* %0, [3 x float]* %1) {
%3 = alloca i32*
%4 = alloca [3 x float]*
store i32* %0, i32** %3
store [3 x float]* %1, [3 x float]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [3 x float]*, [3 x float]** %4
%9 = call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @poly to i32 (i64, [3 x float]*, ...)*)(i64 %7, [3 x float]* %8)
ret void
}

LLVM IR (-O2):
define void @poly_(i32* nocapture %0, [3 x float]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [3 x float]*, ...) bitcast (i32 (...)* @poly to i32 (i64, [3 x float]*, ...)*)(i64 %4, [3 x float]* %1)
ret void
}
puts(s) register char *s;
{
  register c;
  int putc();
  while (c = *s++)
    putc(0, c);
  return (putc(0, '\n'));
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114b <puts+0x3b>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <putc@plt>
jmp    111c <puts+0xc>
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1137 <puts+0x27>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %edi,%edi
mov    $0xa,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putc to i32 (i32, i32, ...)*)(i32 0, i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putc to i32 (i32, i32, ...)*)(i32 0, i32 10)
ret i32 %13
}
unsigned long long create_binary_mask(unsigned int word_length) {
  unsigned int i;
  unsigned long long mask = 0L;
  for (i = 0; i < 2 * word_length; i++) {
    mask = (mask << 1) | 1;
  }
  return mask;
}


x86 assembly (clang, -O0):
<create_binary_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jae    1145 <create_binary_mask+0x45>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
or     $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <create_binary_mask+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_binary_mask>:
add    %edi,%edi
je     1115 <create_binary_mask+0x15>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x6,%ecx
cmp    $0x7,%eax
jae    1118 <create_binary_mask+0x18>
xor    %eax,%eax
jmp    112f <create_binary_mask+0x2f>
xor    %eax,%eax
ret
and    $0xfffffff8,%edi
xor    %eax,%eax
nopl   (%rax)
shl    $0x8,%rax
or     $0xff,%rax
add    $0xfffffff8,%edi
jne    1120 <create_binary_mask+0x20>
test   %ecx,%ecx
je     114c <create_binary_mask+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rax,%rax
add    $0x1,%rax
add    $0xffffffff,%ecx
jne    1140 <create_binary_mask+0x40>
ret

LLVM IR (-O0):
define i64 @create_binary_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %4
store i32 0, i32* %3
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = mul i32 2, %7
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i64, i64* %4
%12 = shl i64 %11, 1
%13 = or i64 %12, 1
store i64 %13, i64* %4
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
define i64 @create_binary_mask(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %28, label %4
4: ; preds = %1
%5 = add i32 %2, -1
%6 = and i32 %2, 6
%7 = icmp ult i32 %5, 7
br i1 %7, label %17, label %8
8: ; preds = %4
%9 = and i32 %2, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 0, %8 ], [ %14, %10 ]
%12 = phi i32 [ 0, %8 ], [ %15, %10 ]
%13 = shl i64 %11, 8
%14 = or i64 %13, 255
%15 = add i32 %12, 8
%16 = icmp eq i32 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %4
%18 = phi i64 [ undef, %4 ], [ %14, %10 ]
%19 = phi i64 [ 0, %4 ], [ %14, %10 ]
%20 = icmp eq i32 %6, 0
br i1 %20, label %28, label %21
21: ; preds = %17, %21
%22 = phi i64 [ %25, %21 ], [ %19, %17 ]
%23 = phi i32 [ %26, %21 ], [ 0, %17 ]
%24 = shl i64 %22, 1
%25 = or i64 %24, 1
%26 = add i32 %23, 1
%27 = icmp eq i32 %26, %6
br i1 %27, label %28, label %21
28: ; preds = %17, %21, %1
%29 = phi i64 [ 0, %1 ], [ %18, %17 ], [ %25, %21 ]
ret i64 %29
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int t(int);
int main(void) {
  int a;
  scanf("%d", &a);
  printf("%d", t(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <t@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <t@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @t(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ while1();
void testWhile(void) { while1(); }


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

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

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

LLVM IR (-O2):
define void @testWhile() {
%1 = tail call i32 (...) @while1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndExit(const char *progname, int status) {
  FILE *stream = stdout;
  if (status == EXIT_FAILURE)
    stream = stderr;
  fprintf(stream, "Usage: %s [size]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndExit+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndExit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eab(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndExit+0x1a>
mov    0x2ea8(%rip),%rax
jmp    1141 <helpAndExit+0x21>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@EXIT_FAILURE = global i32 0
@stderr = global i32* null
@.str = [18 x i8] c"Usage: %s [size]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stdout
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_FAILURE
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stderr
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stdout = global i32* null
@EXIT_FAILURE = global i32 0
@stderr = global i32* null
@.str = [18 x i8] c"Usage: %s [size]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stderr
%6 = load i32*, i32** @stdout
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef scalar_t__ ulong;

/* Variables and functions */
ulong add_ulong(ulong arg1, ulong arg2) { return arg1 + arg2; }


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

x86 assembly (clang, -O2):
<add_ulong>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add_ulong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add_ulong(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
void delselect_ship(void) {
  (*((volatile unsigned long *)0x70200004)) |= (1 << 1);
}


x86 assembly (clang, -O0):
<delselect_ship>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<delselect_ship>:
orq    $0x2,0x70200004
70 02
ret

LLVM IR (-O0):
define void @delselect_ship() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}

LLVM IR (-O2):
define void @delselect_ship() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}