xunge/DecIR huggingface dataset:
/* Variables and functions */
char getchar();
void waitfor(char c) {
  while (getchar() != c) {
  }
}


x86 assembly (clang, -O0):
<waitfor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
je     1139 <waitfor+0x29>
jmp    111e <waitfor+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitfor>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    %bl,%al
jne    1120 <waitfor+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @waitfor(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @waitfor(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, %0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
int test_imm_0Duint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x0D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Duint64_lowword_reg>:
test   $0xd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Duint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 13
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int x_stuff(c)
int c;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @x_stuff(i32 %0) {
ret i32 0
}
int isValid(int val) { return (val > 1 && val <= 10); }


x86 assembly (clang, -O0):
<isValid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isValid+0x20>
cmpl   $0xa,-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):
<isValid>:
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x9,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isValid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 10
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 @isValid(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int partial_crc32(char const *, int);
unsigned long crc32(const char *s) {
  return partial_crc32(s, 0xffffffff) ^ 0xffffffff;
}


x86 assembly (clang, -O0):
<crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <partial_crc32@plt>
xor    $0xffffffff,%eax
mov    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32>:
push   %rax
mov    $0xffffffff,%esi
call   1030 <partial_crc32@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @crc32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @partial_crc32(i8* %3, i32 -1)
%5 = xor i32 %4, -1
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @crc32(i8* %0) {
%2 = tail call i32 @partial_crc32(i8* %0, i32 -1)
%3 = xor i32 %2, -1
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
struct map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct map *);
int /*<<< orphan*/ map_destroy(struct map *);
void map_delete(struct map *__restrict map) {
  map_destroy(map);
  free(map);
}


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

x86 assembly (clang, -O2):
<map_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <map_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.map = type { i32 }
define void @map_delete(%struct.map* noalias %0) {
%2 = alloca %struct.map*
store %struct.map* %0, %struct.map** %2
%3 = load %struct.map*, %struct.map** %2
%4 = call i32 @map_destroy(%struct.map* %3)
%5 = load %struct.map*, %struct.map** %2
%6 = call i32 @free(%struct.map* %5)
ret void
}

LLVM IR (-O2):
%struct.map = type { i32 }
define void @map_delete(%struct.map* noalias %0) {
%2 = tail call i32 @map_destroy(%struct.map* %0)
%3 = tail call i32 @free(%struct.map* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, a;
  scanf("%d", &num);
  for (a = 1; a <= num; a += 2)
    printf("%i\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116f <main+0x4f>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
mov    $0x1,%ebx
lea    0xebb(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    0x4(%rsp),%ebx
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %7, 2
%10 = load i32, i32* %1
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
void DQUOT_SWAP(struct inode *inode, struct inode *tmpl) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @DQUOT_SWAP(%struct.inode* nocapture %0, %struct.inode* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
size_t strlen(char *);
int main(int argc, char *argv[]) {
  if (argc == 5) {
    putchar('B');
  } else {
    char *enemy_hist = argv[2];
    size_t len = strlen(enemy_hist);
    putchar(enemy_hist[len - 1]);
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    114f <main+0x2f>
mov    $0x42,%edi
call   1030 <putchar@plt>
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x42,%al
cmp    $0x5,%edi
je     1138 <main+0x18>
mov    0x10(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    -0x1(%rax,%rbx,1),%al
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @putchar(i8 signext 66)
br label %24
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i64 @strlen(i8* %16)
store i64 %17, i64* %7
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = sub i64 %19, 1
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @putchar(i8 signext %22)
br label %24
24: ; preds = %12, %10
%25 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%8 = add i64 %7, -1
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
br label %11
11: ; preds = %2, %4
%12 = phi i8 [ %10, %4 ], [ 66, %2 ]
%13 = tail call i32 @putchar(i8 signext %12)
%14 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void cdrom_iso_log(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @cdrom_iso_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_rfcomm();
void bt_close(void) { close_rfcomm(); }


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

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

LLVM IR (-O0):
define void @bt_close() {
%1 = call i32 (...) @close_rfcomm()
ret void
}

LLVM IR (-O2):
define void @bt_close() {
%1 = tail call i32 (...) @close_rfcomm()
ret void
}
void RTPathCompare(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathCompare() {
ret void
}
char unescape(char c) {
  switch (c) {
  case 't':
    return '\t';
  case 'n':
    return '\n';
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x6e,%eax
je     1139 <unescape+0x39>
jmp    111f <unescape+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x74,%eax
jne    1142 <unescape+0x42>
jmp    1130 <unescape+0x30>
movb   $0x9,-0x1(%rbp)
jmp    1148 <unescape+0x48>
movb   $0xa,-0x1(%rbp)
jmp    1148 <unescape+0x48>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
cmp    $0x74,%edi
je     110f <unescape+0xf>
mov    %edi,%eax
cmp    $0x6e,%edi
jne    110e <unescape+0xe>
mov    $0xa,%al
ret
mov    $0x9,%al
ret

LLVM IR (-O0):
define signext i8 @unescape(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 116, label %6
i32 110, label %7
]
6: ; preds = %1
store i8 9, i8* %2
br label %10
7: ; preds = %1
store i8 10, i8* %2
br label %10
8: ; preds = %1
%9 = load i8, i8* %3
store i8 %9, i8* %2
br label %10
10: ; preds = %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @unescape(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 116, label %5
i32 110, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i8 [ %0, %4 ], [ 10, %3 ], [ 9, %1 ]
ret i8 %6
}
unsigned char bitops_set(unsigned char val, int bit) {
  return (val | (1 << bit));
}


x86 assembly (clang, -O0):
<bitops_set>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_set>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @bitops_set(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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @bitops_set(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
int _ipa_read_ep_reg_v1_1(char *buf, int max_len, int pipe) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_ipa_read_ep_reg_v1_1(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ atoi(char const *);
scalar_t__ strcasecmp(char const *, char *);
int ouroboros_config_get_bool(const char *name) {
  if (atoi(name) || strcasecmp(name, "true") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ouroboros_config_get_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x0,%rax
jne    1159 <ouroboros_config_get_bool+0x39>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1165 <ouroboros_config_get_bool+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <ouroboros_config_get_bool+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouroboros_config_get_bool>:
push   %rbx
mov    %rdi,%rbx
call   1040 <atoi@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <ouroboros_config_get_bool+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
define i32 @ouroboros_config_get_bool(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @atoi(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
define i32 @ouroboros_config_get_bool(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
__attribute__((no, noclone)) unsigned short foo6(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!1) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo6>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1133 <foo6+0x33>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xff,%eax
jle    1140 <foo6+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo6+0x5e>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo6>:
lea    0x1(%rdi),%ecx
cmp    $0xff,%edi
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo6(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 254
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_byte(unsigned int, unsigned char);
void write_word(unsigned int addr, unsigned int data) {
  write_byte(addr, ((unsigned char)(data >> 8)));
  write_byte(addr + 1, ((unsigned char)data));
}


x86 assembly (clang, -O0):
<write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
movzbl %al,%esi
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%eax
movzbl %al,%esi
call   1030 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_word>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
movzbl %ah,%esi
mov    %eax,%ebp
call   1030 <write_byte@plt>
add    $0x1,%ebx
movzbl %bpl,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
define void @write_word(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 = lshr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = call i32 @write_byte(i32 %5, i8 zeroext %8)
%10 = load i32, i32* %3
%11 = add i32 %10, 1
%12 = load i32, i32* %4
%13 = trunc i32 %12 to i8
%14 = call i32 @write_byte(i32 %11, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @write_word(i32 %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = tail call i32 @write_byte(i32 %0, i8 zeroext %4)
%6 = add i32 %0, 1
%7 = trunc i32 %1 to i8
%8 = tail call i32 @write_byte(i32 %6, i8 zeroext %7)
ret void
}
struct module *__module_address(unsigned long addr) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
define %struct.module* @__module_address(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret %struct.module* null
}

LLVM IR (-O2):
%struct.module = type opaque
define noalias %struct.module* @__module_address(i64 %0) {
ret %struct.module* null
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long QEIVelocityGet(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x4002C000) || (ulBase == 0x4002D000));
  return ((*((volatile unsigned long *)(ulBase + 0x0000001C))));
}


x86 assembly (clang, -O0):
<QEIVelocityGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x4002c000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <QEIVelocityGet+0x2d>
cmpq   $0x4002d000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityGet>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x4002c000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x1c(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @QEIVelocityGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 28
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @QEIVelocityGet(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 28
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_profile(struct pt_regs *);
int /*<<< orphan*/ do_set_rtc();
int /*<<< orphan*/ do_timer(struct pt_regs *);
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) {
  do_timer(regs);
  do_set_rtc();
  do_profile(regs);
}


x86 assembly (clang, -O0):
<timer_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <do_timer@plt>
mov    $0x0,%al
call   1030 <do_set_rtc@plt>
mov    -0x18(%rbp),%rdi
call   1050 <do_profile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_interrupt>:
push   %rbx
mov    %rdx,%rbx
mov    %rdx,%rdi
call   1040 <do_timer@plt>
xor    %eax,%eax
call   1030 <do_set_rtc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <do_profile@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define void @timer_interrupt(i32 %0, i8* %1, %struct.pt_regs* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.pt_regs* %2, %struct.pt_regs** %6
%7 = load %struct.pt_regs*, %struct.pt_regs** %6
%8 = call i32 @do_timer(%struct.pt_regs* %7)
%9 = call i32 (...) @do_set_rtc()
%10 = load %struct.pt_regs*, %struct.pt_regs** %6
%11 = call i32 @do_profile(%struct.pt_regs* %10)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define void @timer_interrupt(i32 %0, i8* nocapture readnone %1, %struct.pt_regs* %2) {
%4 = tail call i32 @do_timer(%struct.pt_regs* %2)
%5 = tail call i32 (...) @do_set_rtc()
%6 = tail call i32 @do_profile(%struct.pt_regs* %2)
ret void
}
unsigned short int f53(unsigned short int x, unsigned int y) {
  return (x << ((-y) & (8 * 2 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f53>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f53>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 0, %7
%9 = and i32 %8, 15
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = xor i32 %10, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 0, %1
%5 = and i32 %4, 15
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ create_image;
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void *get_XImage_f_create_image(void *_p) {
  return (void *)((XImage *)_p)->f.create_image;
}


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

x86 assembly (clang, -O2):
<get_XImage_f_create_image>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XImage_f_create_image(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void udelay(uint32_t delay) { usleep(delay); }


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

x86 assembly (clang, -O2):
<udelay>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
char const *cfg_mvp_get_file(char *);
const char *cfg_mvp_get_processor_file(void) {
  return cfg_mvp_get_file("processor");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"processor\00"
define i8* @cfg_mvp_get_processor_file() {
%1 = call i8* @cfg_mvp_get_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"processor\00"
define i8* @cfg_mvp_get_processor_file() {
%1 = tail call i8* @cfg_mvp_get_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void rop3_114_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_114_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_114_1_0>:
xor    %esi,%edx
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_114_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = and i32 %37, %39
%41 = or i32 %34, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_114_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %1, -1
%8 = and i8 %6, %7
%9 = and i8 %5, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
void ff_hevc_put_hevc_uni_w_epel_hv16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_hv16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() { usleep(15000000); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe4e1c0,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xe4e1c0,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @usleep(i32 15000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @usleep(i32 15000000)
ret i32 0
}
/* Variables and functions */
int open_clientfd(char *, char *);
int /*<<< orphan*/ unix_error(char *);
int Open_clientfd(char *hostname, char *port) {
  int rc;
  if ((rc = open_clientfd(hostname, port)) < 0)
    unix_error("Open_clientfd error");
  return rc;
}


x86 assembly (clang, -O0):
<Open_clientfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <open_clientfd@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1155 <Open_clientfd+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_clientfd>:
push   %rbx
call   1040 <open_clientfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open_clientfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Open_clientfd error\00"
define i32 @Open_clientfd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @open_clientfd(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"Open_clientfd error\00"
define i32 @Open_clientfd(i8* %0, i8* %1) {
%3 = tail call i32 @open_clientfd(i8* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("oBIX binary - placeholder to keep rpmlint happy. Install obix-server "
         "for functionality. Refer to README.md");
}


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

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

LLVM IR (-O0):
@.str = [107 x i8] c"oBIX binary - placeholder to keep rpmlint happy. Install obix-server for functionality. Refer to README.md\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [107 x i8] c"oBIX binary - placeholder to keep rpmlint happy. Install obix-server for functionality. Refer to README.md\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int error(int r, char *msg) { return r; }


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

x86 assembly (clang, -O2):
<error>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @error(i32 returned %0, i8* nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
unsigned char pcibios_read_config_byte(int /*<<< orphan*/, scalar_t__, int);
unsigned long sdram_get_ecc_size_bytes(void) {
  unsigned char byte;
  unsigned long size;
  byte = pcibios_read_config_byte(0, ((0x00 << 3) + 0), 0x67);
  size = byte;
  size <<= 23;
  size = 0;
  return size;
}


x86 assembly (clang, -O0):
<sdram_get_ecc_size_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x67,%edx
call   1030 <pcibios_read_config_byte@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x17,%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_get_ecc_size_bytes>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x67,%edx
call   1030 <pcibios_read_config_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @sdram_get_ecc_size_bytes() {
%1 = alloca i8
%2 = alloca i64
%3 = call zeroext i8 @pcibios_read_config_byte(i32 0, i64 0, i32 103)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i64
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 23
store i64 %7, i64* %2
store i64 0, i64* %2
%8 = load i64, i64* %2
ret i64 %8
}

LLVM IR (-O2):
define i64 @sdram_get_ecc_size_bytes() {
%1 = tail call zeroext i8 @pcibios_read_config_byte(i32 0, i64 0, i32 103)
ret i64 0
}
void AVOID_EMPTY_UNIT_WARNING_BY_GCC_EPOLL() {}


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

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

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

LLVM IR (-O2):
define void @AVOID_EMPTY_UNIT_WARNING_BY_GCC_EPOLL() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void helpAndLeave(const char *progname, int status) {
  fprintf(stderr, "Usage: %s <file> <numBytes> [x]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <file> <numBytes> [x]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <file> <numBytes> [x]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
unsigned int jhash_3words(unsigned int, int /*<<< orphan*/, int /*<<< orphan*/,
                          unsigned int);
unsigned int jhash_1word(unsigned int a, unsigned int initval) {
  return jhash_3words(a, 0, 0, initval);
}


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

x86 assembly (clang, -O2):
<jhash_1word>:
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <jhash_3words@plt>

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

LLVM IR (-O2):
define i32 @jhash_1word(i32 %0, i32 %1) {
%3 = tail call i32 @jhash_3words(i32 %0, i32 0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void dumpHighRunners(int i, void *str, void *d) {
  (void)(d);
  printf("%d\t%s\n", i, (char *)str);
}


x86 assembly (clang, -O0):
<dumpHighRunners>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpHighRunners>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%s\0A\00"
define void @dumpHighRunners(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%s\0A\00"
define void @dumpHighRunners(i32 %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
int ike_alg_init(void) {
  {
    extern int ike_alg_aes_init(void);
    ike_alg_aes_init();
  }
  return 0;
}


x86 assembly (clang, -O0):
<ike_alg_init>:
push   %rbp
mov    %rsp,%rbp
call   1030 <ike_alg_aes_init@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ike_alg_init() {
%1 = call i32 @ike_alg_aes_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @ike_alg_init() {
%1 = tail call i32 @ike_alg_aes_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_make_image() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_make_image>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_make_image>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_make_image() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_make_image() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char *);
char *strcat(char *s, const char *append) {
  strcpy(&s[strlen(s)], append);
  return s;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = call i64 @strlen(i8* %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *memcpy_example(void *dest, const void *src, size_t size) {
  return memcpy(dest, src, size);
}


x86 assembly (clang, -O0):
<memcpy_example>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_example>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @memcpy_example(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
output_string(ptr) char ptr[];
{
  int k;
  k = 0;
  while (output_byte(ptr[k++]))
    ;
}


x86 assembly (clang, -O0):
<output_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
mov    $0x0,%al
call   1030 <output_byte@plt>
cmp    $0x0,%eax
je     114e <output_string+0x3e>
jmp    1123 <output_string+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_string>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
xor    %eax,%eax
call   1030 <output_byte@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <output_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @output_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @output_byte to i32 (i32, ...)*)(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %5
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @output_string(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @output_byte to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void stc() { db(0xF9); }


x86 assembly (clang, -O0):
<stc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stc>:
mov    $0xf9,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @stc() {
%1 = call i32 @db(i32 249)
ret void
}

LLVM IR (-O2):
define void @stc() {
%1 = tail call i32 @db(i32 249)
ret void
}
void loglike_posterior_theta_finalize() {}


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

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

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

LLVM IR (-O2):
define void @loglike_posterior_theta_finalize() {
ret void
}