xunge/DecIR huggingface dataset:
/* Type definitions */
struct packit_record {
  int dummy;
};
struct packit {
  int dummy;
};

/* Variables and functions */
struct packit_record *__packit_get_header(struct packit const *, char const *,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ hash(char const *);
struct packit_record *packit_get_header(const struct packit *p,
                                        const char *key) {
  return __packit_get_header(p, key, hash(key));
}


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

x86 assembly (clang, -O2):
<packit_get_header>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <hash@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__packit_get_header@plt>

LLVM IR (-O0):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
define %struct.packit_record* @packit_get_header(%struct.packit* %0, i8* %1) {
%3 = alloca %struct.packit*
%4 = alloca i8*
store %struct.packit* %0, %struct.packit** %3
store i8* %1, i8** %4
%5 = load %struct.packit*, %struct.packit** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @hash(i8* %7)
%9 = call %struct.packit_record* @__packit_get_header(%struct.packit* %5, i8* %6, i32 %8)
ret %struct.packit_record* %9
}

LLVM IR (-O2):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
define %struct.packit_record* @packit_get_header(%struct.packit* %0, i8* %1) {
%3 = tail call i32 @hash(i8* %1)
%4 = tail call %struct.packit_record* @__packit_get_header(%struct.packit* %0, i8* %1, i32 %3)
ret %struct.packit_record* %4
}
/* Variables and functions */
int /*<<< orphan*/ _NOP();
void Delay(long nops) {
  long i;
  for (i = 0; i < nops; i++) {
    _NOP();
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    114a <Delay+0x3a>
mov    $0x0,%al
call   1030 <_NOP@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Delay+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
push   %rbx
test   %rdi,%rdi
jle    112d <Delay+0x1d>
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <_NOP@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <Delay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Delay(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @_NOP()
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int internal_run(int, int, int, int, int, int, int, int, int, int);
int run_branches_c(void *data, int n) {
  return internal_run(n, 1, 2, 3, 4, 5, 6, 7, 8, 9);
}


x86 assembly (clang, -O0):
<run_branches_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x9,0x18(%rsp)
call   1030 <internal_run@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_branches_c>:
push   %rax
mov    %esi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x9
push   $0x8
push   $0x7
push   $0x6
call   1030 <internal_run@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @run_branches_c(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @internal_run(i32 %1, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
ret i32 %3
}
/* Variables and functions */
int syscall(int, int);
int epoll_create(int size) { return (syscall(254, size)); }


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

x86 assembly (clang, -O2):
<epoll_create>:
mov    %edi,%esi
mov    $0xfe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @epoll_create(i32 %0) {
%2 = tail call i32 @syscall(i32 254, i32 %0)
ret i32 %2
}
int cHighBit(int uint) {
  unsigned int shifted;
  int bitNo;
  shifted = uint;
  bitNo = 0;
  while (!(shifted < 16)) {
    shifted = ((unsigned)shifted >> 4);
    bitNo += 4;
  }
  while (!(shifted == 0)) {
    shifted = ((unsigned)shifted >> 1);
    bitNo += 1;
  }
  return bitNo;
}


x86 assembly (clang, -O0):
<cHighBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
setb   %al
xor    $0xff,%al
test   $0x1,%al
jne    112a <cHighBit+0x2a>
jmp    1141 <cHighBit+0x41>
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <cHighBit+0x14>
jmp    1146 <cHighBit+0x46>
cmpl   $0x0,-0x8(%rbp)
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    115c <cHighBit+0x5c>
jmp    1173 <cHighBit+0x73>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <cHighBit+0x46>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cHighBit>:
xor    %eax,%eax
cmp    $0x10,%edi
jb     1126 <cHighBit+0x26>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x4,%ecx
add    $0x4,%eax
cmp    $0xff,%edi
mov    %ecx,%edi
ja     1110 <cHighBit+0x10>
test   %ecx,%ecx
jne    112c <cHighBit+0x2c>
jmp    113c <cHighBit+0x3c>
mov    %edi,%ecx
test   %ecx,%ecx
je     113c <cHighBit+0x3c>
mov    %ecx,%edx
xchg   %ax,%ax
shr    %edx
add    $0x1,%eax
cmp    $0x1,%ecx
mov    %edx,%ecx
ja     1130 <cHighBit+0x30>
ret

LLVM IR (-O0):
define i32 @cHighBit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 16
%9 = xor i1 %8, true
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = lshr i32 %11, 4
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 4
store i32 %14, i32* %4
br label %6
15: ; preds = %6
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32, i32* %3
%22 = lshr i32 %21, 1
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %16
25: ; preds = %16
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @cHighBit(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %7, label %3
3: ; preds = %7, %1
%4 = phi i32 [ %0, %1 ], [ %10, %7 ]
%5 = phi i32 [ 0, %1 ], [ %11, %7 ]
%6 = icmp eq i32 %4, 0
br i1 %6, label %19, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ 0, %1 ]
%9 = phi i32 [ %10, %7 ], [ %0, %1 ]
%10 = lshr i32 %9, 4
%11 = add nuw nsw i32 %8, 4
%12 = icmp ugt i32 %9, 255
br i1 %12, label %7, label %3
13: ; preds = %3, %13
%14 = phi i32 [ %17, %13 ], [ %5, %3 ]
%15 = phi i32 [ %16, %13 ], [ %4, %3 ]
%16 = lshr i32 %15, 1
%17 = add nuw nsw i32 %14, 1
%18 = icmp ult i32 %15, 2
br i1 %18, label %19, label %13
19: ; preds = %13, %3
%20 = phi i32 [ %5, %3 ], [ %17, %13 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ onePeriod(int, double);
void leaderTone(int duration) {
  for (int i = 0; i < duration; i++) {
    onePeriod(770, 0.0);
  }
}


x86 assembly (clang, -O0):
<leaderTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <leaderTone+0x39>
mov    $0x302,%edi
xorps  %xmm0,%xmm0
call   1030 <onePeriod@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <leaderTone+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaderTone>:
push   %rbx
test   %edi,%edi
jle    1132 <leaderTone+0x22>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
mov    $0x302,%edi
call   1030 <onePeriod@plt>
add    $0xffffffff,%ebx
jne    1120 <leaderTone+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @leaderTone(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @onePeriod(i32 770, double 0.000000e+00)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @leaderTone(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @onePeriod(i32 770, double 0.000000e+00)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n1, n2, n3;
  scanf("%d%d%d", &n1, &n2, &n3);
  printf("%d", n2);
  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
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
int is_encoding_utf8(const char *name) {
  if (!name)
    return 1;
  if (!strcasecmp(name, "utf-8") || !strcasecmp(name, "utf8"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_encoding_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <is_encoding_utf8+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_encoding_utf8+0x68>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1165 <is_encoding_utf8+0x55>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1171 <is_encoding_utf8+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_encoding_utf8+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_encoding_utf8>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %rdi,%rdi
je     1147 <is_encoding_utf8+0x37>
mov    %rdi,%rbx
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1147 <is_encoding_utf8+0x37>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [5 x i8] c"utf8\00"
define i32 @is_encoding_utf8(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
int float_compare(float a, float b) { return (a == b); }


x86 assembly (clang, -O0):
<float_compare>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_compare>:
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @float_compare(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @float_compare(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  printf("PATH = %s\n", getenv("PATH"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xece(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"PATH = %s\0A\00"
@.str.1 = [5 x i8] c"PATH\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
struct property *of_new_property(struct device_node *node, const char *name,
                                 const void *data, int len) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.property = type opaque
%struct.device_node = type opaque
define %struct.property* @of_new_property(%struct.device_node* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.device_node*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.device_node* %0, %struct.device_node** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret %struct.property* null
}

LLVM IR (-O2):
%struct.property = type opaque
%struct.device_node = type opaque
define noalias %struct.property* @of_new_property(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret %struct.property* null
}
/* Variables and functions */
int /*<<< orphan*/ f(int const *const);
int g(const int *const garg) { f(garg); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @g(i32* %0) {
%2 = tail call i32 @f(i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ chaz_ConfWriter_append_conf(char *);
void chaz_ConfWriter_end_module(void) { chaz_ConfWriter_append_conf("\n"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @chaz_ConfWriter_end_module() {
%1 = call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @chaz_ConfWriter_end_module() {
%1 = tail call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(const char *input) {
  char *copy;
  for (copy = input; *copy != 0; copy++)
    ;
  return (copy - input);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%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 %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct set {
  int dummy;
};

/* Variables and functions */
int set_contains(struct set *, void *, size_t);
bool set_contains_bytes(struct set *t, void *y, size_t n) {
  return set_contains(t, y, n);
}


x86 assembly (clang, -O0):
<set_contains_bytes>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <set_contains@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_contains_bytes>:
jmp    1030 <set_contains@plt>

LLVM IR (-O0):
%struct.set = type { i32 }
define i32 @set_contains_bytes(%struct.set* %0, i8* %1, i64 %2) {
%4 = alloca %struct.set*
%5 = alloca i8*
%6 = alloca i64
store %struct.set* %0, %struct.set** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.set*, %struct.set** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @set_contains(%struct.set* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.set = type { i32 }
define i32 @set_contains_bytes(%struct.set* %0, i8* %1, i64 %2) {
%4 = tail call i32 @set_contains(%struct.set* %0, i8* %1, i64 %2)
ret i32 %4
}
int eoln(CH)
char CH;
{ return (CH == '\0'); }


x86 assembly (clang, -O0):
<eoln>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoln>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @eoln(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @eoln(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pefree(void *ptr, int _unused) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @pefree(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
void done_making_threads(void) {}


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

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

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

LLVM IR (-O2):
define void @done_making_threads() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int fsize(FILE *fp) {
  int sz;
  int prev = ftell(fp);
  fseek(fp, 0L, SEEK_END);
  sz = ftell(fp);
  fseek(fp, prev, SEEK_SET);
  return sz;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %eax,%r14d
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = load i32, i32* %4
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @fsize(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 %2, i32 %6)
ret i32 %5
}
void matrix_short_uninit(short **A) {
  if (A[0])
    free(A[0]);
  if (A)
    free(A);
}


x86 assembly (clang, -O0):
<matrix_short_uninit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <matrix_short_uninit+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x8(%rbp)
je     114a <matrix_short_uninit+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_short_uninit>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <matrix_short_uninit+0x11>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @matrix_short_uninit(i16** %0) {
%2 = alloca i16**
store i16** %0, i16*** %2
%3 = load i16**, i16*** %2
%4 = getelementptr inbounds i16*, i16** %3, i64 0
%5 = load i16*, i16** %4
%6 = icmp ne i16* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16**, i16*** %2
%9 = getelementptr inbounds i16*, i16** %8, i64 0
%10 = load i16*, i16** %9
%11 = bitcast i16* %10 to i8*
br label %12
12: ; preds = %7, %1
%13 = load i16**, i16*** %2
%14 = icmp ne i16** %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i16**, i16*** %2
%17 = bitcast i16** %16 to i8*
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @matrix_short_uninit(i16** nocapture %0) {
%2 = load i16*, i16** %0
%3 = icmp eq i16* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast i16* %2 to i8*
tail call void @free(i8* %5)
br label %6
6: ; preds = %1, %4
%7 = bitcast i16** %0 to i8*
tail call void @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello world!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int shiftr64(int, int);
uint64_t bmw_large_s5(uint64_t x) {
  uint64_t r;
  r = shiftr64(x, 2) ^ x;
  return r;
}


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

x86 assembly (clang, -O2):
<bmw_large_s5>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shiftr64@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bmw_large_s5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @shiftr64(i32 %4, i32 2)
%6 = load i32, i32* %2
%7 = xor i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @bmw_large_s5(i32 %0) {
%2 = tail call i32 @shiftr64(i32 %0, i32 2)
%3 = xor i32 %2, %0
ret i32 %3
}
any(c, str) char c;
char *str;
{
  while (*str != '\0')
    if (*str++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <any+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <any+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <any+0x54>
jmp    110e <any+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl %dil,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rsi),%ecx
test   %ecx,%ecx
je     1125 <any+0x25>
add    $0x1,%rsi
cmp    %ecx,%eax
jne    1110 <any+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %9, %2
%6 = phi i8* [ %1, %2 ], [ %11, %9 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = sext i8 %7 to i32
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i32 %4, %10
br i1 %12, label %13, label %5
13: ; preds = %5, %9
%14 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void hyfy_error(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<hyfy_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @hyfy_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @hyfy_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_STORE_CTX;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int verify_callback(int preverify_ok, X509_STORE_CTX *x509) {
  printf("verify callback\n");
  return 1;
}


x86 assembly (clang, -O0):
<verify_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_callback>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"verify callback\00"
define i32 @verify_callback(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int nfs_fs_proc_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nfs_fs_proc_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nfs_fs_proc_init() {
ret i32 0
}
/* Type definitions */
struct fid_wait {
  int dummy;
};
struct fid_fabric {
  int dummy;
};
struct fi_wait_attr {
  int dummy;
};

/* Variables and functions */
int gnix_wait_open(struct fid_fabric *, struct fi_wait_attr *,
                   struct fid_wait **);
int fi_wait_open(struct fid_fabric *fabric, struct fi_wait_attr *attr,
                 struct fid_wait **waitset) {
  return gnix_wait_open(fabric, attr, waitset);
}


x86 assembly (clang, -O0):
<fi_wait_open>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <gnix_wait_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_wait_open>:
jmp    1030 <gnix_wait_open@plt>

LLVM IR (-O0):
%struct.fid_fabric = type { i32 }
%struct.fi_wait_attr = type { i32 }
%struct.fid_wait = type { i32 }
define i32 @fi_wait_open(%struct.fid_fabric* %0, %struct.fi_wait_attr* %1, %struct.fid_wait** %2) {
%4 = alloca %struct.fid_fabric*
%5 = alloca %struct.fi_wait_attr*
%6 = alloca %struct.fid_wait**
store %struct.fid_fabric* %0, %struct.fid_fabric** %4
store %struct.fi_wait_attr* %1, %struct.fi_wait_attr** %5
store %struct.fid_wait** %2, %struct.fid_wait*** %6
%7 = load %struct.fid_fabric*, %struct.fid_fabric** %4
%8 = load %struct.fi_wait_attr*, %struct.fi_wait_attr** %5
%9 = load %struct.fid_wait**, %struct.fid_wait*** %6
%10 = call i32 @gnix_wait_open(%struct.fid_fabric* %7, %struct.fi_wait_attr* %8, %struct.fid_wait** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fid_fabric = type { i32 }
%struct.fi_wait_attr = type { i32 }
%struct.fid_wait = type { i32 }
define i32 @fi_wait_open(%struct.fid_fabric* %0, %struct.fi_wait_attr* %1, %struct.fid_wait** %2) {
%4 = tail call i32 @gnix_wait_open(%struct.fid_fabric* %0, %struct.fi_wait_attr* %1, %struct.fid_wait** %2)
ret i32 %4
}
/* Variables and functions */
int mode_size_y(int /*<<< orphan*/);
int /*<<< orphan*/ video_current_mode();
unsigned video_size_y(void) { return mode_size_y(video_current_mode()); }


x86 assembly (clang, -O0):
<video_size_y>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <video_current_mode@plt>
mov    %eax,%edi
call   1040 <mode_size_y@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_size_y>:
push   %rax
xor    %eax,%eax
call   1030 <video_current_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mode_size_y@plt>

LLVM IR (-O0):
define i32 @video_size_y() {
%1 = call i32 (...) @video_current_mode()
%2 = call i32 @mode_size_y(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @video_size_y() {
%1 = tail call i32 (...) @video_current_mode()
%2 = tail call i32 @mode_size_y(i32 %1)
ret i32 %2
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", any("xbcde", "HeGcKl"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"xbcde\00"
@.str.2 = [7 x i8] c"HeGcKl\00"
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int bar();
int baz();
int foo(int p) {
  int y = p;
  int x = bar();
  if (x == 0)
    y = baz();
  return x + y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114f <foo+0x2f>
mov    $0x0,%al
call   1030 <baz@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <bar@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113b <foo+0x1b>
xor    %eax,%eax
call   1030 <baz@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 (...) @bar()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @baz()
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_cmpeq_pi32(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cmpeq_pi32@plt>

LLVM IR (-O0):
define i32 @test(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 @_mm_cmpeq_pi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pi32(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void LCDIDDDMADisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000000C))) &= ~0x00000100;
}


x86 assembly (clang, -O0):
<LCDIDDDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDDMADisable>:
andq   $0xfffffffffffffeff,0xc(%rdi)
ff
ret

LLVM IR (-O0):
define void @LCDIDDDMADisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -257
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @LCDIDDDMADisable(i64 %0) {
%2 = add nsw i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -257
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *gp_basename(char *path) {
  char *basename = strrchr(path, '/');
  if (basename) {
    basename++;
    return basename;
  }
  return path;
}


x86 assembly (clang, -O0):
<gp_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <gp_basename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <gp_basename+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gp_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %15
13: ; preds = %1
%14 = load i8*, i8** %3
store i8* %14, i8** %2
br label %15
15: ; preds = %13, %9
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @gp_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void woodstock_disassemble_then(int addr, int op2, char *buf, int len) {
  snprintf(buf, len, " then go to %04o", (addr & 006000) + op2);
}


x86 assembly (clang, -O0):
<woodstock_disassemble_then>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%ecx
and    $0xc00,%ecx
add    -0x8(%rbp),%ecx
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<woodstock_disassemble_then>:
mov    %rdx,%r8
and    $0xc00,%edi
lea    (%rdi,%rsi,1),%eax
lea    0xedd(%rip),%rdx
mov    %r8,%rdi
mov    %ecx,%esi
mov    %eax,%ecx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c" then go to %04o\00"
define void @woodstock_disassemble_then(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = and i32 %11, 3072
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c" then go to %04o\00"
define void @woodstock_disassemble_then(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = and i32 %0, 3072
%6 = add nsw i32 %5, %1
%7 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int Uint64ToInt(uint64_t value) { return (int)value; }


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

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

LLVM IR (-O0):
define i32 @Uint64ToInt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @Uint64ToInt(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
int main() {
  int b = 8;
  float a = 8;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 8, i32* %1
store float 8.000000e+00, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double dethrf(double, int);
double produce(double age) { return dethrf(age, 1); }


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

x86 assembly (clang, -O2):
<produce>:
mov    $0x1,%edi
jmp    1030 <dethrf@plt>

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

LLVM IR (-O2):
define double @produce(double %0) {
%2 = tail call double @dethrf(double %0, i32 1)
ret double %2
}