xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void checkendianness() {
  unsigned int a = 1;
  char *p = (char *)&a;
  if (*p == 1) {
    printf(" Little Endian\n");
  } else {
    printf(" Big Endian\n");
  }
}


x86 assembly (clang, -O0):
<checkendianness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1148 <checkendianness+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <checkendianness+0x44>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c" Little Endian\0A\00"
@.str.1 = [13 x i8] c" Big Endian\0A\00"
define void @checkendianness() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c" Little Endian\00"
define void @checkendianness() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void willusgui_send_quit_message(void) {}


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

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

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

LLVM IR (-O2):
define void @willusgui_send_quit_message() {
ret void
}
float timedey(float x, float z, float x2, float z2, float x3, float z3, float J,
              float Delta, float zcoupling) {
  return J * (Delta * x * (z2 + z3) - z * (x2 + x3) - x * zcoupling);
}


x86 assembly (clang, -O0):
<timedey>:
push   %rbp
mov    %rsp,%rbp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
addss  -0x18(%rbp),%xmm3
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm4
addss  -0x14(%rbp),%xmm4
mulss  %xmm4,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
movss  0x10(%rbp),%xmm3
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timedey>:
mulss  %xmm0,%xmm7
addss  %xmm5,%xmm3
mulss  %xmm7,%xmm3
addss  %xmm4,%xmm2
mulss  %xmm1,%xmm2
subss  %xmm2,%xmm3
mulss  0x8(%rsp),%xmm0
subss  %xmm0,%xmm3
mulss  %xmm6,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @timedey(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %16
%20 = load float, float* %17
%21 = load float, float* %10
%22 = fmul float %20, %21
%23 = load float, float* %13
%24 = load float, float* %15
%25 = fadd float %23, %24
%26 = load float, float* %11
%27 = load float, float* %12
%28 = load float, float* %14
%29 = fadd float %27, %28
%30 = fmul float %26, %29
%31 = fneg float %30
%32 = call float @llvm.fmuladd.f32(float %22, float %25, float %31)
%33 = load float, float* %10
%34 = load float, float* %18
%35 = fneg float %33
%36 = call float @llvm.fmuladd.f32(float %35, float %34, float %32)
%37 = fmul float %19, %36
ret float %37
}

