xunge/DecIR huggingface dataset:
/* Variables and functions */
double atan(double);
double cos(double);
double log(double);
double rand_norm();
double sqrt(double);
double sample_gauss(void) {
  return sqrt(-2.0 * log(rand_norm())) *
         cos(2.0 * (4.0 * atan(1.0)) * rand_norm());
}


x86 assembly (clang, -O0):
<sample_gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand_norm@plt>
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xe8b(%rip),%xmm0
call   1040 <atan@plt>
movsd  0xe76(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand_norm@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_gauss>:
push   %rax
xor    %eax,%eax
call   1030 <rand_norm@plt>
call   1060 <log@plt>
mulsd  0xe9b(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1175 <sample_gauss+0x25>
sqrtsd %xmm0,%xmm0
jmp    117a <sample_gauss+0x2a>
call   1070 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0xe81(%rip),%xmm0
call   1040 <atan@plt>
xor    %eax,%eax
call   1030 <rand_norm@plt>
mulsd  0xe75(%rip),%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sample_gauss() {
%1 = call double (...) @rand_norm()
%2 = call double @log(double %1)
%3 = fmul double -2.000000e+00, %2
%4 = call double @sqrt(double %3)
%5 = call double @atan(double 1.000000e+00)
%6 = fmul double 4.000000e+00, %5
%7 = fmul double 2.000000e+00, %6
%8 = call double (...) @rand_norm()
%9 = fmul double %7, %8
%10 = call double @cos(double %9)
%11 = fmul double %4, %10
ret double %11
}

LLVM IR (-O2):
define double @sample_gauss() {
%1 = tail call double (...) @rand_norm()
%2 = tail call double @log(double %1)
%3 = fmul double %2, -2.000000e+00
%4 = tail call double @sqrt(double %3)
%5 = tail call double @atan(double 1.000000e+00)
%6 = tail call double (...) @rand_norm()
%7 = fmul double %6, 0x401921FB54442D18
%8 = tail call double @cos(double %7)
%9 = fmul double %4, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ check_log();
int /*<<< orphan*/ init_data();
int main() {
  init_data();
  for (;;) {
    check_log();
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init_data@plt>
mov    $0x0,%al
call   1040 <check_log@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_data@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <check_log@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_data()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @check_log()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_data()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @check_log()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xflags(int);
int /*<<< orphan*/ xtolower(int);
int /*<<< orphan*/ xtoupper(int);
int /*<<< orphan*/ xucs(int);
void xtables(int id) {
  xucs(id);
  printf("\n");
  xtolower(id);
  printf("\n");
  xtoupper(id);
  printf("\n");
  xflags(id);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<xtables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xucs@plt>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1060 <xtolower@plt>
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1070 <xtoupper@plt>
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <xflags@plt>
lea    0xe5a(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtables>:
push   %rbx
mov    %edi,%ebx
call   1030 <xucs@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %ebx,%edi
call   1060 <xtolower@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %ebx,%edi
call   1070 <xtoupper@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %ebx,%edi
call   1050 <xflags@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1040 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @xtables(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @xucs(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @xtolower(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @xtoupper(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @xflags(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @xtables(i32 %0) {
%2 = tail call i32 @xucs(i32 %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @xtolower(i32 %0)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @xtoupper(i32 %0)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @xflags(i32 %0)
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char);
int hex_ischar(char c) {
  assert(c);
  return (c >= 'A' && c <= 'F') || (c >= '0' && c <= '9') ||
         (c >= 'a' && c <= 'f');
}


x86 assembly (clang, -O0):
<hex_ischar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1146 <hex_ischar+0x36>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    118a <hex_ischar+0x7a>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1165 <hex_ischar+0x55>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    118a <hex_ischar+0x7a>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1184 <hex_ischar+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_ischar>:
push   %rbx
mov    %edi,%ebx
call   1030 <assert@plt>
lea    -0x30(%rbx),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex_ischar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @assert(i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 70
br i1 %11, label %30, label %12
12: ; preds = %8, %1
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 48
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 57
br i1 %19, label %30, label %20
20: ; preds = %16, %12
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 97
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 102
br label %28
28: ; preds = %24, %20
%29 = phi i1 [ false, %20 ], [ %27, %24 ]
br label %30
30: ; preds = %28, %16, %8
%31 = phi i1 [ true, %16 ], [ true, %8 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @hex_ischar(i8 signext %0) {
%2 = tail call i32 @assert(i8 signext %0)
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = and i8 %0, -33
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 6
%8 = or i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ nbuf;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
char *basename(char const *);
int get_dev_num(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int get_dev_by_name(const char *device, dev_t *dev) {
  char nbuf[4096];
  snprintf(nbuf, sizeof(nbuf), "/sys/block/%s/dev", basename(device));
  return get_dev_num(nbuf, dev);
}


x86 assembly (clang, -O0):
<get_dev_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    -0x1018(%rbp),%rdi
mov    %rax,%rcx
mov    $0x1000,%esi
lea    0xe90(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x1010(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <get_dev_num@plt>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dev_by_name>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rsi,%rbx
call   1040 <basename@plt>
lea    0xeb7(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x1000,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <get_dev_num@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/sys/block/%s/dev\00"
define i32 @get_dev_by_name(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
%9 = call i32 @snprintf(i8* %6, i32 4096, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%11 = load i32*, i32** %4
%12 = call i32 @get_dev_num(i8* %10, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [18 x i8] c"/sys/block/%s/dev\00"
define i32 @get_dev_by_name(i8* %0, i32* %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @basename(i8* %0)
%6 = call i32 @snprintf(i8* %4, i32 4096, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @get_dev_num(i8* %4, i32* %1)
ret i32 %7
}
long __syscall4(long n, long a1, long a2, long a3, long a4) {
  unsigned long __ret;
  __asm__ __volatile__("call __vsyscall"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <__vsyscall@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall4>:
mov    %rcx,%r9
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rax
mov    %r9,%rdi
mov    %r8,%rsi
call   1030 <__vsyscall@plt>
ret

LLVM IR (-O0):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %12, i64 %13, i64 %14, i64 %15, i64 %16)
store i64 %17, i64* %11
%18 = load i64, i64* %11
ret i64 %18
}

LLVM IR (-O2):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t cbor_peek_u32(uint8_t *data) {
  uint32_t value = ((uint32_t)data[0]) << 24 | ((uint32_t)data[1]) << 16 |
                   ((uint32_t)data[2]) << 8 | ((uint32_t)data[3]);
  return (uint64_t)value;
}


x86 assembly (clang, -O0):
<cbor_peek_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_peek_u32>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @cbor_peek_u32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int typeletter(type)
int type;
{
  switch (type) {
  case 1:
    return 'I';
  case 2:
    return 'L';
  case 4:
    return 'F';
  case 3:
    return 'D';
  case 0:
    return 'C';
  case 5:
    return 'B';
  default:
    assert(0);
  }
}


x86 assembly (clang, -O0):
<typeletter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     1188 <typeletter+0x78>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x49,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
movl   $0x4c,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
movl   $0x46,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
movl   $0x44,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
movl   $0x43,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
movl   $0x42,-0x4(%rbp)
jmp    1191 <typeletter+0x81>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typeletter>:
push   %rax
cmp    $0x6,%edi
jae    1125 <typeletter+0x15>
movslq %edi,%rax
lea    0xee0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
xor    %edi,%edi
xor    %eax,%eax
call   1030 <assert@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @typeletter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
i32 3, label %8
i32 0, label %9
i32 5, label %10
]
5: ; preds = %1
store i32 73, i32* %2
br label %13
6: ; preds = %1
store i32 76, i32* %2
br label %13
7: ; preds = %1
store i32 70, i32* %2
br label %13
8: ; preds = %1
store i32 68, i32* %2
br label %13
9: ; preds = %1
store i32 67, i32* %2
br label %13
10: ; preds = %1
store i32 66, i32* %2
br label %13
11: ; preds = %1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
br label %13
13: ; preds = %5, %6, %7, %8, %9, %10, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.typeletter = [6 x i32] [i32 67, i32 73, i32 76, i32 68, i32 70, i32 66]
define i32 @typeletter(i32 %0) {
%2 = icmp ult i32 %0, 6
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
br label %9
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.typeletter, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ undef, %3 ], [ %8, %5 ]
ret i32 %10
}
void capsule_zero_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @capsule_zero_stats() {
ret void
}
char *dgettext(domainname, msgid) const char *domainname;
const char *msgid;
{ return dgettext__(domainname, msgid); }


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

x86 assembly (clang, -O2):
<dgettext>:
push   %rax
xor    %eax,%eax
call   1030 <dgettext__@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @dgettext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dgettext__ to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @dgettext(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dgettext__ to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
long double __extenddftf2(double a __attribute__((unused))) { return 0.0; }


x86 assembly (clang, -O0):
<__extenddftf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldz
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @__extenddftf2(double %0) {
%2 = alloca double
store double %0, double* %2
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
define x86_fp80 @__extenddftf2(double %0) {
ret x86_fp80 0xK00000000000000000000
}
int open(const char *path, int oflag, ...) {
  int *ret = malloc(sizeof(int));
  if (ret) {
    __set_file_attribute(ret);
    if (ret < (int *)1)
      while (1)
        ;
    return ret;
  }
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1178 <open+0x58>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <__set_file_attribute@plt>
mov    $0x1,%eax
cmp    %rax,-0x20(%rbp)
jae    116c <open+0x4c>
jmp    1167 <open+0x47>
jmp    1167 <open+0x47>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    117f <open+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1152 <open+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <__set_file_attribute@plt>
test   %rbx,%rbx
jne    1157 <open+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1150 <open+0x30>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @open(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
%7 = call i8* @malloc(i64 4)
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32*, i32** %6
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @__set_file_attribute to i32 (i32*, ...)*)(i32* %12)
%14 = load i32*, i32** %6
%15 = icmp ult i32* %14, inttoptr (i64 1 to i32*)
br i1 %15, label %16, label %18
16: ; preds = %11
br label %17
17: ; preds = %16, %17
br label %17
18: ; preds = %11
%19 = load i32*, i32** %6
%20 = ptrtoint i32* %19 to i32
store i32 %20, i32* %3
br label %22
21: ; preds = %2
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = bitcast i8* %3 to i32*
%7 = tail call i32 (i32*, ...) bitcast (i32 (...)* @__set_file_attribute to i32 (i32*, ...)*)(i32* %6)
%8 = icmp ult i8* %3, inttoptr (i64 1 to i8*)
br i1 %8, label %9, label %10
9: ; preds = %5, %9
br label %9
10: ; preds = %5
%11 = ptrtoint i8* %3 to i64
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ %12, %10 ], [ -1, %2 ]
ret i32 %14
}
int fda_write(struct fda_state *state, const unsigned char *buff, int n) {
  return n;
}


x86 assembly (clang, -O0):
<fda_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fda_write>:
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.fda_state = type opaque
define i32 @fda_write(%struct.fda_state* %0, i8* %1, i32 %2) {
%4 = alloca %struct.fda_state*
%5 = alloca i8*
%6 = alloca i32
store %struct.fda_state* %0, %struct.fda_state** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.fda_state = type opaque
define i32 @fda_write(%struct.fda_state* nocapture readnone %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x43_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x43_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x43_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x43_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x43_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int ans, n;
  ans = 2;
  for (n = 3; ans <= 25;)
    ans = ans * n;
  printf("n = %d; ans = %d.\n", n, ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x19,-0x8(%rbp)
jg     1146 <main+0x36>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
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    $0x3,%esi
mov    $0x36,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"n = %d; ans = %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 25
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"n = %d; ans = %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3, i32 54)
ret i32 0
}
int count_scopemap(const char *str) {
  const char *ptr;
  int num = 0;
  for (ptr = str; *ptr; ptr++) {
    if (*ptr == ']') {
      num++;
    }
  }
  return num;
}


x86 assembly (clang, -O0):
<count_scopemap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <count_scopemap+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    113d <count_scopemap+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <count_scopemap+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <count_scopemap+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_scopemap>:
xor    %eax,%eax
jmp    1117 <count_scopemap+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x5d,%cl
je     1110 <count_scopemap+0x10>
test   %cl,%cl
jne    1113 <count_scopemap+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_scopemap(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 93, label %6
]
6: ; preds = %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
bool sancus_get_urzd(ssize_t v, ssize_t a, ssize_t b, unsigned *out) {
  if ((v >= a) && (v <= b)) {
    if (out != NULL)
      *out = (unsigned)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_urzd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1153 <sancus_get_urzd+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1153 <sancus_get_urzd+0x53>
cmpq   $0x0,-0x28(%rbp)
je     1147 <sancus_get_urzd+0x47>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115a <sancus_get_urzd+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_urzd>:
xor    %eax,%eax
cmp    %rsi,%rdi
jl     1118 <sancus_get_urzd+0x18>
cmp    %rdx,%rdi
jg     1118 <sancus_get_urzd+0x18>
mov    $0x1,%eax
test   %rcx,%rcx
je     1118 <sancus_get_urzd+0x18>
mov    %edi,(%rcx)
ret

LLVM IR (-O0):
define i32 @sancus_get_urzd(i64 %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32* %3, i32** %9
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = icmp sge i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %4
%14 = load i64, i64* %6
%15 = load i64, i64* %8
%16 = icmp sle i64 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i32*, i32** %9
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i64, i64* %6
%22 = trunc i64 %21 to i32
%23 = load i32*, i32** %9
store i32 %22, i32* %23
br label %24
24: ; preds = %20, %17
store i32 1, i32* %5
br label %26
25: ; preds = %13, %4
store i32 0, i32* %5
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @sancus_get_urzd(i64 %0, i64 %1, i64 %2, i32* writeonly %3) {
%5 = icmp slt i64 %0, %1
%6 = icmp sgt i64 %0, %2
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = icmp eq i32* %3, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = trunc i64 %0 to i32
store i32 %11, i32* %3
br label %12
12: ; preds = %4, %8, %10
%13 = phi i32 [ 1, %10 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;
typedef int volatile int32_t;

/* Variables and functions */
int32_t UARTCharGet(uint32_t ui32Base) {
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000010) {
  }
  return ((*((volatile uint32_t *)(ui32Base + 0x00000000))));
}


x86 assembly (clang, -O0):
<UARTCharGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1122 <UARTCharGet+0x22>
jmp    1107 <UARTCharGet+0x7>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGet>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x10,0x18(%rax)
jne    1110 <UARTCharGet+0x10>
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @UARTCharGet(i32 %0) {
%2 = add nsw i32 %0, 24
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %4
%7 = and i32 %6, 16
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = sext i32 %0 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
ret i32 %12
}
/* Variables and functions */
int smbw_chdir(char const *);
int chdir(const char *name) { return smbw_chdir(name); }


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

x86 assembly (clang, -O2):
<chdir>:
jmp    1030 <smbw_chdir@plt>

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

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = tail call i32 @smbw_chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo_multi(int, double);
void bar4() { foo_multi(1, 5.0); }


x86 assembly (clang, -O0):
<bar4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <foo_multi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar4>:
movsd  0xee8(%rip),%xmm0
mov    $0x1,%edi
jmp    1030 <foo_multi@plt>

LLVM IR (-O0):
define void @bar4() {
%1 = call i32 @foo_multi(i32 1, double 5.000000e+00)
ret void
}

LLVM IR (-O2):
define void @bar4() {
%1 = tail call i32 @foo_multi(i32 1, double 5.000000e+00)
ret void
}
int test_imm_34uint16_mem(unsigned short *val) {
  return ((*val) & (-0x34 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_34uint16_mem>:
movzwl (%rdi),%eax
test   $0xffcc,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -52
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
__m128i xx_loadu_128(const void *a) {
  return _mm_loadu_si128((const __m128i *)a);
}


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

x86 assembly (clang, -O2):
<xx_loadu_128>:
jmp    1030 <_mm_loadu_si128@plt>

LLVM IR (-O0):
define i32 @xx_loadu_128(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_mm_loadu_si128(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @xx_loadu_128(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm_loadu_si128(i32* %2)
ret i32 %3
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_voidptr(void *const k1, void *const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_voidptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_voidptr>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_voidptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_voidptr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_05uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 5
%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_05uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 327680
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int, int /*<<< orphan*/, struct winsize *);
int getColumns(void) {
  struct winsize ws;
  if (ioctl(1, TIOCGWINSZ, &ws) == -1)
    return 80;
  return ws.ws_col;
}


x86 assembly (clang, -O0):
<getColumns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1144 <getColumns+0x34>
movl   $0x50,-0x4(%rbp)
jmp    114a <getColumns+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColumns>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x1,%edi
call   1030 <ioctl@plt>
mov    %eax,%ecx
mov    $0x50,%eax
cmp    $0xffffffff,%ecx
je     1136 <getColumns+0x26>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @getColumns() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 80, i32* %1
br label %10
7: ; preds = %0
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @getColumns() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %1)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 80, i32 %7
ret i32 %8
}
/* Variables and functions */
int strlen(char const *);
int lo_strsize(const char *s) { return 4 * (strlen(s) / 4 + 1); }


x86 assembly (clang, -O0):
<lo_strsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
shl    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lo_strsize>:
push   %rax
call   1030 <strlen@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
and    $0xfffffffc,%eax
add    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lo_strsize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = sdiv i32 %4, 4
%6 = add nsw i32 %5, 1
%7 = mul nsw i32 4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @lo_strsize(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sdiv i32 %2, 4
%4 = shl nsw i32 %3, 2
%5 = add i32 %4, 4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ crmode();
flush_in() { crmode(); }


x86 assembly (clang, -O0):
<flush_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <crmode@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flush_in() {
%1 = alloca i32
%2 = call i32 (...) @crmode()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @flush_in() {
%1 = tail call i32 (...) @crmode()
ret i32 undef
}
unsigned int f18(unsigned int x, long int y) {
  return (x >> (8 * 4 - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f18>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f18(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 32, %6
%8 = trunc i64 %7 to i32
%9 = lshr i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f18(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = lshr i32 %0, %4
%6 = shl i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main() {
  int i;
  char *new (int);
  void free(char *);
  char *p, *p1 = p;
  for (i = 0; i <= 5; i++) {
    *p++ = 'c';
  }
  *p = '\0';
  free(p1);
  printf("%s", p1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x63,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = load i8*, i8** %2
store i8* %4, i8** %3
store i32 0, i32* %1
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %1
%7 = icmp sle i32 %6, 5
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
store i8 99, i8* %9
br label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
store i8 0, i8* %15
%16 = load i8*, i8** %3
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
int main() {
  int students;
  int *studentsp;
  students = 12;
  studentsp = &students;
  printf("students:  %d\n", students);
  printf("studentsp: %d\n", studentsp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec5(%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
movl   $0xc,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"students: %d\0A\00"
@.str.1 = [15 x i8] c"studentsp: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcreatewindow_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct Athena_Thread {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Athena_Thread *);
void Athena_DestroyThread(struct Athena_Thread *thr) { free(thr); }


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

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

LLVM IR (-O0):
%struct.Athena_Thread = type { i32 }
define void @Athena_DestroyThread(%struct.Athena_Thread* %0) {
%2 = alloca %struct.Athena_Thread*
store %struct.Athena_Thread* %0, %struct.Athena_Thread** %2
%3 = load %struct.Athena_Thread*, %struct.Athena_Thread** %2
%4 = call i32 @free(%struct.Athena_Thread* %3)
ret void
}

LLVM IR (-O2):
%struct.Athena_Thread = type { i32 }
define void @Athena_DestroyThread(%struct.Athena_Thread* nocapture %0) {
%2 = tail call i32 @free(%struct.Athena_Thread* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void __vpr_stat(const char *fmt, va_list ap) {
  vprintf(fmt, ap);
  printf("\n");
}


x86 assembly (clang, -O0):
<__vpr_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <vprintf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vpr_stat>:
push   %rax
call   1040 <vprintf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @__vpr_stat(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 = load i32, i32* %4
%7 = call i32 @vprintf(i8* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @__vpr_stat(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
%4 = tail call i32 @putchar(i32 10)
ret void
}