xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t aes_getreadcount() {
  return (*((volatile uint32_t *)0x10009000) >> 5) & 0x1F;
}


x86 assembly (clang, -O0):
<aes_getreadcount>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10009000,%eax
mov    (%rax),%eax
sar    $0x5,%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_getreadcount>:
mov    0x10009000,%eax
shr    $0x5,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @aes_getreadcount() {
%1 = load volatile i32, i32* inttoptr (i64 268472320 to i32*)
%2 = ashr i32 %1, 5
%3 = and i32 %2, 31
ret i32 %3
}

LLVM IR (-O2):
define i32 @aes_getreadcount() {
%1 = load volatile i32, i32* inttoptr (i64 268472320 to i32*)
%2 = lshr i32 %1, 5
%3 = and i32 %2, 31
ret i32 %3
}
long conv_s32(unsigned long x) {
  if (x & 0x80000000UL)
    return x | ~0xffffffffUL;
  return x;
}


x86 assembly (clang, -O0):
<conv_s32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1137 <conv_s32+0x37>
movabs $0xffffffff00000000,%rax
ff ff ff
or     -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113f <conv_s32+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_s32>:
movabs $0xffffffff00000000,%rax
ff ff ff
or     %rdi,%rax
test   $0x80000000,%edi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @conv_s32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 2147483648
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = or i64 %8, -4294967296
store i64 %9, i64* %2
br label %12
10: ; preds = %1
%11 = load i64, i64* %3
store i64 %11, i64* %2
br label %12
12: ; preds = %10, %7
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @conv_s32(i64 %0) {
%2 = and i64 %0, 2147483648
%3 = icmp eq i64 %2, 0
%4 = or i64 %0, -4294967296
%5 = select i1 %3, i64 %0, i64 %4
ret i64 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint16_t LCDIDDStatusRead(uint32_t ui32Base, uint32_t ui32CS) {
  uint32_t ui32Reg;
  ASSERT(ui32Base == 0x44050000);
  ASSERT((ui32CS == 0) || (ui32CS == 1));
  ui32Reg = ui32CS ? 0x00000020 : 0x00000014;
  return ((uint16_t)(*((volatile uint32_t *)(ui32Base + ui32Reg))));
}


x86 assembly (clang, -O0):
<LCDIDDStatusRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     114b <LCDIDDStatusRead+0x3b>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
mov    $0x14,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDStatusRead>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setb   %dil
call   1030 <ASSERT@plt>
test   %ebx,%ebx
mov    $0x14,%eax
mov    $0x20,%ecx
cmove  %eax,%ecx
movslq %ebp,%rax
mov    (%rcx,%rax,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @LCDIDDStatusRead(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1141178368
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ true, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @ASSERT(i32 %17)
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 32, i32 20
store i32 %22, i32* %5
%23 = load i32, i32* %3
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @LCDIDDStatusRead(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141178368
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp ult i32 %1, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = icmp eq i32 %1, 0
%10 = select i1 %9, i32 20, i32 32
%11 = add nsw i32 %10, %0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ output_ascii(char *);
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(2. * 3.14159265358979323846)) {
    output_timing();
  }
  if (output_check(2. * 3.14159265358979323846)) {
    output_ascii("positions.txt");
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1050 <output_check@plt>
cmp    $0x0,%rax
je     114f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
cmp    $0x0,%rax
je     116f <problem_output+0x3f>
lea    0xe96(%rip),%rdi
call   1040 <output_ascii@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x6,%edi
call   1050 <output_check@plt>
test   %rax,%rax
je     1147 <problem_output+0x17>
xor    %eax,%eax
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
test   %rax,%rax
je     1163 <problem_output+0x33>
lea    0xea3(%rip),%rdi
pop    %rax
jmp    1040 <output_ascii@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"positions.txt\00"
define void @problem_output() {
%1 = call i64 @output_check(i32 6)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
%6 = call i64 @output_check(i32 6)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @output_ascii(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"positions.txt\00"
define void @problem_output() {
%1 = tail call i64 @output_check(i32 6)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @output_check(i32 6)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @output_ascii(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
txt_program(chan, program) {
  prtime();
  printf("Program, chan=%d program=%d\n", chan + 1, program);
}


x86 assembly (clang, -O0):
<txt_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_program>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Program, chan=%d program=%d\0A\00"
define i32 @txt_program(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @prtime()
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [29 x i8] c"Program, chan=%d program=%d\0A\00"
define i32 @txt_program(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = add nsw i32 %0, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret i32 undef
}
/* Type definitions */
struct p7_timer_event {
  int dummy;
};
struct p7_minheap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ heap_delete(struct p7_timer_event *, struct p7_minheap *);
void timer_remove_event(struct p7_timer_event *ev, struct p7_minheap *heap) {
  heap_delete(ev, heap);
}


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

x86 assembly (clang, -O2):
<timer_remove_event>:
jmp    1030 <heap_delete@plt>

LLVM IR (-O0):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define void @timer_remove_event(%struct.p7_timer_event* %0, %struct.p7_minheap* %1) {
%3 = alloca %struct.p7_timer_event*
%4 = alloca %struct.p7_minheap*
store %struct.p7_timer_event* %0, %struct.p7_timer_event** %3
store %struct.p7_minheap* %1, %struct.p7_minheap** %4
%5 = load %struct.p7_timer_event*, %struct.p7_timer_event** %3
%6 = load %struct.p7_minheap*, %struct.p7_minheap** %4
%7 = call i32 @heap_delete(%struct.p7_timer_event* %5, %struct.p7_minheap* %6)
ret void
}

LLVM IR (-O2):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define void @timer_remove_event(%struct.p7_timer_event* %0, %struct.p7_minheap* %1) {
%3 = tail call i32 @heap_delete(%struct.p7_timer_event* %0, %struct.p7_minheap* %1)
ret void
}
int s_typeisshm(struct stat *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @s_typeisshm(%struct.stat* nocapture readnone %0) {
ret i32 0
}
isatty(f) { return (f >= 0 && f <= 2); }


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isatty+0x20>
cmpl   $0x2,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
int verify_benchmark(int r) {
  int expected = 180;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xb4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0xb4,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @verify_benchmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 180, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 180
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sha256(unsigned char *, unsigned int, unsigned char *);
void CodecGetSHABinary(unsigned char *data, int length, unsigned char *digest) {
  sha256(data, (unsigned int)length, digest);
}


x86 assembly (clang, -O0):
<CodecGetSHABinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <sha256@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CodecGetSHABinary>:
jmp    1030 <sha256@plt>

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

LLVM IR (-O2):
define void @CodecGetSHABinary(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @sha256(i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void wtypeStr_foreachPrint(const void *element, const void *foreachData) {
  printf("%s%s", (char *)element, foreachData ? (char *)foreachData : "");
}


x86 assembly (clang, -O0):
<wtypeStr_foreachPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <wtypeStr_foreachPrint+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <wtypeStr_foreachPrint+0x40>
lea    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <wtypeStr_foreachPrint+0x40>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtypeStr_foreachPrint>:
mov    %rdi,%rax
test   %rsi,%rsi
lea    0xee7(%rip),%rdx
cmovne %rsi,%rdx
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @wtypeStr_foreachPrint(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 ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %10 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @wtypeStr_foreachPrint(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
void mystery1(char *s1, const char *s2) {
  while (*s1 != '\0') {
    ++s1;
  }
  while (*s1 = *s2) {
    ++s1, ++s2;
  }
  return;
}


x86 assembly (clang, -O0):
<mystery1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <mystery1+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystery1+0xc>
jmp    1132 <mystery1+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1163 <mystery1+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <mystery1+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery1>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <mystery1>
mov    (%rsi),%al
mov    %al,-0x1(%rdi)
test   %al,%al
je     1130 <mystery1+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <mystery1+0x20>
ret

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

LLVM IR (-O2):
define void @mystery1(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %15, %11 ], [ %1, %8 ]
%13 = phi i8* [ %14, %11 ], [ %4, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int b = 2;
  assert(b > 1);
  printf("b > 1\n");
  assert(b > 3);
  printf("b > 3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assert@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <assert@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"b > 1\0A\00"
@.str.1 = [7 x i8] c"b > 3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"b > 1\00"
@str.2 = [6 x i8] c"b > 3\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [file ...]\n", getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sD() {
  dash();
  dot();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sD>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sD>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sD() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sD() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @cBreak()
ret void
}
void main(void) { int a[] = {}; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [0 x i32]
%2 = bitcast [0 x i32]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void yy_1_ListItem(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ListItem(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, char *, int *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int openPipe(char *name) {
  int fd;
  int80(33, name, &fd, 0, 0, 0);
  return fd;
}


x86 assembly (clang, -O0):
<openPipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x21,%edi
lea    -0xc(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openPipe>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdx
mov    $0x21,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @openPipe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @int80(i32 33, i8* %4, i32* %3, i32 0, i32 0, i32 0)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @openPipe(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @int80(i32 33, i8* %0, i32* %2, i32 0, i32 0, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  if (0)
    if (0)
      puts("1");
    else if (0)
      if (1)
        puts("2");
      else
        puts("3");
    else
      puts("4");
  else
    puts("5");
  if (0) {
    if (0) {
      puts("1");
    } else if (0) {
      if (1)
        puts("2");
      else
        puts("3");
    } else
      puts("4");
  } else
    puts("5");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"5\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int read(int, unsigned long long *, int);
int /*<<< orphan*/ vmentry();
int /*<<< orphan*/ vmexit();
void wait_for_notify(int fd) {
  unsigned long long v = 1;
  int r;
  vmexit();
  r = read(fd, &v, sizeof v);
  assert(r == sizeof v);
  vmentry();
}


x86 assembly (clang, -O0):
<wait_for_notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <vmexit@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x8,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1060 <vmentry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_notify>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movq   $0x1,0x8(%rsp)
xor    %eax,%eax
call   1030 <vmexit@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    $0x8,%edx
call   1040 <read@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1060 <vmentry@plt>

LLVM IR (-O0):
define void @wait_for_notify(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 %0, i32* %2
store i64 1, i64* %3
%5 = call i32 (...) @vmexit()
%6 = load i32, i32* %2
%7 = call i32 @read(i32 %6, i64* %3, i32 8)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = icmp eq i64 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 (...) @vmentry()
ret void
}

LLVM IR (-O2):
define void @wait_for_notify(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 1, i64* %2
%4 = tail call i32 (...) @vmexit()
%5 = call i32 @read(i32 %0, i64* %2, i32 8)
%6 = icmp eq i32 %5, 8
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (...) @vmentry()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void logcb(int level, const char *log) {
  fputs(log, stdout);
  fputc('\n', stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<logcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logcb>:
push   %rbx
mov    %rsi,%rdi
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @logcb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fputc(i8 signext 10, i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @logcb(i32 %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %1, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 10, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}
/* Variables and functions */
int getpagesize();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("%u\n", getpagesize()); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpagesize()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void outb(unsigned char val, int port) {
  __asm__ __volatile__("outb %b0, %w1" : : "a"(val), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %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
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i32 %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i32 %1)
ret void
}
void move_u(unsigned long *p, unsigned short *o) {
  *p = (((*p) >> 3) & 07770000) | (((*p) << 9) & 070000000) | ((*p) & 07777);
  *o = (((*o) >> 2) & 0x3f00) | (((*o) << 6) & 0xc000) | ((*o) & 0xff);
}


x86 assembly (clang, -O0):
<move_u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shr    $0x3,%rcx
and    $0x1ff000,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x9,%rax
and    $0xe00000,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xfff,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
sar    $0x2,%eax
and    $0x3f00,%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
shl    $0x6,%ecx
and    $0xc000,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_u>:
mov    (%rdi),%rax
mov    %rax,%rcx
shr    $0x3,%rcx
and    $0x1ff000,%ecx
mov    %eax,%edx
shl    $0x9,%edx
and    $0xe00000,%edx
and    $0xfff,%eax
or     %rdx,%rax
or     %rcx,%rax
mov    %rax,(%rdi)
movzwl (%rsi),%eax
mov    %eax,%ecx
movzbl %al,%edx
shr    $0x2,%eax
and    $0x3f00,%eax
shl    $0x6,%ecx
and    $0xffffc000,%ecx
or     %ecx,%edx
or     %eax,%edx
mov    %dx,(%rsi)
ret

LLVM IR (-O0):
define void @move_u(i64* %0, i16* %1) {
%3 = alloca i64*
%4 = alloca i16*
store i64* %0, i64** %3
store i16* %1, i16** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = lshr i64 %6, 3
%8 = and i64 %7, 2093056
%9 = load i64*, i64** %3
%10 = load i64, i64* %9
%11 = shl i64 %10, 9
%12 = and i64 %11, 14680064
%13 = or i64 %8, %12
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = and i64 %15, 4095
%17 = or i64 %13, %16
%18 = load i64*, i64** %3
store i64 %17, i64* %18
%19 = load i16*, i16** %4
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = ashr i32 %21, 2
%23 = and i32 %22, 16128
%24 = load i16*, i16** %4
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = shl i32 %26, 6
%28 = and i32 %27, 49152
%29 = or i32 %23, %28
%30 = load i16*, i16** %4
%31 = load i16, i16* %30
%32 = zext i16 %31 to i32
%33 = and i32 %32, 255
%34 = or i32 %29, %33
%35 = trunc i32 %34 to i16
%36 = load i16*, i16** %4
store i16 %35, i16* %36
ret void
}

LLVM IR (-O2):
define void @move_u(i64* nocapture %0, i16* nocapture %1) {
%3 = load i64, i64* %0
%4 = lshr i64 %3, 3
%5 = and i64 %4, 2093056
%6 = shl i64 %3, 9
%7 = and i64 %6, 14680064
%8 = and i64 %3, 4095
%9 = or i64 %7, %8
%10 = or i64 %9, %5
store i64 %10, i64* %0
%11 = load i16, i16* %1
%12 = lshr i16 %11, 2
%13 = and i16 %12, 16128
%14 = shl i16 %11, 6
%15 = and i16 %14, -16384
%16 = and i16 %11, 255
%17 = or i16 %15, %16
%18 = or i16 %17, %13
store i16 %18, i16* %1
ret void
}
/* Type definitions */
struct fh_input {
  int dummy;
};

/* Variables and functions */
struct fh_input *fh_open_input_file(char const *);
struct fh_input *string_open(struct fh_input *in, const char *filename) {
  (void)in;
  return fh_open_input_file(filename);
}


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

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

LLVM IR (-O0):
%struct.fh_input = type { i32 }
define %struct.fh_input* @string_open(%struct.fh_input* %0, i8* %1) {
%3 = alloca %struct.fh_input*
%4 = alloca i8*
store %struct.fh_input* %0, %struct.fh_input** %3
store i8* %1, i8** %4
%5 = load %struct.fh_input*, %struct.fh_input** %3
%6 = load i8*, i8** %4
%7 = call %struct.fh_input* @fh_open_input_file(i8* %6)
ret %struct.fh_input* %7
}

LLVM IR (-O2):
%struct.fh_input = type { i32 }
define %struct.fh_input* @string_open(%struct.fh_input* nocapture readnone %0, i8* %1) {
%3 = tail call %struct.fh_input* @fh_open_input_file(i8* %1)
ret %struct.fh_input* %3
}
double lr_deviance_from_log_likelihood(double likelihood, double likesat) {
  return -2.0 * (likelihood - likesat);
}


x86 assembly (clang, -O0):
<lr_deviance_from_log_likelihood>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr_deviance_from_log_likelihood>:
subsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @lr_deviance_from_log_likelihood(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fmul double -2.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @lr_deviance_from_log_likelihood(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %3, -2.000000e+00
ret double %4
}
void arch_reset(char mode, const char *cmd) {}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void query_timeout(void *dummy) {
  puts("Query timed out.");
  exit(2);
}


x86 assembly (clang, -O0):
<query_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<query_timeout>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Query timed out.\00"
define void @query_timeout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Query timed out.\00"
define void @query_timeout(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int gpioHardwareRevision();
int gpioVersion();
int /*<<< orphan*/ printf(char *, ...);
void t0() {
  printf("\nTesting pigpio C I/F\n");
  printf("pigpio version %d.\n", gpioVersion());
  printf("Hardware revision %d.\n", gpioHardwareRevision());
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <gpioVersion@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <gpioHardwareRevision@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <gpioVersion@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <gpioHardwareRevision@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1060 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0ATesting pigpio C I/F\0A\00"
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
define void @t0() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gpioVersion()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @gpioHardwareRevision()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
@str = [22 x i8] c"\0ATesting pigpio C I/F\00"
define void @t0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @gpioVersion()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @gpioHardwareRevision()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}
int bin_to_dec(long b) {
  int result = 0, t = 1;
  while (b > 0) {
    int d = b % 10;
    result += d * t;
    b /= 10;
    t *= 2;
  }
  return result;
}


x86 assembly (clang, -O0):
<bin_to_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1161 <bin_to_dec+0x61>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <bin_to_dec+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_to_dec>:
xor    %ecx,%ecx
test   %rdi,%rdi
jle    1146 <bin_to_dec+0x46>
mov    $0x1,%esi
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%r9d
mov    %edi,%eax
sub    %r9d,%eax
imul   %esi,%eax
add    %eax,%ecx
add    %esi,%esi
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <bin_to_dec+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bin_to_dec(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ %0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 1, %1 ]
%6 = phi i32 [ %10, %3 ], [ 0, %1 ]
%7 = urem i64 %4, 10
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %5, %8
%10 = add nsw i32 %9, %6
%11 = udiv i64 %4, 10
%12 = shl nsw i32 %5, 1
%13 = icmp ult i64 %4, 10
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("tam8085tape <input> <output>\n\n"
       "Converts input file to TAM8085-tape format\n"
       "Input is a raw byte stream.\n"
       "Output is signed 8 bit samples with 32000 sps.\n"
       "Output consists of 256 byte pages. Input is padded to full page with "
       "zeros.\n");
}


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

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

LLVM IR (-O0):
@.str = [225 x i8] c"tam8085tape <input> <output>\0A\0AConverts input file to TAM8085-tape format\0AInput is a raw byte stream.\0AOutput is signed 8 bit samples with 32000 sps.\0AOutput consists of 256 byte pages. Input is padded to full page with zeros.\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [225 x i8] c"tam8085tape <input> <output>\0A\0AConverts input file to TAM8085-tape format\0AInput is a raw byte stream.\0AOutput is signed 8 bit samples with 32000 sps.\0AOutput consists of 256 byte pages. Input is padded to full page with zeros.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __nv_ddiv_ru(double, double);
double __ddiv_ru(double __a, double __b) { return __nv_ddiv_ru(__a, __b); }


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

x86 assembly (clang, -O2):
<__ddiv_ru>:
jmp    1030 <__nv_ddiv_ru@plt>

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

LLVM IR (-O2):
define double @__ddiv_ru(double %0, double %1) {
%3 = tail call double @__nv_ddiv_ru(double %0, double %1)
ret double %3
}
void Nand_Init(void) {
  (*(volatile unsigned *)0x4E000000) =
      (1 << 12) | (2 << 8) | (1 << 4) | (0 << 0);
  (*(volatile unsigned *)0x4E000004) = (1 << 4) | (1 << 1) | (1 << 0);
}


x86 assembly (clang, -O0):
<Nand_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000000,%eax
movl   $0x1210,(%rax)
mov    $0x4e000004,%eax
movl   $0x13,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nand_Init>:
movl   $0x1210,0x4e000000
movl   $0x13,0x4e000004
ret

LLVM IR (-O0):
define void @Nand_Init() {
store volatile i32 4624, i32* inttoptr (i64 1308622848 to i32*)
store volatile i32 19, i32* inttoptr (i64 1308622852 to i32*)
ret void
}

LLVM IR (-O2):
define void @Nand_Init() {
store volatile i32 4624, i32* inttoptr (i64 1308622848 to i32*)
store volatile i32 19, i32* inttoptr (i64 1308622852 to i32*)
ret void
}
pr(p) register char *p;
{
  for (; *p; p++)
    printf("%s", rdchar(*p));
}


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <pr+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <rdchar@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <pr+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1161 <pr+0x41>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <rdchar@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <pr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @pr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @rdchar to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %4
17: ; preds = %4
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @pr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @rdchar to i32 (i32, ...)*)(i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i32 undef
}