xunge/DecIR huggingface dataset:
/* Variables and functions */
int SIM_power_draincap(double, int, int);
int SIM_power_gatecap(double, int /*<<< orphan*/);
double SIM_rr_arbiter_carry_in_cap() {
  double Ctotal = 0;
  Ctotal += 2 * SIM_power_gatecap((5.4 * 0.0875) + (30.5 * 0.0875), 0);
  Ctotal += 2 * SIM_power_draincap((5.4 * 0.0875), 1, 1) +
            SIM_power_draincap((30.5 * 0.0875), 0, 2);
  return Ctotal;
}


x86 assembly (clang, -O0):
<SIM_rr_arbiter_carry_in_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed8(%rip),%xmm0
xor    %edi,%edi
call   1040 <SIM_power_gatecap@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb0(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  0xe8e(%rip),%xmm0
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_rr_arbiter_carry_in_cap>:
push   %rbx
sub    $0x10,%rsp
movsd  0xed3(%rip),%xmm0
xor    %edi,%edi
call   1040 <SIM_power_gatecap@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xebd(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
movsd  0xeac(%rip),%xmm0
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
lea    (%rax,%rbx,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SIM_rr_arbiter_carry_in_cap() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%3 = mul nsw i32 2, %2
%4 = sitofp i32 %3 to double
%5 = load double, double* %1
%6 = fadd double %5, %4
store double %6, double* %1
%7 = call i32 @SIM_power_draincap(double 4.725000e-01, i32 1, i32 1)
%8 = mul nsw i32 2, %7
%9 = call i32 @SIM_power_draincap(double 0x4005599999999999, i32 0, i32 2)
%10 = add nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %1
%13 = fadd double %12, %11
store double %13, double* %1
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
define double @SIM_rr_arbiter_carry_in_cap() {
%1 = tail call i32 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%2 = shl nsw i32 %1, 1
%3 = sitofp i32 %2 to double
%4 = tail call i32 @SIM_power_draincap(double 4.725000e-01, i32 1, i32 1)
%5 = shl nsw i32 %4, 1
%6 = tail call i32 @SIM_power_draincap(double 0x4005599999999999, i32 0, i32 2)
%7 = add nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fadd double %3, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_second_greetings(void) { printf("Hello from another function\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Hello from another function\0A\00"
define void @print_second_greetings() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Hello from another function\00"
define void @print_second_greetings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
char *dummy_bind_textdomain_codeset(const char *domainname,
                                    const char *codeset) {
  return (char *)(codeset);
}


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

x86 assembly (clang, -O2):
<dummy_bind_textdomain_codeset>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @dummy_bind_textdomain_codeset(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @dummy_bind_textdomain_codeset(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
int main() {
  int j = 0;
  for (int i = 0; i < 5; i = i + 1) {
    j = j + 2;
  }
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
void *a12(int);
void *a11(int x) { return (((x >> 11) & 1) ? a12(x) : a12(x)); }


x86 assembly (clang, -O0):
<a11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a11+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a12@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a11+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a12@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a11>:
jmp    1030 <a12@plt>

LLVM IR (-O0):
define i8* @a11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 11
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a12(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a12(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a11(i32 %0) {
%2 = tail call i8* @a12(i32 %0)
ret i8* %2
}
/* Variables and functions */
unsigned int _rdpkru(int);
int /*<<< orphan*/ sigsafe_printf(char *, unsigned int);
int /*<<< orphan*/ wrpkru(unsigned int);
void __pkey_access_allow(int pkey, int do_allow) {
  unsigned int pkru = _rdpkru(111);
  int bit = pkey * 2;
  if (do_allow)
    pkru &= (1 << bit);
  else
    pkru |= (1 << bit);
  do {
    if (4 <= 0)
      sigsafe_printf("pkru now: %08x\n", _rdpkru(119));
  } while (0);
  wrpkru(pkru);
}


x86 assembly (clang, -O0):
<__pkey_access_allow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x6f,%edi
call   1040 <_rdpkru@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1163 <__pkey_access_allow+0x43>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <__pkey_access_allow+0x53>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <__pkey_access_allow+0x58>
jmp    117d <__pkey_access_allow+0x5d>
mov    -0xc(%rbp),%edi
call   1030 <wrpkru@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pkey_access_allow>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x6f,%edi
call   1040 <_rdpkru@plt>
add    %ebp,%ebp
mov    $0x1,%edi
mov    %ebp,%ecx
shl    %cl,%edi
and    %eax,%edi
bts    %ebp,%eax
test   %ebx,%ebx
cmove  %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <wrpkru@plt>

LLVM IR (-O0):
define void @__pkey_access_allow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @_rdpkru(i32 111)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = load i32, i32* %5
%16 = and i32 %15, %14
store i32 %16, i32* %5
br label %22
17: ; preds = %2
%18 = load i32, i32* %6
%19 = shl i32 1, %18
%20 = load i32, i32* %5
%21 = or i32 %20, %19
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %12
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = call i32 @wrpkru(i32 %25)
ret void
}

LLVM IR (-O2):
define void @__pkey_access_allow(i32 %0, i32 %1) {
%3 = tail call i32 @_rdpkru(i32 111)
%4 = shl nsw i32 %0, 1
%5 = icmp eq i32 %1, 0
%6 = shl nuw i32 1, %4
%7 = and i32 %3, %6
%8 = or i32 %3, %6
%9 = select i1 %5, i32 %8, i32 %7
%10 = tail call i32 @wrpkru(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int mkdir(char const *const, int /*<<< orphan*/ const);
int our_mkdir(const char *const path, const mode_t mode) {
  do {
    const int ret = mkdir(path, mode);
    if (ret == 0) {
      return ret;
    }
  } while (errno == EINTR);
  return -1;
}


x86 assembly (clang, -O0):
<our_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mkdir@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1143 <our_mkdir+0x33>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <our_mkdir+0x59>
jmp    1148 <our_mkdir+0x38>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
je     111f <our_mkdir+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_mkdir>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ebd(%rip),%r14
mov    0x2eae(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <mkdir@plt>
test   %eax,%eax
je     114d <our_mkdir+0x3d>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1130 <our_mkdir+0x20>
mov    $0xffffffff,%eax
jmp    114f <our_mkdir+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_mkdir(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @mkdir(i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %21
15: ; preds = %7
br label %16
16: ; preds = %15
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br i1 %19, label %7, label %20
20: ; preds = %16
store i32 -1, i32* %3
br label %21
21: ; preds = %20, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_mkdir(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i32 @mkdir(i8* %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %3 ], [ -1, %6 ]
ret i32 %11
}
/* Variables and functions */
double scalbn(double, int);
double scalbln(double x, long n) {
  return (scalbn(x, (n > 65536) ? 65536 : (n < -65536) ? -65536 : (int)n));
}


x86 assembly (clang, -O0):
<scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x10000,-0x10(%rbp)
jle    1146 <scalbln+0x36>
mov    $0x10000,%eax
mov    %eax,-0x1c(%rbp)
jmp    116e <scalbln+0x5e>
cmpq   $0xffffffffffff0000,-0x10(%rbp)
ff
jge    1161 <scalbln+0x51>
mov    $0xffff0000,%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <scalbln+0x58>
mov    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
call   1030 <scalbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbln>:
cmp    $0xffffffffffff0001,%rdi
mov    $0xffffffffffff0000,%rax
cmovl  %rax,%rdi
cmp    $0x10000,%rdi
mov    $0x10000,%eax
cmovge %eax,%edi
jmp    1030 <scalbn@plt>

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

LLVM IR (-O2):
define double @scalbln(double %0, i64 %1) {
%3 = icmp sgt i64 %1, -65536
%4 = select i1 %3, i64 %1, i64 -65536
%5 = icmp slt i64 %4, 65536
%6 = select i1 %5, i64 %4, i64 65536
%7 = trunc i64 %6 to i32
%8 = tail call double @scalbn(double %0, i32 %7)
ret double %8
}
/* Variables and functions */
scalar_t__ EOF;
int EXIT_SUCCESS;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", getchar() != EOF);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XColormapEvent;

/* Variables and functions */
void set_XColormapEvent_type(void *_p, int _v) {
  ((XColormapEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XColormapEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XColormapEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XColormapEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
char *encrypt(int, char *);
char *decrypt(int shift, char *string) {
  return encrypt(26 - (shift % 26), string);
}


x86 assembly (clang, -O0):
<decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    $0x1a,%edi
sub    %edx,%edi
mov    -0x10(%rbp),%rsi
call   1030 <encrypt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt>:
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edi
add    %ecx,%edi
sub    %eax,%edi
add    $0x1a,%edi
jmp    1030 <encrypt@plt>

LLVM IR (-O0):
define i8* @decrypt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = srem i32 %5, 26
%7 = sub nsw i32 26, %6
%8 = load i8*, i8** %4
%9 = call i8* @encrypt(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @decrypt(i32 %0, i8* %1) {
%3 = srem i32 %0, 26
%4 = sub nsw i32 26, %3
%5 = tail call i8* @encrypt(i32 %4, i8* %1)
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTParityModeSet(uint32_t ui32Base, uint32_t ui32Parity) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) =
      (((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
        ~(0x00000080 | 0x00000004 | 0x00000002)) |
       ui32Parity);
}


x86 assembly (clang, -O0):
<UARTParityModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
and    $0xffffff79,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeSet>:
movslq %edi,%rax
mov    $0xffffff79,%ecx
and    0x2c(%rax),%ecx
or     %esi,%ecx
mov    %ecx,0x2c(%rax)
ret

LLVM IR (-O0):
define void @UARTParityModeSet(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 = add nsw i32 %5, 44
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -135
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 44
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTParityModeSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 44
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -135
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_peer_get_slice(int fd,
                                                             char **slice) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_peer_get_slice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_peer_get_slice>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_peer_get_slice(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_peer_get_slice(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int napms(int);
int wrap_napms(int ms) { return napms(ms); }


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

x86 assembly (clang, -O2):
<wrap_napms>:
jmp    1030 <napms@plt>

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

LLVM IR (-O2):
define i32 @wrap_napms(i32 %0) {
%2 = tail call i32 @napms(i32 %0)
ret i32 %2
}
int getMaxCharsIn8Bit() { return 4; }


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

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

LLVM IR (-O0):
define i32 @getMaxCharsIn8Bit() {
ret i32 4
}

LLVM IR (-O2):
define i32 @getMaxCharsIn8Bit() {
ret i32 4
}
int count_triangular(int dimension) {
  if (dimension <= 0) {
    return 0;
  } else {
    return dimension + count_triangular(dimension - 1);
  }
}


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

x86 assembly (clang, -O2):
<count_triangular>:
test   %edi,%edi
jle    1119 <count_triangular+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_triangular(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void get_config_filename(char *filename, int buffersize) {
  sprintf(filename, "%s/%s", getenv("HOME"), ".a2dprc");
}


x86 assembly (clang, -O0):
<get_config_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeaf(%rip),%rsi
lea    0xeb3(%rip),%rcx
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_config_filename>:
push   %rbx
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <getenv@plt>
lea    0xec9(%rip),%rsi
lea    0xecd(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [8 x i8] c".a2dprc\00"
define void @get_config_filename(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [8 x i8] c".a2dprc\00"
define void @get_config_filename(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ scalbn(double, int);
float scalbnf(float x, int _exp) { return (float)scalbn((double)x, _exp); }


x86 assembly (clang, -O0):
<scalbnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%edi
call   1030 <scalbn@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbnf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <scalbn@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @scalbnf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load i32, i32* %4
%8 = call i64 @scalbn(double %6, i32 %7)
%9 = sitofp i64 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @scalbnf(float %0, i32 %1) {
%3 = fpext float %0 to double
%4 = tail call i64 @scalbn(double %3, i32 %1)
%5 = sitofp i64 %4 to float
ret float %5
}
void uppercase(char *text) {
  char *p = text;
  while (*p) {
    if (*p >= 'a' && *p <= 'z')
      *p += 'A' - 'a';
    p++;
  }
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <uppercase+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1149 <uppercase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1149 <uppercase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0xffffffe0,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <uppercase+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <uppercase+0x2a>
add    $0x1,%rdi
jmp    111b <uppercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <uppercase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <uppercase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <uppercase+0x10>
ret

LLVM IR (-O0):
define void @uppercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %28
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, -32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printFabs(float);
int /*<<< orphan*/ printNeg(float);
int main() {
  printNeg(-17.0f);
  printNeg(19.0f);
  printFabs(-23.0f);
  printFabs(25.0f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xee0(%rip),%xmm0
call   1030 <printNeg@plt>
movss  0xecf(%rip),%xmm0
call   1030 <printNeg@plt>
movss  0xebe(%rip),%xmm0
call   1040 <printFabs@plt>
movss  0xead(%rip),%xmm0
call   1040 <printFabs@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1030 <printNeg@plt>
movss  0xece(%rip),%xmm0
call   1030 <printNeg@plt>
movss  0xec5(%rip),%xmm0
call   1040 <printFabs@plt>
movss  0xebc(%rip),%xmm0
call   1040 <printFabs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printNeg(float -1.700000e+01)
%2 = call i32 @printNeg(float 1.900000e+01)
%3 = call i32 @printFabs(float -2.300000e+01)
%4 = call i32 @printFabs(float 2.500000e+01)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printNeg(float -1.700000e+01)
%2 = tail call i32 @printNeg(float 1.900000e+01)
%3 = tail call i32 @printFabs(float -2.300000e+01)
%4 = tail call i32 @printFabs(float 2.500000e+01)
ret i32 0
}
void localInterruptEnable(void) { asm("sti"); }


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

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

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

LLVM IR (-O2):
define void @localInterruptEnable() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int Operand_uimm12x8_encode(unsigned int *valp) {
  unsigned imm12_0, uimm12x8_0;
  uimm12x8_0 = *valp;
  imm12_0 = ((uimm12x8_0 >> 3) & 0xfff);
  *valp = imm12_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm12x8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x3,%eax
and    $0xfff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm12x8_encode>:
mov    (%rdi),%eax
shr    $0x3,%eax
and    $0xfff,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm12x8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = and i32 %8, 4095
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm12x8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 3
%4 = and i32 %3, 4095
store i32 %4, i32* %0
ret i32 0
}
void up_boot_secondary(int cpu, struct task_struct *idle) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @up_boot_secondary(i32 %0, %struct.task_struct* %1) {
%3 = alloca i32
%4 = alloca %struct.task_struct*
store i32 %0, i32* %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @up_boot_secondary(i32 %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int tfp_format(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vfprintf(FILE *f, const char *fmt, va_list va) {
  return tfp_format(f, fmt, va);
}


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

x86 assembly (clang, -O2):
<vfprintf>:
jmp    1030 <tfp_format@plt>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @tfp_format(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
__attribute__((no, noclone)) void f1(int v) {
  int x = -214748365 * (v - 1);
  if (x != -1932735285)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   $0xf3333333,%eax,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x8ccccccb,-0x8(%rbp)
je     113c <f1+0x2c>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
imul   $0xf3333333,%edi,%eax
cmp    $0x7ffffffe,%eax
jne    111e <f1+0xe>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = mul nsw i32 -214748365, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1932735285
br i1 %8, label %9, label %10
9: ; preds = %1
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
%2 = mul i32 %0, -214748365
%3 = icmp eq i32 %2, 2147483646
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe1() {
  Assert_real((isxdigit(225) == 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_isxdigit.c",
              1130, ("isxdigit should be 0 for 0xe1"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xe1>:
push   %rax
mov    $0xe1,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe1\00"
define void @t_isxdigit_0xe1() {
%1 = call i64 @isxdigit(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe1\00"
define void @t_isxdigit_0xe1() {
%1 = tail call i64 @isxdigit(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: nandtest [OPTIONS] <device>\n\n"
                  "  -h, --help		Display this help output\n"
                  "  -m, --markbad	Mark blocks bad if they appear so\n"
                  "  -s, --seed		Supply random seed\n"
                  "  -p, --passes		Number of passes\n"
                  "  -o, --offset		Start offset on flash\n"
                  "  -l, --length		Length of flash to test\n"
                  "  -k, --keep		Restore existing contents after test\n"
                  "Warning: it is just used for SLC NAND!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [360 x i8] c"usage: nandtest [OPTIONS] <device>\0A\0A -h, --help\09\09Display this help output\0A -m, --markbad\09Mark blocks bad if they appear so\0A -s, --seed\09\09Supply random seed\0A -p, --passes\09\09Number of passes\0A -o, --offset\09\09Start offset on flash\0A -l, --length\09\09Length of flash to test\0A -k, --keep\09\09Restore existing contents after test\0AWarning: it is just used for SLC NAND!\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([360 x i8], [360 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [360 x i8] c"usage: nandtest [OPTIONS] <device>\0A\0A -h, --help\09\09Display this help output\0A -m, --markbad\09Mark blocks bad if they appear so\0A -s, --seed\09\09Supply random seed\0A -p, --passes\09\09Number of passes\0A -o, --offset\09\09Start offset on flash\0A -l, --length\09\09Length of flash to test\0A -k, --keep\09\09Restore existing contents after test\0AWarning: it is just used for SLC NAND!\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([360 x i8], [360 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ atoi(char *);
int /*<<< orphan*/ check_argument(int, char **);
int /*<<< orphan*/ dump_file(char *, size_t);
int main(int argc, char **argv) {
  check_argument(argc, argv);
  dump_file(argv[1], (size_t)atoi(argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <check_argument@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1030 <dump_file@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <check_argument@plt>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <dump_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @check_argument(i32 %6, i8** %7)
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i64 @atoi(i8* %14)
%16 = call i32 @dump_file(i8* %11, i64 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @check_argument(i32 %0, i8** %1)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i64 @atoi(i8* %7)
%9 = tail call i32 @dump_file(i8* %5, i64 %8)
ret i32 0
}
/* Variables and functions */
int unlink(char *);
int remove_pid(char *pidfile) { return unlink(pidfile); }


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

x86 assembly (clang, -O2):
<remove_pid>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @remove_pid(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
int c2i(unsigned char temp[]) {
  int i;
  i = temp[0];
  i <<= 8;
  i |= temp[1];
  return (i);
}


x86 assembly (clang, -O0):
<c2i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2i>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @c2i(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @c2i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int fat(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Digite o numero para fatorar\n");
  scanf("%d", &n);
  printf("\nO fatorial de n e: %d\n\n", fat(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <fat@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite o numero para fatorar\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"\0AO fatorial de n e: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fat(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"\0AO fatorial de n e: %d\0A\0A\00"
@str = [29 x i8] c"Digite o numero para fatorar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fat(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(
      stderr,
      "Usage: bcc_tool [-r addr][-w addr data][-x data][-v][-V] [BITSTREAM] \n"
      "  BITSTREAM is a file containing the FPGA bitstream to download\n"
      "  -a cape at addr [0-3] (default = 0)\n"
      "  -r read SPI control port at addr\n"
      "  -w write SPI control port at addr w/ data\n"
      "  -x set aux bits 3:1 to data\n"
      "  -v enables verbose progress messages\n"
      "  -V prints the tool version\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [350 x i8] c"Usage: bcc_tool [-r addr][-w addr data][-x data][-v][-V] [BITSTREAM] \0A BITSTREAM is a file containing the FPGA bitstream to download\0A -a cape at addr [0-3] (default = 0)\0A -r read SPI control port at addr\0A -w write SPI control port at addr w/ data\0A -x set aux bits 3:1 to data\0A -v enables verbose progress messages\0A -V prints the tool version\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([350 x i8], [350 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [350 x i8] c"Usage: bcc_tool [-r addr][-w addr data][-x data][-v][-V] [BITSTREAM] \0A BITSTREAM is a file containing the FPGA bitstream to download\0A -a cape at addr [0-3] (default = 0)\0A -r read SPI control port at addr\0A -w write SPI control port at addr w/ data\0A -x set aux bits 3:1 to data\0A -v enables verbose progress messages\0A -V prints the tool version\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([350 x i8], [350 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
int h() {
  if (rand() % 2 == 0) {
    h();
  }
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1145 <h+0x25>
call   1030 <h@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
test   $0x1,%al
je     1120 <h+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @h() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @h()
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @h() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %0
ret i32 undef
}