xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int *malloc(size_t);
int /*<<< orphan*/ memcpy(int *, int *, size_t);
int /*<<< orphan*/ stderr;
int *icopy(int data) {
  int *new;
  size_t sz = sizeof(int);
  if ((new = malloc(sz)) == NULL) {
    fprintf(stderr, "icopy malloc failed\n");
    return NULL;
  }
  memcpy(new, &data, sz);
  return new;
}


x86 assembly (clang, -O0):
<icopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x4,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117c <icopy+0x4c>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1195 <icopy+0x65>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    -0xc(%rbp),%rsi
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icopy>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115f <icopy+0x2f>
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
jmp    1174 <icopy+0x44>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"icopy malloc failed\0A\00"
define i32* @icopy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32* @malloc(i64 4)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @memcpy(i32* %3, i32* %2, i64 4)
br label %10
10: ; preds = %8, %5
ret i32* %3
}
unsigned long rho_ruby_get_NIL() { return 0; }


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

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

LLVM IR (-O0):
define i64 @rho_ruby_get_NIL() {
ret i64 0
}

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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%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    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [10 x i8] c"Usage: %s\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [10 x i8] c"Usage: %s\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int dWrite(int, char *);
int safe_dWrite(int addr, char *buf) {
  int result = 0;
  while ((result = dWrite(addr, buf))) {
    if (result == 2) {
      return 2;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<safe_dWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <dWrite@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1159 <safe_dWrite+0x49>
cmpl   $0x2,-0x14(%rbp)
jne    1154 <safe_dWrite+0x44>
movl   $0x2,-0x4(%rbp)
jmp    115f <safe_dWrite+0x4f>
jmp    1126 <safe_dWrite+0x16>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_dWrite>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <dWrite@plt>
test   $0xfffffffd,%eax
jne    1120 <safe_dWrite+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @safe_dWrite(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @dWrite(i32 %8, i8* %9)
store i32 %10, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 2, i32* %3
br label %19
16: ; preds = %12
br label %7
17: ; preds = %7
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @safe_dWrite(i32 %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @dWrite(i32 %0, i8* %1)
switch i32 %4, label %3 [
i32 0, label %5
i32 2, label %5
]
5: ; preds = %3, %3
ret i32 %4
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  int len;
  int max;
  char line[1000];
  char longest[1000];
  max = 0;
  while ((len = getline(line, 1000)) > 0)
    if (len > 0) {
      reverse(line);
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1194 <main+0x64>
cmpl   $0x0,-0x8(%rbp)
jle    118f <main+0x5f>
lea    -0x400(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x400(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
unsigned long popcount64(unsigned long n) {
  n -= (n >> 1) & 0x5555555555555555UL;
  n = (n & 0x3333333333333333UL) + ((n >> 2) & 0x3333333333333333UL);
  return (((n + (n >> 4)) & 0xF0F0F0F0F0F0F0FUL) * 0x101010101010101UL) >> 56;
}


x86 assembly (clang, -O0):
<popcount64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
movabs $0x5555555555555555,%rax
55 55 55
and    %rax,%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0x3333333333333333,%rax
33 33 33
and    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount64>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i64 @popcount64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 1
%5 = and i64 %4, 6148914691236517205
%6 = load i64, i64* %2
%7 = sub i64 %6, %5
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = and i64 %8, 3689348814741910323
%10 = load i64, i64* %2
%11 = lshr i64 %10, 2
%12 = and i64 %11, 3689348814741910323
%13 = add i64 %9, %12
store i64 %13, i64* %2
%14 = load i64, i64* %2
%15 = load i64, i64* %2
%16 = lshr i64 %15, 4
%17 = add i64 %14, %16
%18 = and i64 %17, 1085102592571150095
%19 = mul i64 %18, 72340172838076673
%20 = lshr i64 %19, 56
ret i64 %20
}

LLVM IR (-O2):
define i64 @popcount64(i64 %0) {
%2 = lshr i64 %0, 1
%3 = and i64 %2, 6148914691236517205
%4 = sub i64 %0, %3
%5 = and i64 %4, 3689348814741910323
%6 = lshr i64 %4, 2
%7 = and i64 %6, 3689348814741910323
%8 = add nuw nsw i64 %7, %5
%9 = lshr i64 %8, 4
%10 = add nuw nsw i64 %9, %8
%11 = and i64 %10, 1085102592571150095
%12 = mul i64 %11, 72340172838076673
%13 = lshr i64 %12, 56
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int replace_byte(int, int, int);
int main(int argc, char *argv[]) {
  unsigned rep_0 = replace_byte(0x12345678, 0, 0xAB);
  unsigned rep_3 = replace_byte(0x12345678, 3, 0xAB);
  assert(rep_0 == 0x123456AB);
  assert(rep_3 == 0xAB345678);
  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)
mov    $0x12345678,%edi
xor    %esi,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,-0x14(%rbp)
mov    $0x12345678,%edi
mov    $0x3,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x123456ab,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xab345678,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x12345678,%edi
xor    %esi,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,%ebx
mov    $0x12345678,%edi
mov    $0x3,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x123456ab,%ebx
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0xab345678,%ebp
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @replace_byte(i32 305419896, i32 0, i32 171)
store i32 %8, i32* %6
%9 = call i32 @replace_byte(i32 305419896, i32 3, i32 171)
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 305419947
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1422633352
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @replace_byte(i32 305419896, i32 0, i32 171)
%4 = tail call i32 @replace_byte(i32 305419896, i32 3, i32 171)
%5 = icmp eq i32 %3, 305419947
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp eq i32 %4, -1422633352
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
/* Type definitions */
struct proxy_server {
  int dummy;
};

/* Variables and functions */
int proxy_server_accept(struct proxy_server *);
int proxy_server_accept_cb(void *ps, void *data) {
  return proxy_server_accept((struct proxy_server *)ps);
}


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

x86 assembly (clang, -O2):
<proxy_server_accept_cb>:
jmp    1030 <proxy_server_accept@plt>

LLVM IR (-O0):
%struct.proxy_server = type { i32 }
define i32 @proxy_server_accept_cb(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 = bitcast i8* %5 to %struct.proxy_server*
%7 = call i32 @proxy_server_accept(%struct.proxy_server* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.proxy_server = type { i32 }
define i32 @proxy_server_accept_cb(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to %struct.proxy_server*
%4 = tail call i32 @proxy_server_accept(%struct.proxy_server* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("pakfir <out_fir_file> <in_wif_file> <camera_id> [version]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [59 x i8] c"pakfir <out_fir_file> <in_wif_file> <camera_id> [version]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"pakfir <out_fir_file> <in_wif_file> <camera_id> [version]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
unsigned int Mod(unsigned int Dividend, unsigned int Divisor) {
  unsigned int Temp;
  Temp = Dividend;
  while (Temp >= Divisor) {
    Temp -= Divisor;
  }
  return Temp;
}


x86 assembly (clang, -O0):
<Mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     112c <Mod+0x2c>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <Mod+0x10>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mod>:
mov    %edi,%eax
add    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    %esi,%eax
cmp    %esi,%eax
jae    1110 <Mod+0x10>
ret

LLVM IR (-O0):
define i32 @Mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp uge i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub i32 %13, %12
store i32 %14, i32* %5
br label %7
15: ; preds = %7
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @Mod(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp ult i32 %4, %1
%6 = sub i32 %4, %1
br i1 %5, label %7, label %3
7: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpunord_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 f2(__m128 x, __m128 y) { return _mm_cmpunord_ps(x, y); }


x86 assembly (clang, -O0):
<f2>:
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_cmpunord_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <_mm_cmpunord_ps@plt>

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpunord_ps(i32 %0, i32 %1)
ret i32 %3
}
void RGB24ToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToYRow_NEON() {
ret void
}
int test_imm_0Fuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x0F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 983040
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ test_destroy_helper1();
void *test_destroy_helper1_wrap(void *v __attribute__((unused))) {
  return (void *)(intptr_t)test_destroy_helper1();
}


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

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

LLVM IR (-O0):
define i8* @test_destroy_helper1_wrap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @test_destroy_helper1()
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @test_destroy_helper1_wrap(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @test_destroy_helper1()
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
scalar_t__ is_path_delim(char);
char as_path_delim(char c) { return is_path_delim(c) ? c : '/'; }


x86 assembly (clang, -O0):
<as_path_delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_path_delim@plt>
cmp    $0x0,%rax
je     113d <as_path_delim+0x2d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114a <as_path_delim+0x3a>
mov    $0x2f,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <as_path_delim+0x3a>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<as_path_delim>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_path_delim@plt>
test   %rax,%rax
mov    $0x2f,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @as_path_delim(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_path_delim(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i32 [ %8, %6 ], [ 47, %9 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @as_path_delim(i8 signext %0) {
%2 = tail call i64 @is_path_delim(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 47, i8 %0
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexGenf(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void TexGenf(GLenum coord, GLenum pname, GLfloat param) {
  glTexGenf(coord, pname, param);
}


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

x86 assembly (clang, -O2):
<TexGenf>:
jmp    1030 <glTexGenf@plt>

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

LLVM IR (-O2):
define void @TexGenf(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTexGenf(i32 %0, i32 %1, i32 %2)
ret void
}
unsigned kr_hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<kr_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <kr_hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <kr_hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kr_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <kr_hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <kr_hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @kr_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
struct oscap_string {
  int dummy;
};
struct oscap_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_buffer_append_string(struct oscap_buffer *,
                                              char const *);
void oscap_string_append_string(struct oscap_string *s, const char *t) {
  oscap_buffer_append_string((struct oscap_buffer *)s, t);
}


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

x86 assembly (clang, -O2):
<oscap_string_append_string>:
jmp    1030 <oscap_buffer_append_string@plt>

LLVM IR (-O0):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_append_string(%struct.oscap_string* %0, i8* %1) {
%3 = alloca %struct.oscap_string*
%4 = alloca i8*
store %struct.oscap_string* %0, %struct.oscap_string** %3
store i8* %1, i8** %4
%5 = load %struct.oscap_string*, %struct.oscap_string** %3
%6 = bitcast %struct.oscap_string* %5 to %struct.oscap_buffer*
%7 = load i8*, i8** %4
%8 = call i32 @oscap_buffer_append_string(%struct.oscap_buffer* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_append_string(%struct.oscap_string* %0, i8* %1) {
%3 = bitcast %struct.oscap_string* %0 to %struct.oscap_buffer*
%4 = tail call i32 @oscap_buffer_append_string(%struct.oscap_buffer* %3, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ haraka512_4x(unsigned char *, unsigned char const *);
void haraka512_8x(unsigned char *out, const unsigned char *in) {
  haraka512_4x(out, in);
  haraka512_4x(out + 128, in + 256);
}


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

x86 assembly (clang, -O2):
<haraka512_8x>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <haraka512_4x@plt>
sub    $0xffffffffffffff80,%rbx
add    $0x100,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <haraka512_4x@plt>

LLVM IR (-O0):
define void @haraka512_8x(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @haraka512_4x(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 128
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 256
%12 = call i32 @haraka512_4x(i8* %9, i8* %11)
ret void
}

LLVM IR (-O2):
define void @haraka512_8x(i8* %0, i8* %1) {
%3 = tail call i32 @haraka512_4x(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 128
%5 = getelementptr inbounds i8, i8* %1, i64 256
%6 = tail call i32 @haraka512_4x(i8* %4, i8* %5)
ret void
}
int test_imm_18int64_lowword_reg(long long val) {
  return ((val) & (0x18 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_18int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 24
%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_18int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 24
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double _rnd(d)
double d;
{
  double f;
  f = (int)rand();
  return (f / 32767.0);
}


x86 assembly (clang, -O0):
<_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
divsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_rnd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i32 (...) @rand()
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 3.276700e+04
ret double %7
}

LLVM IR (-O2):
define double @_rnd(double %0) {
%2 = tail call i32 (...) @rand()
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 3.276700e+04
ret double %4
}
/* Variables and functions */
unsigned char *gpi_exif_get_thumbnail_and_size(void *exifdat, long *size) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @gpi_exif_get_thumbnail_and_size(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i8* null
}
int weechat_plugin_end(struct t_weechat_plugin *plugin) {
  (void)plugin;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.t_weechat_plugin = type opaque
define i32 @weechat_plugin_end(%struct.t_weechat_plugin* nocapture readnone %0) {
ret i32 0
}
int in_def_get_key_code(const char *key_name) { return -1; }


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

x86 assembly (clang, -O2):
<in_def_get_key_code>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @in_def_get_key_code(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int printf(char *);
main() { return printf("hello, world\n"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@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))
ret i32 %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int M_PI;
float deg2radf(float deg) { return deg * (M_PI / 180); }


x86 assembly (clang, -O0):
<deg2radf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2radf>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @deg2radf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 180
%6 = sitofp i32 %5 to float
%7 = fmul float %3, %6
ret float %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @deg2radf(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to float
%5 = fmul float %4, %0
ret float %5
}
void HSMMCSDModuleClkConfig(void) {
  (*((volatile unsigned int *)((0x44E00000) + (0x3c)))) |= (0x2u);
  while (((*((volatile unsigned int *)((0x44E00000) + (0x3c)))) &
          (0x00000003u)) != (0x2u))
    ;
}


x86 assembly (clang, -O0):
<HSMMCSDModuleClkConfig>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e0003c,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x44e0003c,%eax
mov    %ecx,(%rax)
mov    $0x44e0003c,%eax
mov    (%rax),%eax
and    $0x3,%eax
cmp    $0x2,%eax
je     112d <HSMMCSDModuleClkConfig+0x2d>
jmp    1115 <HSMMCSDModuleClkConfig+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDModuleClkConfig>:
orl    $0x2,0x44e0003c
02
nopl   0x0(%rax,%rax,1)
mov    0x44e0003c,%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    1110 <HSMMCSDModuleClkConfig+0x10>
ret

LLVM IR (-O0):
define void @HSMMCSDModuleClkConfig() {
%1 = load volatile i32, i32* inttoptr (i64 1155530812 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1155530812 to i32*)
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 1155530812 to i32*)
%5 = and i32 %4, 3
%6 = icmp ne i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @HSMMCSDModuleClkConfig() {
%1 = load volatile i32, i32* inttoptr (i64 1155530812 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1155530812 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1155530812 to i32*)
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
int video_supports_multiple_contexts(struct host *base) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.host = type opaque
define i32 @video_supports_multiple_contexts(%struct.host* nocapture readnone %0) {
ret i32 0
}
int fun628() { return 628; }


x86 assembly (clang, -O0):
<fun628>:
push   %rbp
mov    %rsp,%rbp
mov    $0x274,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun628>:
mov    $0x274,%eax
ret

LLVM IR (-O0):
define i32 @fun628() {
ret i32 628
}

LLVM IR (-O2):
define i32 @fun628() {
ret i32 628
}
/* Variables and functions */
int /*<<< orphan*/ ftest1();
int /*<<< orphan*/ printf(char *);
void ftest2(void) {
  ftest1();
  printf("ftest2\n");
}


x86 assembly (clang, -O0):
<ftest2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ftest1@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftest2>:
push   %rax
xor    %eax,%eax
call   1040 <ftest1@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [7 x i8] c"ftest2\00"
define void @ftest2() {
%1 = tail call i32 (...) @ftest1()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int do_673() { return 673; }


x86 assembly (clang, -O0):
<do_673>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_673>:
mov    $0x2a1,%eax
ret

LLVM IR (-O0):
define i32 @do_673() {
ret i32 673
}

LLVM IR (-O2):
define i32 @do_673() {
ret i32 673
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void HandleTag(void *cookie, const char *szString) {
  printf("tagHandler: '%s'\n", szString);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"tagHandler: '%s'\0A\00"
define void @HandleTag(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void RESERVED31_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @RESERVED31_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @RESERVED31_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int pure_i(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @pure_i(i32 returned %0) {
ret i32 %0
}
float __fdiv_ru(float x, float y) { return x / y; }


x86 assembly (clang, -O0):
<__fdiv_ru>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdiv_ru>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__fdiv_ru(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 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @__fdiv_ru(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
char fpeek(FILE *stream) {
  char c;
  c = (char)fgetc(stream);
  ungetc(((int)c), stream);
  return c;
}


x86 assembly (clang, -O0):
<fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpeek>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %rax,%rbx
movsbl %bl,%edi
mov    %r14,%rsi
call   1040 <ungetc@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @fpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @fgetc(i32* %4)
%6 = trunc i64 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = load i32*, i32** %2
%10 = call i32 @ungetc(i32 %8, i32* %9)
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @fpeek(i32* nocapture %0) {
%2 = tail call i64 @fgetc(i32* %0)
%3 = trunc i64 %2 to i8
%4 = sext i8 %3 to i32
%5 = tail call i32 @ungetc(i32 %4, i32* %0)
ret i8 %3
}
int gCount(int month) { return (month <= 2) ? month + 13 : month + 1; }


x86 assembly (clang, -O0):
<gCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     111f <gCount+0x1f>
mov    -0x4(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <gCount+0x28>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gCount>:
lea    0x1(%rdi),%ecx
lea    0xd(%rdi),%eax
cmp    $0x3,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 13
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @gCount(i32 %0) {
%2 = icmp slt i32 %0, 3
%3 = select i1 %2, i32 13, i32 1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int host_cache_line_size();
int main() { return host_cache_line_size(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @host_cache_line_size()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @host_cache_line_size()
ret i32 %1
}
void sendlogon() {}


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

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

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

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