xunge/DecIR huggingface dataset:
float C_clamp(float value, float unit) {
  if (value < 0)
    return (int)(value * -unit) / -unit;
  return (int)(value * unit) / unit;
}


x86 assembly (clang, -O0):
<C_clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    115e <C_clamp+0x5e>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117a <C_clamp+0x7a>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_clamp>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm1,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm4
cmpltss %xmm3,%xmm4
andps  %xmm4,%xmm2
andnps %xmm1,%xmm4
orps   %xmm2,%xmm4
mulss  %xmm4,%xmm0
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
divss  %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @C_clamp(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fneg float %10
%12 = fmul float %9, %11
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
%15 = load float, float* %5
%16 = fneg float %15
%17 = fdiv float %14, %16
store float %17, float* %3
br label %26
18: ; preds = %2
%19 = load float, float* %4
%20 = load float, float* %5
%21 = fmul float %19, %20
%22 = fptosi float %21 to i32
%23 = sitofp i32 %22 to float
%24 = load float, float* %5
%25 = fdiv float %23, %24
store float %25, float* %3
br label %26
26: ; preds = %18, %8
%27 = load float, float* %3
ret float %27
}

LLVM IR (-O2):
define float @C_clamp(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
%4 = fneg float %1
%5 = select i1 %3, float %4, float %1
%6 = fmul float %5, %0
%7 = select i1 %3, float %4, float %1
%8 = fptosi float %6 to i32
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, %7
ret float %10
}
void dummy_enc_jpeg2000(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @dummy_enc_jpeg2000() {
ret void
}
void redecl5() {}


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

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

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

LLVM IR (-O2):
define void @redecl5() {
ret void
}
int get_root_id() { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_root_id() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_root_id() {
ret i32 0
}
/* Variables and functions */
double errorPow(double, double, double);
double pow(double, double);
double *uncertainPow(double A, double errorA, double index) {
  static double retorno[2];
  retorno[0] = pow(A, index);
  retorno[1] = errorPow(A, errorA, index);
  return retorno;
}


x86 assembly (clang, -O0):
<uncertainPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x2ef2(%rip)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <errorPow@plt>
movsd  %xmm0,0x2ede(%rip)
lea    0x2ecf(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncertainPow>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm2,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x2ef9(%rip)
lea    0x2ef2(%rip),%rbx
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1030 <errorPow@plt>
movsd  %xmm0,0x2edb(%rip)
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@uncertainPow.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainPow(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = call double @pow(double %7, double %8)
store double %9, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 0)
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call double @errorPow(double %10, double %11, double %12)
store double %13, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 0)
}

LLVM IR (-O2):
@uncertainPow.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainPow(double %0, double %1, double %2) {
%4 = tail call double @pow(double %0, double %2)
store double %4, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 0)
%5 = tail call double @errorPow(double %0, double %1, double %2)
store double %5, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainPow.retorno, i64 0, i64 0)
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SO_RCVTIMEO;
int pd_socket_time_option(struct PdSocket *, int /*<<< orphan*/, int);
int pd_socket_recv_timeo(struct PdSocket *sock, int time) {
  return pd_socket_time_option(sock, SO_RCVTIMEO, time);
}