LLVM IR (-O2):
define float @timedey(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = fmul float %0, %7
%11 = fadd float %3, %5
%12 = fadd float %2, %4
%13 = fneg float %12
%14 = fmul float %13, %1
%15 = tail call float @llvm.fmuladd.f32(float %10, float %11, float %14)
%16 = fneg float %0
%17 = tail call float @llvm.fmuladd.f32(float %16, float %8, float %15)
%18 = fmul float %17, %6
ret float %18
}
eq(a, b) char *a, *b;
{
  register int i;
  i = 0;
l:
  if (a[i] != b[i])
    return (0);
  if (a[i++] == '\0')
    return (1);
  goto l;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     113f <eq+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    116f <eq+0x6f>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    116a <eq+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    116f <eq+0x6f>
jmp    1113 <eq+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1126 <eq+0x26>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <eq+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @eq(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i64 [ %11, %10 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = add nuw i64 %4, 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %10, %3
%14 = phi i32 [ 0, %3 ], [ 1, %10 ]
ret i32 %14
}
/* Variables and functions */
int nondet_int();
int main() {
  short a;
  int b = nondet_int();
  a = (short)b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0x2(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i16
%2 = alloca i32
%3 = call i32 (...) @nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i16
store i16 %5, i16* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
ret i32 0
}
void dump_heap(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @dump_heap(i8* nocapture %0) {
ret void
}
int test_imm_A1int8_reg(signed char val) {
  return ((val) & (-0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A1int8_reg>:
test   $0xffffff5f,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A1int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -161
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void pcie_aspm_pm_state_change(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pcie_aspm_pm_state_change(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_aspm_pm_state_change(%struct.pci_dev* nocapture %0) {
ret void
}
float QuarticEaseIn(float p) { return p * p * p * p; }


x86 assembly (clang, -O0):
<QuarticEaseIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuarticEaseIn>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @QuarticEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = fmul float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @QuarticEaseIn(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fmul float %3, %0
ret float %4
}
void init_buffer(char buffer[4096], int size, int *posn) {
  int pos;
  pos = 0;
  while (pos <= size) {
    buffer[pos] = '\0';
    pos = pos + 1;
  }
  buffer[4096 + 1] = '\0';
  *posn = 0;
}


x86 assembly (clang, -O0):
<init_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     113c <init_buffer+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <init_buffer+0x16>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1001(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
test   %esi,%esi
js     112e <init_buffer+0x1e>
mov    %esi,%edx
add    $0x1,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movb   $0x0,0x1001(%rbx)
movl   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @init_buffer(i8* nocapture writeonly %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = add nuw nsw i64 %6, 1
br label %8
8: ; preds = %5, %3
%9 = getelementptr inbounds i8, i8* %0, i64 4097
store i8 0, i8* %9
store i32 0, i32* %2
ret void
}
float __attribute__((cold)) f1(float f) { return __builtin_rintf(f); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <rintf@plt>
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define float @f1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.rint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @f1(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
void CheckExitRules(void) { return; }


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

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

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

LLVM IR (-O2):
define void @CheckExitRules() {
ret void
}
/* Variables and functions */
int foo(int);
int entrypoint() {
  int y;
  return foo(y);
}


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

x86 assembly (clang, -O2):
<entrypoint>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = tail call i32 @foo(i32 undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printEntry();
int /*<<< orphan*/ printExit();
int /*<<< orphan*/ printMessage(char *);
int /*<<< orphan*/ printProcessing();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  printEntry();
  printProcessing();
  printMessage("helloWorld");
  printExit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <printEntry@plt>
mov    $0x0,%al
call   1060 <printProcessing@plt>
lea    0xe95(%rip),%rdi
call   1040 <printMessage@plt>
mov    $0x0,%al
call   1030 <printExit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <printEntry@plt>
xor    %eax,%eax
call   1060 <printProcessing@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printMessage@plt>
xor    %eax,%eax
call   1030 <printExit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"helloWorld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printEntry()
%4 = tail call i32 (...) @printProcessing()
%5 = tail call i32 @printMessage(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @printExit()
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double mtime() {
  double gettime;
  struct timeval now;
  gettimeofday(&now, 0);
  gettime = 1000000 * now.tv_sec + now.tv_usec;
  gettime /= 1000000;
  return gettime;
}


x86 assembly (clang, -O0):
<mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @mtime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
store double %10, double* %1
%11 = load double, double* %1
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @mtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+06
ret double %11
}
char *chstr(c)
int c;
{
  static char s[8];
  char *cp = s;
  if (c < 040) {
    sprintf(cp, "CTRL-%c", ((c) ^ 64));
  } else
    sprintf(cp, "'%c'\n", c);
  cp = s;
  return (cp);
}


x86 assembly (clang, -O0):
<chstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2f07(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    114d <chstr+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    $0x40,%edx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1162 <chstr+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ec0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chstr>:
push   %rax
mov    %edi,%edx
cmp    $0x1f,%edi
jg     112b <chstr+0x1b>
xor    $0x40,%edx
lea    0x2f07(%rip),%rdi
lea    0xed7(%rip),%rsi
jmp    1139 <chstr+0x29>
lea    0x2ef7(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x2ee2(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@chstr.s = internal global [8 x i8] zeroinitializer
@.str = [8 x i8] c"CTRL-%c\00"
@.str.1 = [6 x i8] c"'%c'\0A\00"
define i8* @chstr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @chstr.s, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i32, i32* %2
%9 = xor i32 %8, 64
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %2
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @chstr.s, i64 0, i64 0), i8** %3
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@chstr.s = internal global [8 x i8] zeroinitializer
@.str = [8 x i8] c"CTRL-%c\00"
@.str.1 = [6 x i8] c"'%c'\0A\00"
define i8* @chstr(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = xor i32 %0, 64
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @chstr.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @chstr.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %3
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @chstr.s, i64 0, i64 0)
}
ginc(lval) int lval[];
{
  if (lval[2] == (2 << 2))
    ol("addl2\t$4,r0");
  else
    ol("incl\tr0");
}


x86 assembly (clang, -O0):
<ginc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x8,0x8(%rax)
jne    113d <ginc+0x2d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    114b <ginc+0x3b>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ginc>:
cmpl   $0x8,0x8(%rdi)
lea    0xee5(%rip),%rax
lea    0xeea(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"addl2\09$4,r0\00"
@.str.1 = [8 x i8] c"incl\09r0\00"
define i32 @ginc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 8
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"addl2\09$4,r0\00"
@.str.1 = [8 x i8] c"incl\09r0\00"
define i32 @ginc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 8
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int gdialogPresent(void) {
  static int lGdialoglPresent = -1;
  if (lGdialoglPresent < 0) {
    lGdialoglPresent = detectPresence("gdialog");
  }
  return lGdialoglPresent && graphicMode();
}


x86 assembly (clang, -O0):
<gdialogPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <gdialogPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <gdialogPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdialogPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <gdialogPresent+0x23>
test   %eax,%eax
je     1159 <gdialogPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <gdialogPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@gdialogPresent.lGdialoglPresent = internal global i32 -1
@.str = [8 x i8] c"gdialog\00"
define i32 @gdialogPresent() {
%1 = load i32, i32* @gdialogPresent.lGdialoglPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gdialogPresent.lGdialoglPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @gdialogPresent.lGdialoglPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@gdialogPresent.lGdialoglPresent = internal unnamed_addr global i32 -1
@.str = [8 x i8] c"gdialog\00"
define i32 @gdialogPresent() {
%1 = load i32, i32* @gdialogPresent.lGdialoglPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @gdialogPresent.lGdialoglPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int __u64;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_ct(__u32 c, __u64 l) {
  printf("%03d %04d %04d - %lld.%06lld\n", c >> 25, c >> 12 & 0x1fff, c & 0xfff,
         l / 1000000, l % 1000000);
}


x86 assembly (clang, -O0):
<print_ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sar    $0x19,%esi
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
and    $0x1fff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xfff,%ecx
mov    -0x8(%rbp),%eax
mov    $0xf4240,%edi
cltd
idiv   %edi
mov    %eax,%r8d
mov    -0x8(%rbp),%eax
mov    $0xf4240,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0xc(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ct>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x19,%eax
mov    %edi,%edx
shr    $0xc,%edx
and    $0x1fff,%edx
and    $0xfff,%ecx
movslq %esi,%r9
imul   $0x431bde83,%r9,%r8
mov    %r8,%rsi
shr    $0x3f,%rsi
sar    $0x32,%r8
add    %esi,%r8d
imul   $0xf4240,%r8d,%esi
sub    %esi,%r9d
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%03d %04d %04d - %lld.%06lld\0A\00"
define void @print_ct(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 = ashr i32 %5, 25
%7 = load i32, i32* %3
%8 = ashr i32 %7, 12
%9 = and i32 %8, 8191
%10 = load i32, i32* %3
%11 = and i32 %10, 4095
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 1000000
%14 = load i32, i32* %4
%15 = srem i32 %14, 1000000
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %11, i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%03d %04d %04d - %lld.%06lld\0A\00"
define void @print_ct(i32 %0, i32 %1) {
%3 = ashr i32 %0, 25
%4 = lshr i32 %0, 12
%5 = and i32 %4, 8191
%6 = and i32 %0, 4095
%7 = sdiv i32 %1, 1000000
%8 = srem i32 %1, 1000000
%9 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int rand();
int wacky_add(int a, int b) { return a + b + rand() % 10; }


x86 assembly (clang, -O0):
<wacky_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wacky_add>:
push   %rbx
lea    (%rdi,%rsi,1),%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wacky_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 10
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @wacky_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 10
%6 = add nsw i32 %3, %5
ret i32 %6
}
int ccmp(const void *b1, const void *b2) {
  char *c1 = (char *)b1, *c2 = (char *)b2;
  if (*c1 < *c2)
    return -1;
  return *c1 > *c2;
}


x86 assembly (clang, -O0):
<ccmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    113e <ccmp+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <ccmp+0x59>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccmp>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ccmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int null_set_device(const char *card, const char *channel) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_set_device(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void ende(void) {
  printf("\n\nEingabe abgeschlossen! Enter druecken zum Beenden!");
  char dummy[2];
  fgets(dummy, 2, stdin);
  fgets(dummy, 2, stdin);
  exit(0);
}


x86 assembly (clang, -O0):
<ende>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x2(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1040 <fgets@plt>
lea    -0x2(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1040 <fgets@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ende>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%r14
mov    (%r14),%edx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <fgets@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <fgets@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\0A\0AEingabe abgeschlossen! Enter druecken zum Beenden!\00"
@stdin = global i32 0
define void @ende() {
%1 = alloca [2 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 2, i32 %4)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 2, i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"\0A\0AEingabe abgeschlossen! Enter druecken zum Beenden!\00"
@stdin = global i32 0
define void @ende() {
%1 = alloca [2 x i8]
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 2, i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 2, i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int utf8_strlen_screen(char const *);
int config_check_separator(const void *pointer, void *data,
                           struct t_config_option *option, const char *value) {
  (void)pointer;
  (void)data;
  (void)option;
  return (utf8_strlen_screen(value) <= 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_check_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <utf8_strlen_screen@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmovle %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_check_separator>:
push   %rax
mov    %rcx,%rdi
call   1030 <utf8_strlen_screen@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define i32 @config_check_separator(i8* %0, i8* %1, %struct.t_config_option* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.t_config_option*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.t_config_option* %2, %struct.t_config_option** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.t_config_option*, %struct.t_config_option** %7
%12 = load i8*, i8** %8
%13 = call i32 @utf8_strlen_screen(i8* %12)
%14 = icmp sle i32 %13, 1
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define i32 @config_check_separator(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @utf8_strlen_screen(i8* %3)
%6 = icmp slt i32 %5, 2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int hs_usage() {
  fprintf(stdout,
          "Usage: hs [action] [strings]"
          "	hs [add/del] [name=value] add name and value to hash table\n"
          "	hs commit save name and value to file\n"
          "	hs get [name] get value of name\n");
}


x86 assembly (clang, -O0):
<hs_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [161 x i8] c"Usage: hs [action] [strings]\09hs [add/del] [name=value] add name and value to hash table\0A\09hs commit save name and value to file\0A\09hs get [name] get value of name\0A\00"
define i32 @hs_usage() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [161 x i8] c"Usage: hs [action] [strings]\09hs [add/del] [name=value] add name and value to hash table\0A\09hs commit save name and value to file\0A\09hs get [name] get value of name\0A\00"
define i32 @hs_usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test_imm_E5int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E5int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 229
%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_E5int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 983547510784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CompilerDay(char *);
int /*<<< orphan*/ CompilerMonth(char *);
int /*<<< orphan*/ CompilerYear(char *);
double julian(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
double CompilerDateToJulian() {
  return julian(CompilerYear("Mar 17 2022"), CompilerMonth("Mar 17 2022"),
                CompilerDay("Mar 17 2022"));
}


x86 assembly (clang, -O0):
<CompilerDateToJulian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <CompilerYear@plt>
mov    %eax,-0x8(%rbp)
lea    0xea2(%rip),%rdi
call   1040 <CompilerMonth@plt>
mov    %eax,-0x4(%rbp)
lea    0xe93(%rip),%rdi
call   1060 <CompilerDay@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1030 <julian@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompilerDateToJulian>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%r14
mov    %r14,%rdi
call   1050 <CompilerYear@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <CompilerMonth@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1060 <CompilerDay@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <julian@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 17 2022\00"
define double @CompilerDateToJulian() {
%1 = call i32 @CompilerYear(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @CompilerMonth(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @CompilerDay(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call double @julian(i32 %1, i32 %2, i32 %3)
ret double %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mar 17 2022\00"
define double @CompilerDateToJulian() {
%1 = tail call i32 @CompilerYear(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @CompilerMonth(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @CompilerDay(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call double @julian(i32 %1, i32 %2, i32 %3)
ret double %4
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void wl_data_device_release(struct wl_data_device *wl_data_device) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_device, 2);
  wl_proxy_destroy((struct wl_proxy *)wl_data_device);
}


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

x86 assembly (clang, -O2):
<wl_data_device_release>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_data_device = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_release(%struct.wl_data_device* %0) {
%2 = alloca %struct.wl_data_device*
store %struct.wl_data_device* %0, %struct.wl_data_device** %2
%3 = load %struct.wl_data_device*, %struct.wl_data_device** %2
%4 = bitcast %struct.wl_data_device* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 2)
%6 = load %struct.wl_data_device*, %struct.wl_data_device** %2
%7 = bitcast %struct.wl_data_device* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_data_device = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_device_release(%struct.wl_data_device* %0) {
%2 = bitcast %struct.wl_data_device* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 2)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
int _lseek(int fd, int ptr, int dir) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
int test_imm_FCint16_mem(short *val) {
  return ((*val) & (0xFC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FCint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 252
%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_FCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 252
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((noipa)) int foo(void *p, int x) {
  if (p == ((void *)1))
    return 0;
  if (!p)
    p = x ? ((void *)2) : ((void *)1);
  return p == ((void *)1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x1,%eax
cmp    %rax,-0x10(%rbp)
jne    1126 <foo+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1162 <foo+0x62>
cmpq   $0x0,-0x10(%rbp)
jne    1149 <foo+0x49>
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%rdi
je     1121 <foo+0x21>
test   %rdi,%rdi
jne    1117 <foo+0x17>
cmp    $0x1,%esi
mov    $0x2,%edi
sbb    $0x0,%rdi
xor    %eax,%eax
cmp    $0x1,%rdi
setne  %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
switch i64 %3, label %7 [
i64 1, label %11
i64 0, label %4
]
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ %0, %2 ]
%9 = icmp ne i8* %8, inttoptr (i64 1 to i8*)
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
size_t convertTextToWchars(int /*<<< orphan*/ *, char const *,
                           int /*<<< orphan*/);
size_t getTextLength(const char *text) {
  return convertTextToWchars(NULL, text, 0);
}


x86 assembly (clang, -O0):
<getTextLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
call   1030 <convertTextToWchars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTextLength>:
mov    %rdi,%rsi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <convertTextToWchars@plt>

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

LLVM IR (-O2):
define i64 @getTextLength(i8* %0) {
%2 = tail call i64 @convertTextToWchars(i32* null, i8* %0, i32 0)
ret i64 %2
}