xunge/DecIR huggingface dataset:
char *fd2gst(string)
char *string;
{
  double dj, gsec, date, time;
  dj = fd2jd(string);
  gsec = jd2gst(dj);
  ts2dt(gsec, &date, &time);
  date = 0.0;
  return (dt2fd(date, time));
}


x86 assembly (clang, -O0):
<fd2gst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1050 <jd2gst@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%al
call   1030 <ts2dt@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x2,%al
call   1060 <dt2fd@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2gst>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1050 <jd2gst@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%al
call   1030 <ts2dt@plt>
movq   $0x0,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
mov    $0x2,%al
call   1060 <dt2fd@plt>
cltq
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @fd2gst(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %7)
%9 = sitofp i32 %8 to double
store double %9, double* %3
%10 = load double, double* %3
%11 = call i32 (double, ...) bitcast (i32 (...)* @jd2gst to i32 (double, ...)*)(double %10)
%12 = sitofp i32 %11 to double
store double %12, double* %4
%13 = load double, double* %4
%14 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %13, double* %5, double* %6)
store double 0.000000e+00, double* %5
%15 = load double, double* %5
%16 = load double, double* %6
%17 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2fd to i32 (double, double, ...)*)(double %15, double %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define i8* @fd2gst(i8* %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%7 = sitofp i32 %6 to double
%8 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2gst to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
%10 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %9, double* %2, double* %3)
store double 0.000000e+00, double* %2
%11 = load double, double* %3
%12 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2fd to i32 (double, double, ...)*)(double 0.000000e+00, double %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}
int any_equal(int n, int *x, int *y) {
  for (int i = 0; i < n; i++)
    if (x[i] == y[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<any_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115d <any_equal+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    114a <any_equal+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <any_equal+0x64>
jmp    114f <any_equal+0x4f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <any_equal+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_equal>:
test   %edi,%edi
jle    113d <any_equal+0x3d>
mov    (%rsi),%ecx
mov    $0x1,%eax
cmp    (%rdx),%ecx
je     113c <any_equal+0x3c>
mov    %edi,%r8d
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
cmp    %rax,%r8
je     1134 <any_equal+0x34>
mov    (%rsi,%rdi,4),%ecx
lea    0x1(%rdi),%rax
cmp    (%rdx,%rdi,4),%ecx
jne    1120 <any_equal+0x20>
xor    %eax,%eax
cmp    %r8,%rdi
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any_equal(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = zext i32 %0 to i64
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %8, %9
br i1 %10, label %24, label %11
11: ; preds = %5, %14
%12 = phi i64 [ %20, %14 ], [ 1, %5 ]
%13 = icmp eq i64 %12, %7
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = getelementptr inbounds i32, i32* %1, i64 %12
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %2, i64 %12
%18 = load i32, i32* %17
%19 = icmp eq i32 %16, %18
%20 = add nuw nsw i64 %12, 1
br i1 %19, label %21, label %11
21: ; preds = %11, %14
%22 = icmp ult i64 %12, %6
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %5, %3
%25 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %23, %21 ]
ret i32 %25
}
/* Variables and functions */
scalar_t__ nrfx_usbd_errata_type_52840_eng_b();
scalar_t__ nrfx_usbd_errata_type_52840_eng_c();
scalar_t__ nrfx_usbd_errata_type_52840_eng_d();
bool nrfx_usbd_errata_187(void) {
  return (1 && (nrfx_usbd_errata_type_52840_eng_b() ||
                nrfx_usbd_errata_type_52840_eng_c() ||
                nrfx_usbd_errata_type_52840_eng_d()));
}


x86 assembly (clang, -O0):
<nrfx_usbd_errata_187>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nrfx_usbd_errata_type_52840_eng_b@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <nrfx_usbd_errata_187+0x4b>
mov    $0x0,%al
call   1030 <nrfx_usbd_errata_type_52840_eng_c@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <nrfx_usbd_errata_187+0x4b>
mov    $0x0,%al
call   1050 <nrfx_usbd_errata_type_52840_eng_d@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrfx_usbd_errata_187>:
push   %rbx
xor    %eax,%eax
call   1040 <nrfx_usbd_errata_type_52840_eng_b@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <nrfx_usbd_errata_187+0x2d>
xor    %eax,%eax
call   1030 <nrfx_usbd_errata_type_52840_eng_c@plt>
test   %rax,%rax
jne    115d <nrfx_usbd_errata_187+0x2d>
xor    %eax,%eax
call   1050 <nrfx_usbd_errata_type_52840_eng_d@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_187() {
%1 = call i64 (...) @nrfx_usbd_errata_type_52840_eng_b()
%2 = icmp ne i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 (...) @nrfx_usbd_errata_type_52840_eng_c()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 (...) @nrfx_usbd_errata_type_52840_eng_d()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_187() {
%1 = tail call i64 (...) @nrfx_usbd_errata_type_52840_eng_b()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @nrfx_usbd_errata_type_52840_eng_c()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @nrfx_usbd_errata_type_52840_eng_d()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
unsigned int constant_time_eq(unsigned int, unsigned int);
unsigned int constant_time_eq_int(int a, int b) {
  return constant_time_eq((unsigned)(a), (unsigned)(b));
}


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

x86 assembly (clang, -O2):
<constant_time_eq_int>:
jmp    1030 <constant_time_eq@plt>

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

LLVM IR (-O2):
define i32 @constant_time_eq_int(i32 %0, i32 %1) {
%3 = tail call i32 @constant_time_eq(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double log(double);
double volts_to_c(float volts) {
  float therm_r = 300000 / (((4096 - 1) / volts) - 1);
  double temp = therm_r / 10000;
  temp = log(temp);
  temp = temp / 3892;
  temp = temp + (1.0 / (25 + 273.15));
  temp = 1.0 / temp;
  return (temp - 273.15);
}


x86 assembly (clang, -O0):
<volts_to_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xf07(%rip),%xmm1
divss  -0x4(%rbp),%xmm1
movss  0xef6(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xee6(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe82(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe68(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe49(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volts_to_c>:
push   %rax
movss  0xee7(%rip),%xmm1
divss  %xmm0,%xmm1
addss  0xedf(%rip),%xmm1
movss  0xedb(%rip),%xmm0
divss  %xmm1,%xmm0
divss  0xed3(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log@plt>
divsd  0xec6(%rip),%xmm0
addsd  0xec6(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xec2(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @volts_to_c(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca double
store float %0, float* %2
%5 = load float, float* %2
%6 = fdiv float 4.095000e+03, %5
%7 = fsub float %6, 1.000000e+00
%8 = fdiv float 3.000000e+05, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = fdiv float %9, 1.000000e+04
%11 = fpext float %10 to double
store double %11, double* %4
%12 = load double, double* %4
%13 = call double @log(double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = fdiv double %14, 3.892000e+03
store double %15, double* %4
%16 = load double, double* %4
%17 = fadd double %16, 0x3F6B79E1DCB5DB83
store double %17, double* %4
%18 = load double, double* %4
%19 = fdiv double 1.000000e+00, %18
store double %19, double* %4
%20 = load double, double* %4
%21 = fsub double %20, 2.731500e+02
ret double %21
}

LLVM IR (-O2):
define double @volts_to_c(float %0) {
%2 = fdiv float 4.095000e+03, %0
%3 = fadd float %2, -1.000000e+00
%4 = fdiv float 3.000000e+05, %3
%5 = fdiv float %4, 1.000000e+04
%6 = fpext float %5 to double
%7 = tail call double @log(double %6)
%8 = fdiv double %7, 3.892000e+03
%9 = fadd double %8, 0x3F6B79E1DCB5DB83
%10 = fdiv double 1.000000e+00, %9
%11 = fadd double %10, -2.731500e+02
ret double %11
}
int isnonspace(int c) {
  switch (c) {
  case '\t':
  case '\v':
  case '\f':
  case ' ':
  case '\r':
  case '\n':
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isnonspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isnonspace+0x2f>
jmp    111e <isnonspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isnonspace+0x3b>
jmp    112f <isnonspace+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <isnonspace+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnonspace>:
xor    %eax,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110b <isnonspace+0xb>
ret
cmp    $0x20,%edi
je     110a <isnonspace+0xa>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isnonspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 9, label %5
i32 11, label %5
i32 12, label %5
i32 32, label %5
i32 13, label %5
i32 10, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isnonspace(i32 %0) {
switch i32 %0, label %2 [
i32 9, label %3
i32 11, label %3
i32 12, label %3
i32 32, label %3
i32 13, label %3
i32 10, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
/* Variables and functions */
int abs(int);
int rand();
int genDifference() {
  int diff = rand() % (200 * 2 + 1);
  diff -= 200;
  if (abs(diff) < 5)
    diff = genDifference();
  return diff;
}


x86 assembly (clang, -O0):
<genDifference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x191,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xc8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x5,%eax
jge    116e <genDifference+0x3e>
call   1040 <genDifference@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genDifference>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x28db9c69,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x191,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
neg    %ecx
lea    -0xc8(%rdx),%esi
neg    %esi
cmp    $0xc8,%edx
lea    -0xc8(%rax,%rcx,1),%eax
cmovge %eax,%esi
cmp    $0x5,%esi
jl     1120 <genDifference+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @genDifference() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 401
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sub nsw i32 %4, 200
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @abs(i32 %6)
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @genDifference()
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @genDifference() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 401
%4 = add nsw i32 %3, -200
%5 = icmp slt i32 %3, 200
%6 = sub nsw i32 200, %3
%7 = select i1 %5, i32 %6, i32 %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %1, label %9
9: ; preds = %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t __simplePNG_is_little_endian() {
  uint16_t val = 1;
  uint8_t *p = (uint8_t *)&val;
  return p[0];
}


x86 assembly (clang, -O0):
<__simplePNG_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__simplePNG_is_little_endian() {
%1 = alloca i32
%2 = alloca i32*
store i32 1, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @__simplePNG_is_little_endian() {
ret i32 1
}
/* Variables and functions */
bool isPalindrome(int n) {
  int reversed = 0, tmp = n;
  while (tmp) {
    reversed = 10 * reversed + (tmp % 10);
    tmp /= 10;
  }
  return reversed == n;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <isPalindrome+0x4b>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <isPalindrome+0x14>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
xor    %edx,%edx
test   %edi,%edi
je     1141 <isPalindrome+0x41>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <isPalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = mul nsw i32 %5, 10
%7 = srem i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int tab[512], licznik, liczba = 128, index = 0;
  int *wskaznik = &liczba;
  for (licznik = 0; licznik <= 512; index++) {
    tab[licznik] = *wskaznik;
    printf("%d ==> %d\n", index, tab[licznik]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x818(%rbp)
movl   $0x0,-0x81c(%rbp)
lea    -0x818(%rbp),%rax
mov    %rax,-0x828(%rbp)
movl   $0x0,-0x814(%rbp)
cmpl   $0x200,-0x814(%rbp)
jg     11a9 <main+0x99>
mov    -0x828(%rbp),%rax
mov    (%rax),%ecx
movslq -0x814(%rbp),%rax
mov    %ecx,-0x810(%rbp,%rax,4)
mov    -0x81c(%rbp),%esi
movslq -0x814(%rbp),%rax
mov    -0x810(%rbp,%rax,4),%edx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x81c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x81c(%rbp)
jmp    114e <main+0x3e>
xor    %eax,%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x80,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d ==> %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 128)
%4 = add nuw nsw i32 %2, 1
br label %1
}
void XkbGetKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetKeyboard() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *find_and_terminate(char *str, char find) {
  str = strchr(str, find);
  if (NULL == str) {
    return NULL;
  }
  *str = '\0';
  return str + 1;
}


x86 assembly (clang, -O0):
<find_and_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    114c <find_and_terminate+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    115f <find_and_terminate+0x4f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_and_terminate>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     1124 <find_and_terminate+0x14>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @find_and_terminate(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %5
%8 = call i8* @strchr(i8* %6, i8 signext %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* null, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
store i8 0, i8* %13
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %3
br label %16
16: ; preds = %12, %11
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @find_and_terminate(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
store i8 0, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  printf("~4=%x\n", ~4);
  printf("~4u=%x\n", ~4u);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"~4=%x\0A\00"
@.str.1 = [8 x i8] c"~4u=%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 -5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 -5)
ret i32 0
}
int test_imm_78int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x78 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_78int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 120
%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_78int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7864320
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void zeroMatrixOfFloats(float *matrix, int numberOfElements) {
  for (int i = 0; i < numberOfElements; i++) {
    matrix[i] = (float)0.0;
  }
}


x86 assembly (clang, -O0):
<zeroMatrixOfFloats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zeroMatrixOfFloats+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zeroMatrixOfFloats+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroMatrixOfFloats>:
test   %esi,%esi
jle    1126 <zeroMatrixOfFloats+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zeroMatrixOfFloats(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
store float 0.000000e+00, float* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @zeroMatrixOfFloats(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void X509_get_ext_by_OBJ(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_get_ext_by_OBJ() {
ret void
}
double H2_stickingFactor(const double T, const double Td) {
  return pow((1.0e0 + 0.4e0 * sqrt(T + Td) + 2.0e-3 * T + 8.0e-6 * ((T) * (T))),
             -1.0e0);
}


x86 assembly (clang, -O0):
<H2_stickingFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  0xecf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeaa(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe70(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H2_stickingFactor>:
push   %rax
movapd %xmm0,%xmm3
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     112c <H2_stickingFactor+0x1c>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    113f <H2_stickingFactor+0x2f>
movapd %xmm1,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm3
mulsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm3
mulsd  0xea9(%rip),%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @H2_stickingFactor(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
%8 = call double @sqrt(double %7)
%9 = call double @llvm.fmuladd.f64(double 4.000000e-01, double %8, double 1.000000e+00)
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double 2.000000e-03, double %10, double %9)
%12 = load double, double* %3
%13 = load double, double* %3
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double 0x3EE0C6F7A0B5ED8D, double %14, double %11)
%16 = call double @pow(double %15, double -1.000000e+00)
ret double %16
}

LLVM IR (-O2):
define double @H2_stickingFactor(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @sqrt(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 4.000000e-01, double 1.000000e+00)
%6 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e-03, double %5)
%7 = fmul double %0, %0
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EE0C6F7A0B5ED8D, double %6)
%9 = fdiv double 1.000000e+00, %8
ret double %9
}
/* Variables and functions */
int *__error_selector();
int *__error(void) { return (__error_selector()); }


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

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

LLVM IR (-O0):
define i32* @__error() {
%1 = call i32* (...) @__error_selector()
ret i32* %1
}

LLVM IR (-O2):
define i32* @__error() {
%1 = tail call i32* (...) @__error_selector()
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ quit(char *);
scalar_t__ setregid(int /*<<< orphan*/, int /*<<< orphan*/);
void safe_setuid_grab(void) {
  if (setregid(getegid(), getgid()) != 0) {
    quit("setregid(): cannot set permissions correctly!");
  }
}


x86 assembly (clang, -O0):
<safe_setuid_grab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getgid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1060 <setregid@plt>
cmp    $0x0,%rax
je     1179 <safe_setuid_grab+0x39>
lea    0xe8c(%rip),%rdi
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_setuid_grab>:
push   %rbx
xor    %eax,%eax
call   1050 <getegid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <setregid@plt>
test   %rax,%rax
je     116c <safe_setuid_grab+0x2c>
lea    0xe9a(%rip),%rdi
pop    %rbx
jmp    1030 <quit@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"setregid(): cannot set permissions correctly!\00"
define void @safe_setuid_grab() {
%1 = call i32 (...) @getegid()
%2 = call i32 (...) @getgid()
%3 = call i64 @setregid(i32 %1, i32 %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @quit(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"setregid(): cannot set permissions correctly!\00"
define void @safe_setuid_grab() {
%1 = tail call i32 (...) @getegid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i64 @setregid(i32 %1, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @quit(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ scanf(char *, double *);
int /*<<< orphan*/ stdout;
double get_value(char *name) {
  double val = 0.0;
  fprintf(stdout, "Enter <%s> value: ", name);
  if (scanf("%lf", &val) == 0)
    val = 0;
  return val;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
jne    116f <get_value+0x4f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     115d <get_value+0x3d>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"Enter <%s> value: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_value(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* @stdout
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0.000000e+00, double* %3
br label %10
10: ; preds = %9, %1
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"Enter <%s> value: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_value(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = icmp eq i64 %6, 0
%8 = load double, double* %2
%9 = select i1 %7, double 0.000000e+00, double %8
ret double %9
}
/* Variables and functions */
double tan(double);
double atan(double x) { return -tan(x); }


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tan@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
push   %rax
call   1030 <tan@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @atan(double %0) {
%2 = tail call double @tan(double %0)
%3 = fneg double %2
ret double %3
}
/* Variables and functions */
void *malloc(int /*<<< orphan*/);
void *mem_align(__attribute__((unused)) int align) { return malloc(0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @mem_align(i32 %0) {
%2 = tail call i8* @malloc(i32 0)
ret i8* %2
}
int test_imm_68uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x68 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_68uint64_highword_reg>:
movabs $0x6800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 446676598784
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ report(int);
int /*<<< orphan*/ setreg(scalar_t__, int);
void send_char_no_wait(int ch) {
  report(ch);
  setreg(((0x9c000000) + 0), ch);
}


x86 assembly (clang, -O0):
<send_char_no_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <report@plt>
mov    -0x4(%rbp),%esi
mov    $0x9c000000,%edi
call   1030 <setreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_char_no_wait>:
push   %rbx
mov    %edi,%ebx
call   1040 <report@plt>
mov    $0x9c000000,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <setreg@plt>

LLVM IR (-O0):
define void @send_char_no_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @report(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @setreg(i64 2617245696, i32 %5)
ret void
}

LLVM IR (-O2):
define void @send_char_no_wait(i32 %0) {
%2 = tail call i32 @report(i32 %0)
%3 = tail call i32 @setreg(i64 2617245696, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char const *, void *, size_t);
ssize_t getxattr(const char *path, const char *name, void *value, size_t size) {
  return syscall(191, path, name, value, size);
}


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

x86 assembly (clang, -O2):
<getxattr>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xbf,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 191, i8* %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 191, i8* %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  while (--argc > 0)
    printf("%s\n", *(++argv));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    115c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1147 <main+0x37>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    (%rbx),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %6
15: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp ugt i32 %6, 2
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret i32 0
}
int test_imm_F2int32_mem(int *val) {
  return ((*val) & (0xF2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F2int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 242
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strcpy(char *, char *);
int strlen(char *);
char *try_malloc(int);
char *str_clone(char *src) {
  char *new = try_malloc(sizeof(char) * (strlen(src) + 1));
  return strcpy(new, src);
}


x86 assembly (clang, -O0):
<str_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <try_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_clone>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <try_malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @str_clone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i8* @try_malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i8* @strcpy(i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_clone(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @try_malloc(i32 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ execerror(char *, char *);
char *malloc(unsigned int);
char *emalloc(unsigned n) {
  char *p;
  p = malloc(n);
  if (p == 0) {
    execerror("out of memory", (char *)0);
  }
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <emalloc+0x32>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <execerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <emalloc+0x1c>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1030 <execerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @execerror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* null)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @emalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @execerror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}