x86 assembly (clang, -O0):
<pd_socket_recv_timeo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <pd_socket_time_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_recv_timeo>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <pd_socket_time_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@SO_RCVTIMEO = global i32 0
define i32 @pd_socket_recv_timeo(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @SO_RCVTIMEO
%7 = load i32, i32* %4
%8 = call i32 @pd_socket_time_option(%struct.PdSocket* %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@SO_RCVTIMEO = global i32 0
define i32 @pd_socket_recv_timeo(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @SO_RCVTIMEO
%4 = tail call i32 @pd_socket_time_option(%struct.PdSocket* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WriteToLog(char *);
int /*<<< orphan*/ sprintf(char *, char const *, double);
void WriteToLogArgF(const char *msg, double arg) {
  char buf[100];
  sprintf(buf, msg, arg);
  WriteToLog(buf);
}


x86 assembly (clang, -O0):
<WriteToLogArgF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
call   1040 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <WriteToLog@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteToLogArgF>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <WriteToLog@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteToLogArgF(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load double, double* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, double %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @WriteToLog(i8* %10)
ret void
}

LLVM IR (-O2):
define void @WriteToLogArgF(i8* nocapture %0, double %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, double %1)
%6 = call i32 @WriteToLog(i8* %4)
ret void
}
/* Variables and functions */
long double pow(double, double);
long double powl(long double x, long double y) {
  return pow((double)x, (double)(y));
}


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <pow@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define x86_fp80 @powl(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 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @pow(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @pow(double %3, double %4)
ret x86_fp80 %5
}
void UARTDMAEnable(unsigned long ulBase, unsigned long ulDMAFlags) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) |= ulDMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMAEnable>:
or     %rsi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 20
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
int can_append_path(char *str) {
  if ((str[0] == '/') || ((str[0] == '.') && (str[1] == '.'))) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<can_append_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1139 <can_append_path+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1145 <can_append_path+0x45>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1145 <can_append_path+0x45>
movl   $0x0,-0x4(%rbp)
jmp    114c <can_append_path+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_append_path>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x2f,%cl
je     1119 <can_append_path+0x19>
cmp    $0x2e,%cl
jne    1114 <can_append_path+0x14>
cmpb   $0x2e,0x1(%rdi)
je     1119 <can_append_path+0x19>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @can_append_path(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %7 [
i8 47, label %8
i8 46, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 46
br i1 %6, label %8, label %7
7: ; preds = %1, %3
br label %8
8: ; preds = %3, %1, %7
%9 = phi i32 [ 1, %7 ], [ 0, %1 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *arr, int low, int high) {
  if (low < high) {
    int pi = partition(arr, low, high);
    quickSort(arr, low, pi - 1);
    quickSort(arr, pi + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
float cosf(float);
float hamming(float n, float N, float a) {
  (void)a;
  return 0.54f - 0.46f * cosf(2.0f * (float)M_PI * n / (N - 1.0f));
}


x86 assembly (clang, -O0):
<hamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    0x2eba(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xed1(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeb7(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
movss  0xe9a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe92(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming>:
push   %rax
mov    0x2ed0(%rip),%rax
cvtsi2ssq (%rax),%xmm2
addss  %xmm2,%xmm2
mulss  %xmm2,%xmm0
addss  0xed3(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
mulss  0xec6(%rip),%xmm0
addss  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @hamming(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load i64, i64* @M_PI
%9 = sitofp i64 %8 to float
%10 = fmul float 2.000000e+00, %9
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = load float, float* %5
%14 = fsub float %13, 1.000000e+00
%15 = fdiv float %12, %14
%16 = call float @cosf(float %15)
%17 = call float @llvm.fmuladd.f32(float 0xBFDD70A3E0000000, float %16, float 0x3FE147AE20000000)
ret float %17
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @hamming(float %0, float %1, float %2) {
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %5, 2.000000e+00
%7 = fmul float %6, %0
%8 = fadd float %1, -1.000000e+00
%9 = fdiv float %7, %8
%10 = tail call float @cosf(float %9)
%11 = tail call float @llvm.fmuladd.f32(float %10, float 0xBFDD70A3E0000000, float 0x3FE147AE20000000)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_read_local_supported_features(const void *test_data) {
  test_command(0x1003);
}


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

x86 assembly (clang, -O2):
<test_read_local_supported_features>:
mov    $0x1003,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_read_local_supported_features(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 4099)
ret void
}

LLVM IR (-O2):
define void @test_read_local_supported_features(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 4099)
ret void
}
void glTexSubImage2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexSubImage2D() {
ret void
}
/* Variables and functions */
scalar_t__ strntoumax(char const *, char **, int, size_t);
unsigned long strtoul(const char *nptr, char **endptr, int base) {
  return (unsigned long)strntoumax(nptr, endptr, base, ~(size_t)0);
}


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

x86 assembly (clang, -O2):
<strtoul>:
mov    $0xffffffffffffffff,%rcx
jmp    1030 <strntoumax@plt>

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strntoumax(i8* %0, i8** %1, i32 %2, i64 -1)
ret i64 %4
}
/* Variables and functions */
int lw6sys_chr_is_digit(char);
int _is_port(char c) { return (lw6sys_chr_is_digit(c)); }


x86 assembly (clang, -O0):
<_is_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <lw6sys_chr_is_digit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_port>:
jmp    1030 <lw6sys_chr_is_digit@plt>

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

LLVM IR (-O2):
define i32 @_is_port(i8 signext %0) {
%2 = tail call i32 @lw6sys_chr_is_digit(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
float M_PI;
float fabs(float);
float angle_between(float first, float second) {
  float result = fabs(second - first);
  if (result > M_PI) {
    return 2 * M_PI - result;
  } else {
    return result;
  }
}


x86 assembly (clang, -O0):
<angle_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    0x2ea6(%rip),%rax
ucomiss (%rax),%xmm0
jbe    117a <angle_between+0x6a>
mov    0x2e96(%rip),%rax
movss  (%rax),%xmm0
movss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1184 <angle_between+0x74>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_between>:
subss  %xmm0,%xmm1
andps  0xef5(%rip),%xmm1
mov    0x2ed6(%rip),%rax
movss  (%rax),%xmm0
movaps %xmm0,%xmm2
addss  %xmm0,%xmm2
subss  %xmm1,%xmm2
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @angle_between(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call float @fabs(float %9)
store float %10, float* %6
%11 = load float, float* %6
%12 = load float, float* @M_PI
%13 = fcmp ogt float %11, %12
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load float, float* @M_PI
%16 = load float, float* %6
%17 = fneg float %16
%18 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %15, float %17)
store float %18, float* %3
br label %21
19: ; preds = %2
%20 = load float, float* %6
store float %20, float* %3
br label %21
21: ; preds = %19, %14
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @angle_between(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = load float, float* @M_PI
%6 = fcmp ogt float %4, %5
%7 = fneg float %4
%8 = tail call float @llvm.fmuladd.f32(float %5, float 2.000000e+00, float %7)
%9 = select i1 %6, float %8, float %4
ret float %9
}
/* Variables and functions */
double cos(double const);
double cos_activate(const double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<cos_activate>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @cos_activate(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xd0() {
  Assert_real((iscntrl(208) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1045, ("iscntrl should be 0 for 0xd0"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd0\00"
define void @t_iscntrl_0xd0() {
%1 = tail call i64 @iscntrl(i32 208)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void _RARWrite32(uint8_t *b, uint32_t n) {
  b[3] = (n >> 24) & 0xff;
  b[2] = (n >> 16) & 0xff;
  b[1] = (n >> 8) & 0xff;
  b[0] = n & 0xff;
}


x86 assembly (clang, -O0):
<_RARWrite32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_RARWrite32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x8(%rdi)
mov    %edx,0x4(%rdi)
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_RARWrite32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %4
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %9, i32* %10
%11 = and i32 %1, 255
store i32 %11, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float graus;
  scanf("%f", &graus);
  printf("%f", graus * (3.14 / 180.00));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 0x3F91DCF4D98B0955
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fmul double %5, 0x3F91DCF4D98B0955
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a[] = {2, 5, 23, 44, 456, 554};
  int t = 456;
  int ret;
  extern int bsearch();
  ret = bsearch(a, 0, 5, t);
  printf("t=%d; ret=%d\n", t, ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1c8,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%ecx
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x0,%al
call   1040 <bsearch@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x1c8,%ecx
xor    %eax,%eax
call   1040 <bsearch@plt>
lea    0xec0(%rip),%rdi
mov    $0x1c8,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 2, i32 5, i32 23, i32 44, i32 456, i32 554]
@.str = [14 x i8] c"t=%d; ret=%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [6 x i32]* %1 to i8*
store i32 456, i32* %2
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 (i32*, i32, i32, i32, ...) bitcast (i32 (...)* @bsearch to i32 (i32*, i32, i32, i32, ...)*)(i32* %5, i32 0, i32 5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 2, i32 5, i32 23, i32 44, i32 456, i32 554]
@.str = [14 x i8] c"t=%d; ret=%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 (i32*, i32, i32, i32, ...) bitcast (i32 (...)* @bsearch to i32 (i32*, i32, i32, i32, ...)*)(i32* %3, i32 0, i32 5, i32 456)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 456, i32 %4)
ret i32 0
}
void trans_pack_open(char *filename) {}


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

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

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

LLVM IR (-O2):
define void @trans_pack_open(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
uint32_t le_to_u32(char *buf) {
  return (buf[0] << 0) | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
}


x86 assembly (clang, -O0):
<le_to_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_u32>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @le_to_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int lenum();
int maior(int, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int num1, num2;
  num1 = lenum();
  num2 = lenum();
  printf("Maior numero e: %d", maior(num1, num2));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <lenum@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <lenum@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <maior@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Maior numero e: %d\00"
define i32 @main() {
%1 = tail call i32 (...) @lenum()
%2 = tail call i32 (...) @lenum()
%3 = tail call i32 @maior(i32 %1, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int arrayToUIntBE(unsigned char *, int);
int extractChecksum(unsigned char *buff) { return arrayToUIntBE(buff, 2); }


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

x86 assembly (clang, -O2):
<extractChecksum>:
mov    $0x2,%esi
jmp    1030 <arrayToUIntBE@plt>

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

LLVM IR (-O2):
define i32 @extractChecksum(i8* %0) {
%2 = tail call i32 @arrayToUIntBE(i8* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
void delay(int a) {
  volatile int i;
  for (i = 0; i < a; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
double ln_get_venus_earth_dist(double);
double ln_get_venus_sdiam(double JD) {
  double So = 8.41;
  double dist;
  dist = ln_get_venus_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_venus_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_venus_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_venus_sdiam>:
push   %rax
call   1030 <ln_get_venus_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_venus_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 8.410000e+00, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_venus_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_venus_sdiam(double %0) {
%2 = tail call double @ln_get_venus_earth_dist(double %0)
%3 = fdiv double 8.410000e+00, %2
ret double %3
}
int test_imm_22uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x22,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22uint64_highword_mem>:
testb  $0x22,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_22uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 146028888064
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(int);
int main() {
  if (foo(1) == 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
jne    114a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
test   %rax,%rax
je     1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int getWaitExitCore(int *a) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @getWaitExitCore(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const void *a, const void *b, void *context) {
  const char *s1 = *(char **)a;
  const char *s2 = *(char **)b;
  (void)context;
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<compare>:
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),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
%11 = load i8*, i8** %10
store i8* %11, i8** %7
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i8**
%14 = load i8*, i8** %13
store i8* %14, i8** %8
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = call i32 @strcmp(i8* %16, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %7)
ret i32 %8
}
void GP_break30(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break30() {
ret void
}
double add_d(double a, double b) { return a + b; }


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

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

LLVM IR (-O0):
define double @add_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @add_d(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void CPUID(int func, unsigned int *regs) {
  __asm__ __volatile__("cpuid"
                       : "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]),
                         "=d"(regs[3])
                       : "a"(func));
}


x86 assembly (clang, -O0):
<CPUID>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPUID>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @CPUID(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @CPUID(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
int test_imm_4Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cuint16_mem>:
testb  $0x4c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 76
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}