xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int do_pk8pkey_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int,
                  int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ *,
                  void *);
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr,
                               int klen, pem_password_cb *cb, void *u) {
  return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<i2d_PKCS8PrivateKey_nid_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey_fp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PKCS8PrivateKey_nid_fp>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %edx,%ecx
sub    $0x8,%rsp
mov    $0x1,%edx
xor    %r8d,%r8d
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey_fp@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2d_PKCS8PrivateKey_nid_fp(i32* %0, i32* %1, i32 %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i8* %6, i8** %14
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i8*, i8** %14
%22 = call i32 @do_pk8pkey_fp(i32* %15, i32* %16, i32 1, i32 %17, i32* null, i8* %18, i32 %19, i32* %20, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @i2d_PKCS8PrivateKey_nid_fp(i32* %0, i32* %1, i32 %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey_fp(i32* %0, i32* %1, i32 1, i32 %2, i32* null, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
int isArgFile(const char *arg) { return arg[0] != '-'; }


x86 assembly (clang, -O0):
<isArgFile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isArgFile>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @isArgFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 45
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isArgFile(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 45
%4 = zext i1 %3 to i32
ret i32 %4
}
int test20_remove_eldest_1(const struct l_hashtbl *h, unsigned long count) {
  (void)(h);
  (void)(count);
  return (count > 3) ? 1 : 0;
}


x86 assembly (clang, -O0):
<test20_remove_eldest_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3,%rdx
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test20_remove_eldest_1>:
xor    %eax,%eax
cmp    $0x4,%rsi
setae  %al
ret

LLVM IR (-O0):
%struct.l_hashtbl = type opaque
define i32 @test20_remove_eldest_1(%struct.l_hashtbl* %0, i64 %1) {
%3 = alloca %struct.l_hashtbl*
%4 = alloca i64
store %struct.l_hashtbl* %0, %struct.l_hashtbl** %3
store i64 %1, i64* %4
%5 = load %struct.l_hashtbl*, %struct.l_hashtbl** %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = icmp ugt i64 %7, 3
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
%struct.l_hashtbl = type opaque
define i32 @test20_remove_eldest_1(%struct.l_hashtbl* nocapture readnone %0, i64 %1) {
%3 = icmp ugt i64 %1, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ is_bin(char const *);
scalar_t__ is_dec(char const *);
scalar_t__ is_hex(char const *);
scalar_t__ is_oct(char const *);
bool is_int(const char *s) {
  if (is_bin(s) || is_oct(s) || is_dec(s) || is_hex(s)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <is_bin@plt>
cmp    $0x0,%rax
jne    1198 <is_int+0x58>
mov    -0x10(%rbp),%rdi
call   1050 <is_oct@plt>
cmp    $0x0,%rax
jne    1198 <is_int+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <is_dec@plt>
cmp    $0x0,%rax
jne    1198 <is_int+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <is_hex@plt>
cmp    $0x0,%rax
je     11a4 <is_int+0x64>
movl   $0x1,-0x4(%rbp)
jmp    11ab <is_int+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <is_bin@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1180 <is_int+0x40>
mov    %rbx,%rdi
call   1050 <is_oct@plt>
test   %rax,%rax
jne    1180 <is_int+0x40>
mov    %rbx,%rdi
call   1040 <is_dec@plt>
test   %rax,%rax
jne    1180 <is_int+0x40>
mov    %rbx,%rdi
call   1030 <is_hex@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_int(i8* %0) {
%2 = tail call i64 @is_bin(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = tail call i64 @is_oct(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = tail call i64 @is_dec(i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i64 @is_hex(i8* %0)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %1, %4, %7
%15 = phi i32 [ 1, %7 ], [ 1, %4 ], [ 1, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int null_open(int w, int h, int fs) {
  printf("open\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"open\0A\00"
define i32 @null_open(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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [5 x i8] c"open\00"
define i32 @null_open(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ addChallenge(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(int /*<<< orphan*/);
void CG_ParseChallenge(void) { addChallenge(atoi(CG_Argv(1))); }


x86 assembly (clang, -O0):
<CG_ParseChallenge>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <addChallenge@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_ParseChallenge>:
push   %rax
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%edi
call   1050 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <addChallenge@plt>

LLVM IR (-O0):
define void @CG_ParseChallenge() {
%1 = call i32 @CG_Argv(i32 1)
%2 = call i32 @atoi(i32 %1)
%3 = call i32 @addChallenge(i32 %2)
ret void
}

LLVM IR (-O2):
define void @CG_ParseChallenge() {
%1 = tail call i32 @CG_Argv(i32 1)
%2 = tail call i32 @atoi(i32 %1)
%3 = tail call i32 @addChallenge(i32 %2)
ret void
}
/* Variables and functions */
int bin_to_dec(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("1111111111111111 to decimal = %d\n", bin_to_dec("1111111111111111"));
  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    0xee5(%rip),%rdi
call   1040 <bin_to_dec@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    0xefa(%rip),%rdi
call   1040 <bin_to_dec@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"1111111111111111 to decimal = %d\0A\00"
@.str.1 = [17 x i8] c"1111111111111111\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 i32 @bin_to_dec(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"1111111111111111 to decimal = %d\0A\00"
@.str.1 = [17 x i8] c"1111111111111111\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bin_to_dec(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void initialize(void) { "nothing to do here"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"nothing to do here\00"
define void @initialize() {
ret void
}

LLVM IR (-O2):
define void @initialize() {
ret void
}
/* Variables and functions */
scalar_t__ check_year(int);
scalar_t__ isleap(int);
int check_yd(int year, int yearday) {
  return check_year(year) && (1 <= yearday) &&
         (yearday <= (isleap(year) ? 366 : 365));
}


x86 assembly (clang, -O0):
<check_yd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <check_year@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1188 <check_yd+0x68>
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1188 <check_yd+0x68>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isleap@plt>
mov    %rax,%rsi
mov    -0x10(%rbp),%eax
mov    $0x16d,%ecx
mov    $0x16e,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_yd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <check_year@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %ebx,%ebx
jle    1154 <check_yd+0x34>
test   %rcx,%rcx
je     1154 <check_yd+0x34>
mov    %ebp,%edi
call   1030 <isleap@plt>
cmp    $0x1,%rax
mov    $0x16e,%ecx
sbb    $0x0,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setae  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_yd(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 = call i64 @check_year(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 1, %9
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = call i64 @isleap(i32 %13)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 366, i32 365
%18 = icmp sle i32 %12, %17
br label %19
19: ; preds = %11, %8, %2
%20 = phi i1 [ false, %8 ], [ false, %2 ], [ %18, %11 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @check_yd(i32 %0, i32 %1) {
%3 = tail call i64 @check_year(i32 %0)
%4 = icmp ne i64 %3, 0
%5 = icmp sgt i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = tail call i64 @isleap(i32 %0)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 365, i32 366
%11 = icmp uge i32 %10, %1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
void oil_random_alpha(void) {}


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

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

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

LLVM IR (-O2):
define void @oil_random_alpha() {
ret void
}
int solve_problem(int n) {
  int f;
  if (n == 10)
    f = 1;
  else
    f = (solve_problem(n + 1) + 1) * 2;
  return f;
}


x86 assembly (clang, -O0):
<solve_problem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1131 <solve_problem+0x21>
movl   $0x1,-0x8(%rbp)
jmp    1145 <solve_problem+0x35>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <solve_problem@plt>
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_problem>:
mov    $0x1,%eax
cmp    $0xa,%edi
je     112c <solve_problem+0x1c>
push   %rax
add    $0x1,%edi
call   1030 <solve_problem@plt>
add    %eax,%eax
add    $0x2,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @solve_problem(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, 1
%7 = tail call i32 @solve_problem(i32 %6)
%8 = shl i32 %7, 1
%9 = add i32 %8, 2
br label %3
}
__attribute__((visibility("default"))) double echo_double(double arg, ...) {
  return arg;
}


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

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

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

LLVM IR (-O2):
define double @echo_double(double returned %0, ...) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ cli();
int /*<<< orphan*/ crcInit();
int main(int argc, char *argv[]) {
  crcInit();
  cli();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <crcInit@plt>
mov    $0x0,%al
call   1030 <cli@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 i32 (...) @crcInit()
%7 = call i32 (...) @cli()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @crcInit()
%4 = tail call i32 (...) @cli()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 9;
  if (i == 6) {
    printf("Hello");
  } else {
    char c = 'c';
    printf("%c\n", c);
  }
  int i2 = 9;
  if (i2 != 6) {
    printf("Hello");
  } else {
    char c2 = 'c';
    printf("%c", c2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jne    1143 <main+0x33>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
movb   $0x63,-0x9(%rbp)
movsbl -0x9(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x9,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
je     117d <main+0x6d>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1193 <main+0x83>
movb   $0x63,-0x11(%rbp)
movsbl -0x11(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 99)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lexer();
void aodl_run() { lexer(); }


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

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

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

LLVM IR (-O2):
define void @aodl_run() {
%1 = tail call i32 (...) @lexer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
int32_t UP3D_GetUsedNozzle() { return UP3D_GetParameter(0x2C); }


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

x86 assembly (clang, -O2):
<UP3D_GetUsedNozzle>:
mov    $0x2c,%edi
jmp    1030 <UP3D_GetParameter@plt>

LLVM IR (-O0):
define i32 @UP3D_GetUsedNozzle() {
%1 = call i32 @UP3D_GetParameter(i32 44)
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_GetUsedNozzle() {
%1 = tail call i32 @UP3D_GetParameter(i32 44)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key_handler(unsigned char k, int x, int y) {
  if (k == 27 || k == 'q' || k == 'Q') {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<key_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
je     114b <key_handler+0x3b>
movzbl -0x1(%rbp),%eax
cmp    $0x71,%eax
je     114b <key_handler+0x3b>
movzbl -0x1(%rbp),%eax
cmp    $0x51,%eax
jne    1152 <key_handler+0x42>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_handler>:
cmp    $0x1b,%dil
je     1123 <key_handler+0x13>
cmp    $0x71,%dil
je     1123 <key_handler+0x13>
cmp    $0x51,%dil
je     1123 <key_handler+0x13>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key_handler(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %18, label %10
10: ; preds = %3
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 113
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 81
br i1 %17, label %18, label %20
18: ; preds = %14, %10, %3
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @key_handler(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %6 [
i8 113, label %4
i8 81, label %4
i8 27, label %4
]
4: ; preds = %3, %3, %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_memchunk();
int /*<<< orphan*/ test_umemdup();
int main(void) {
  test_umemdup();
  test_memchunk();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_umemdup@plt>
mov    $0x0,%al
call   1040 <test_memchunk@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_umemdup()
%2 = call i32 (...) @test_memchunk()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_umemdup()
%2 = tail call i32 (...) @test_memchunk()
ret i32 0
}
/* Type definitions */
struct treelinknode {
  int dummy;
};

/* Variables and functions */
int set_parent(struct treelinknode *, int /*<<< orphan*/);
void connect(struct treelinknode *root) {
  if (!root)
    return;
  int level = set_parent(root, 0);
  for (int i = level; i > 0; --i) {
  }
}


x86 assembly (clang, -O0):
<connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <connect+0x1c>
jmp    115d <connect+0x4d>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <set_parent@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    115d <connect+0x4d>
jmp    114f <connect+0x3f>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <connect+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect>:
test   %rdi,%rdi
je     111c <connect+0xc>
xor    %esi,%esi
jmp    1030 <set_parent@plt>
ret

LLVM IR (-O0):
%struct.treelinknode = type { i32 }
define void @connect(%struct.treelinknode* %0) {
%2 = alloca %struct.treelinknode*
%3 = alloca i32
%4 = alloca i32
store %struct.treelinknode* %0, %struct.treelinknode** %2
%5 = load %struct.treelinknode*, %struct.treelinknode** %2
%6 = icmp ne %struct.treelinknode* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %19
8: ; preds = %1
%9 = load %struct.treelinknode*, %struct.treelinknode** %2
%10 = call i32 @set_parent(%struct.treelinknode* %9, i32 0)
store i32 %10, i32* %3
%11 = load i32, i32* %3
store i32 %11, i32* %4
br label %12
12: ; preds = %16, %8
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
br label %12
19: ; preds = %7, %12
ret void
}

LLVM IR (-O2):
%struct.treelinknode = type { i32 }
define void @connect(%struct.treelinknode* %0) {
%2 = icmp eq %struct.treelinknode* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @set_parent(%struct.treelinknode* %0, i32 0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Ch(uint32_t x, uint32_t y, uint32_t z) { return (x & y) ^ (~x & z); }


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

x86 assembly (clang, -O2):
<Ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Ch(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 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
void rep_nop(void) { __asm volatile("rep; nop" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @rep_nop() {
tail call void asm sideeffect "rep; nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void DrawAmmo() {
  int x, y;
  x = 640 - 80;
  y = 480 - 80;
}


x86 assembly (clang, -O0):
<DrawAmmo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x230,-0x4(%rbp)
movl   $0x190,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @DrawAmmo() {
%1 = alloca i32
%2 = alloca i32
store i32 560, i32* %1
store i32 400, i32* %2
ret void
}

LLVM IR (-O2):
define void @DrawAmmo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize_array(unsigned char *, int);
int test15(void) {
  unsigned char a[480];
  initialize_array(a, 480);
  if (a[0] == 0x10)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
lea    -0x1f0(%rbp),%rdi
mov    $0x1e0,%esi
call   1030 <initialize_array@plt>
movzbl -0x1f0(%rbp),%eax
cmp    $0x10,%eax
jne    1148 <test15+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <test15+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15>:
sub    $0x1e8,%rsp
mov    %rsp,%rdi
mov    $0x1e0,%esi
call   1030 <initialize_array@plt>
xor    %eax,%eax
cmpb   $0x10,(%rsp)
sete   %al
add    $0x1e8,%rsp
ret

LLVM IR (-O0):
define i32 @test15() {
%1 = alloca i32
%2 = alloca [480 x i8]
%3 = getelementptr inbounds [480 x i8], [480 x i8]* %2, i64 0, i64 0
%4 = call i32 @initialize_array(i8* %3, i32 480)
%5 = getelementptr inbounds [480 x i8], [480 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 16
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @test15() {
%1 = alloca [480 x i8]
%2 = getelementptr inbounds [480 x i8], [480 x i8]* %1, i64 0, i64 0
%3 = call i32 @initialize_array(i8* %2, i32 480)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 16
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ usage();
int rp_parse_opts(int argc, const char **argv, const char **config) {
  (void)argc;
  (void)argv;
  (void)config;
  if (argc < 2) {
    usage();
    return 1;
  }
  *config = argv[1];
  return 0;
}


x86 assembly (clang, -O0):
<rp_parse_opts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1140 <rp_parse_opts+0x30>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1156 <rp_parse_opts+0x46>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_parse_opts>:
push   %rax
cmp    $0x1,%edi
jg     1124 <rp_parse_opts+0x14>
xor    %eax,%eax
call   1030 <usage@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rax
mov    %rax,(%rdx)
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rp_parse_opts(i32 %0, i8** nocapture %1, i8** nocapture writeonly %2) {
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @usage()
br label %10
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %11
}
unsigned int unsignedint_ignoring_shortint(unsigned int x, short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_shortint(i32 returned %0, i16 signext %1) {
ret i32 %0
}
void read_port(char *port_num, char *val) { *val = *port_num; }


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

x86 assembly (clang, -O2):
<read_port>:
mov    (%rdi),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @read_port(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* %5
%7 = load i8*, i8** %4
store i8 %6, i8* %7
ret void
}

LLVM IR (-O2):
define void @read_port(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
ret void
}
void upvp_to_xy(double up, double vp, double *xc, double *yc) {
  *xc = (9 * up) / ((6 * up) - (16 * vp) + 12);
  *yc = (4 * vp) / ((6 * up) - (16 * vp) + 12);
}


x86 assembly (clang, -O0):
<upvp_to_xy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xf02(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xeb4(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe9c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe9c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xe56(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe3e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upvp_to_xy>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
mulsd  %xmm1,%xmm3
mulsd  0xef0(%rip),%xmm0
addsd  %xmm3,%xmm0
addsd  0xeec(%rip),%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rdi)
mulsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @upvp_to_xy(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fmul double 9.000000e+00, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double 1.600000e+01, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %11, double %14)
%16 = fadd double %15, 1.200000e+01
%17 = fdiv double %10, %16
%18 = load double*, double** %7
store double %17, double* %18
%19 = load double, double* %6
%20 = fmul double 4.000000e+00, %19
%21 = load double, double* %5
%22 = load double, double* %6
%23 = fmul double 1.600000e+01, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %21, double %24)
%26 = fadd double %25, 1.200000e+01
%27 = fdiv double %20, %26
%28 = load double*, double** %8
store double %27, double* %28
ret void
}

LLVM IR (-O2):
define void @upvp_to_xy(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %0, 9.000000e+00
%6 = fmul double %1, -1.600000e+01
%7 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e+00, double %6)
%8 = fadd double %7, 1.200000e+01
%9 = fdiv double %5, %8
store double %9, double* %2
%10 = fmul double %1, 4.000000e+00
%11 = fdiv double %10, %8
store double %11, double* %3
ret void
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
struct hash *new_hash_size(int);
struct hash *new_hash(void) {
  return new_hash_size(50);
}


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

x86 assembly (clang, -O2):
<new_hash>:
mov    $0x32,%edi
jmp    1030 <new_hash_size@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define %struct.hash* @new_hash() {
%1 = call %struct.hash* @new_hash_size(i32 50)
ret %struct.hash* %1
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define %struct.hash* @new_hash() {
%1 = tail call %struct.hash* @new_hash_size(i32 50)
ret %struct.hash* %1
}
/* Variables and functions */
int /*<<< orphan*/ naive_col_convert(int, int *);
void col_convert(int dim, int *G) { naive_col_convert(dim, G); }


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

x86 assembly (clang, -O2):
<col_convert>:
jmp    1030 <naive_col_convert@plt>

LLVM IR (-O0):
define void @col_convert(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 @naive_col_convert(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @col_convert(i32 %0, i32* %1) {
%3 = tail call i32 @naive_col_convert(i32 %0, i32* %1)
ret void
}
char *textdomain(domainname) const char *domainname;
{ return libintl_textdomain(domainname); }


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

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

LLVM IR (-O0):
define i8* @textdomain(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @libintl_textdomain to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @textdomain(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @libintl_textdomain to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
char *freeipmi_strchr(const char *s, int c) {
  while (*s != '\0')
    if (*s == (char)c)
      return s;
    else
      s++;
  return NULL;
}


x86 assembly (clang, -O0):
<freeipmi_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <freeipmi_strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <freeipmi_strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <freeipmi_strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <freeipmi_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <freeipmi_strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <freeipmi_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <freeipmi_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @freeipmi_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
/* Type definitions */
struct bitarray {
  int dummy;
};

/* Variables and functions */
struct bitarray *cba_alloc(int /*<<< orphan*/);
int /*<<< orphan*/ cba_free(struct bitarray *);
int /*<<< orphan*/ cba_set_all(struct bitarray *);
int /*<<< orphan*/ printf(char *);
int test_set_all_empty(void) {
  struct bitarray *ba = NULL;
  {
    ba = cba_alloc(0);
    cba_set_all(ba);
  }
  printf("PASSED\n");
  if (ba)
    cba_free(ba);
  return 1;
}


x86 assembly (clang, -O0):
<test_set_all_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <cba_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <cba_set_all@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1184 <test_set_all_empty+0x44>
mov    -0x8(%rbp),%rdi
call   1050 <cba_free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_set_all_empty>:
push   %rbx
xor    %edi,%edi
call   1040 <cba_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <cba_set_all@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     116c <test_set_all_empty+0x2c>
mov    %rbx,%rdi
call   1050 <cba_free@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bitarray = type { i32 }
@.str = [8 x i8] c"PASSED\0A\00"
define i32 @test_set_all_empty() {
%1 = alloca %struct.bitarray*
store %struct.bitarray* null, %struct.bitarray** %1
%2 = call %struct.bitarray* @cba_alloc(i32 0)
store %struct.bitarray* %2, %struct.bitarray** %1
%3 = load %struct.bitarray*, %struct.bitarray** %1
%4 = call i32 @cba_set_all(%struct.bitarray* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.bitarray*, %struct.bitarray** %1
%7 = icmp ne %struct.bitarray* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load %struct.bitarray*, %struct.bitarray** %1
%10 = call i32 @cba_free(%struct.bitarray* %9)
br label %11
11: ; preds = %8, %0
ret i32 1
}

LLVM IR (-O2):
%struct.bitarray = type { i32 }
@str = [7 x i8] c"PASSED\00"
define i32 @test_set_all_empty() {
%1 = tail call %struct.bitarray* @cba_alloc(i32 0)
%2 = tail call i32 @cba_set_all(%struct.bitarray* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = icmp eq %struct.bitarray* %1, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @cba_free(%struct.bitarray* %1)
br label %7
7: ; preds = %5, %0
ret i32 1
}
int removeClientFromObserverList(struct __client *client) {}


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

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

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

LLVM IR (-O2):
%struct.__client = type opaque
define i32 @removeClientFromObserverList(%struct.__client* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int seteuid(uid_t euid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @seteuid(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ findMajority(char *, int, char *);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char m[14] = "AAACCBBCCCBCC";
  char majority;
  findMajority(m, 13, &majority);
  printf("Мажорант: %c\n", majority);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
mov    $0xd,%esi
lea    -0x13(%rbp),%rdx
call   1040 <findMajority@plt>
lea    0xea7(%rip),%rdi
movsbl -0x13(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x43434243434342,%rax
mov    %rax,0xe(%rsp)
movabs $0x4342424343414141,%rax
42 42 43
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x7(%rsp),%rdx
mov    $0xd,%esi
call   1040 <findMajority@plt>
movsbl 0x7(%rsp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.m = [14 x i8] c"AAACCBBCCCBCC\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%6 = call i32 @findMajority(i8* %5, i32 13, i8* %3)
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.m = [14 x i8] c"AAACCBBCCCBCC\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = call i32 @findMajority(i8* %3, i32 13, i8* %2)
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int _citrus_NONE_ctype_mbsrtowcs(void *, int /*<<< orphan*/ *, char const **,
                                 size_t, int /*<<< orphan*/ *, size_t *);
int _citrus_NONE_ctype_mbstowcs(void *__restrict cl, wchar_t *__restrict wcs,
                                const char *__restrict s, size_t n,
                                size_t *__restrict nresult) {
  const char *rs = s;
  return (_citrus_NONE_ctype_mbsrtowcs(cl, wcs, &rs, n, NULL, nresult));
}


x86 assembly (clang, -O0):
<_citrus_NONE_ctype_mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <_citrus_NONE_ctype_mbsrtowcs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_NONE_ctype_mbstowcs>:
push   %rax
mov    %r8,%r9
mov    %rdx,(%rsp)
mov    %rsp,%rdx
xor    %r8d,%r8d
call   1030 <_citrus_NONE_ctype_mbsrtowcs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_citrus_NONE_ctype_mbstowcs(i8* noalias %0, i32* noalias %1, i8* noalias %2, i64 %3, i64* noalias %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64*
%11 = alloca i8*
store i8* %0, i8** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64* %4, i64** %10
%12 = load i8*, i8** %8
store i8* %12, i8** %11
%13 = load i8*, i8** %6
%14 = load i32*, i32** %7
%15 = load i64, i64* %9
%16 = load i64*, i64** %10
%17 = call i32 @_citrus_NONE_ctype_mbsrtowcs(i8* %13, i32* %14, i8** %11, i64 %15, i32* null, i64* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @_citrus_NONE_ctype_mbstowcs(i8* noalias %0, i32* noalias %1, i8* noalias %2, i64 %3, i64* noalias %4) {
%6 = alloca i8*
%7 = bitcast i8** %6 to i8*
store i8* %2, i8** %6
%8 = call i32 @_citrus_NONE_ctype_mbsrtowcs(i8* %0, i32* %1, i8** %6, i64 %3, i32* null, i64* %4)
ret i32 %8
}