xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned short isblank(char c) { return (c == 0x20 || c == 0x09); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isblank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define zeroext i16 @isblank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @isblank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i16
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t htonll(uint64_t x) { return bswap_64(x); }


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

x86 assembly (clang, -O2):
<htonll>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x7e() {
  Assert_real((isspace(126) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              635, ("isspace should be 0 for ~"));
}


x86 assembly (clang, -O0):
<t_isspace_0x7e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x27b,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x7e>:
push   %rax
mov    $0x7e,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x27b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ~\00"
define void @t_isspace_0x7e() {
%1 = call i64 @isspace(i32 126)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ~\00"
define void @t_isspace_0x7e() {
%1 = tail call i64 @isspace(i32 126)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hijack_bar_intro();
int /*<<< orphan*/ hijack_bar_outro(int);
int /*<<< orphan*/ hijack_foo_intro(int, int);
int /*<<< orphan*/ hijack_foo_outro(int, int, int);
void eztrace_code0(int code) {
  switch (code) {
  case 1:
    hijack_foo_intro(42, 42);
    return;
  case 2:
    hijack_foo_outro(42, 42, 84);
    return;
  case 3:
    hijack_bar_intro();
    return;
  case 4:
    hijack_bar_outro(42);
    return;
  }
}


x86 assembly (clang, -O0):
<eztrace_code0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11b1 <eztrace_code0+0x71>
mov    -0x10(%rbp),%rax
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2a,%esi
mov    %esi,%edi
call   1050 <hijack_foo_intro@plt>
jmp    11b1 <eztrace_code0+0x71>
mov    $0x2a,%esi
mov    $0x54,%edx
mov    %esi,%edi
call   1030 <hijack_foo_outro@plt>
jmp    11b1 <eztrace_code0+0x71>
mov    $0x0,%al
call   1040 <hijack_bar_intro@plt>
jmp    11b1 <eztrace_code0+0x71>
mov    $0x2a,%edi
call   1060 <hijack_bar_outro@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eztrace_code0>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     1167 <eztrace_code0+0x27>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    $0x2a,%edi
mov    $0x2a,%esi
jmp    1050 <hijack_foo_intro@plt>
ret
mov    $0x2a,%edi
mov    $0x2a,%esi
mov    $0x54,%edx
jmp    1030 <hijack_foo_outro@plt>
xor    %eax,%eax
jmp    1040 <hijack_bar_intro@plt>
mov    $0x2a,%edi
jmp    1060 <hijack_bar_outro@plt>

LLVM IR (-O0):
define void @eztrace_code0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
]
4: ; preds = %1
%5 = call i32 @hijack_foo_intro(i32 42, i32 42)
br label %12
6: ; preds = %1
%7 = call i32 @hijack_foo_outro(i32 42, i32 42, i32 84)
br label %12
8: ; preds = %1
%9 = call i32 (...) @hijack_bar_intro()
br label %12
10: ; preds = %1
%11 = call i32 @hijack_bar_outro(i32 42)
br label %12
12: ; preds = %4, %6, %8, %10, %1
ret void
}

LLVM IR (-O2):
define void @eztrace_code0(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
]
2: ; preds = %1
%3 = tail call i32 @hijack_foo_intro(i32 42, i32 42)
br label %10
4: ; preds = %1
%5 = tail call i32 @hijack_foo_outro(i32 42, i32 42, i32 84)
br label %10
6: ; preds = %1
%7 = tail call i32 (...) @hijack_bar_intro()
br label %10
8: ; preds = %1
%9 = tail call i32 @hijack_bar_outro(i32 42)
br label %10
10: ; preds = %2, %4, %6, %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void cb(uint8_t opcode) {
  printf("cb unimplemented\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"cb unimplemented\0A\00"
define void @cb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [17 x i8] c"cb unimplemented\00"
define void @cb(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("привет\c мир!\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\D0\BF\D1\80\D0\B8\D0\B2\D0\B5\D1\82c \D0\BC\D0\B8\D1\80!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"\D0\BF\D1\80\D0\B8\D0\B2\D0\B5\D1\82c \D0\BC\D0\B8\D1\80!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int BuscaSequencial(int x, int n, int v[]) {
  int i;
  for (i = 0; i < n; i++)
    if (v[i] == x)
      return v[i];
}


x86 assembly (clang, -O0):
<BuscaSequencial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <BuscaSequencial+0x5b>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1148 <BuscaSequencial+0x48>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <BuscaSequencial+0x5b>
jmp    114d <BuscaSequencial+0x4d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <BuscaSequencial+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BuscaSequencial(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 0, i32* %8
br label %9
9: ; preds = %28, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %31
13: ; preds = %9
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %13
%22 = load i32*, i32** %7
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
store i32 %26, i32* %4
br label %31
27: ; preds = %13
br label %28
28: ; preds = %27
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
br label %9
31: ; preds = %21, %9
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @BuscaSequencial(i32 %0, i32 %1, i32* nocapture %2) {
ret i32 %0
}
char *string_array_replace(char **array, int pos, char *text) {
  char *old_text = array[pos];
  array[pos] = text;
  return old_text;
}


x86 assembly (clang, -O0):
<string_array_replace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_replace>:
movslq %esi,%rcx
mov    (%rdi,%rcx,8),%rax
mov    %rdx,(%rdi,%rcx,8)
ret

LLVM IR (-O0):
define i8* @string_array_replace(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8*, i8** %6
%14 = load i8**, i8*** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
store i8* %13, i8** %17
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
define i8* @string_array_replace(i8** nocapture %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
store i8* %2, i8** %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ gmx_msd(int, char **);
int main(int argc, char *argv[]) {
  gmx_msd(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_msd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_msd@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_msd(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_msd(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sig_blocknone(void) {
  sigset_t ss;
  sigemptyset(&ss);
  sigprocmask(SIG_SETMASK, &ss, (sigset_t *)0);
}


x86 assembly (clang, -O0):
<sig_blocknone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_blocknone>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @sig_blocknone() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIG_SETMASK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @sig_blocknone() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret void
}
int bits_litlength(int value) {
  if (value == 0) {
    return 1;
  } else if (value <= 2) {
    return 4;
  } else if (value <= 6) {
    return 5;
  } else if (value <= 22) {
    return 7;
  } else {
    return 9;
  }
}


x86 assembly (clang, -O0):
<bits_litlength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <bits_litlength+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <bits_litlength+0x66>
cmpl   $0x2,-0x8(%rbp)
jg     1133 <bits_litlength+0x33>
movl   $0x4,-0x4(%rbp)
jmp    1166 <bits_litlength+0x66>
cmpl   $0x6,-0x8(%rbp)
jg     1149 <bits_litlength+0x49>
movl   $0x5,-0x4(%rbp)
jmp    1166 <bits_litlength+0x66>
cmpl   $0x16,-0x8(%rbp)
jg     115f <bits_litlength+0x5f>
movl   $0x7,-0x4(%rbp)
jmp    1166 <bits_litlength+0x66>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_litlength>:
test   %edi,%edi
je     1126 <bits_litlength+0x26>
mov    $0x4,%eax
cmp    $0x3,%edi
jl     1125 <bits_litlength+0x25>
mov    $0x5,%eax
cmp    $0x7,%edi
jb     1125 <bits_litlength+0x25>
xor    %eax,%eax
cmp    $0x17,%edi
setae  %al
add    %eax,%eax
add    $0x7,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_litlength(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 3
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 7
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 23
%9 = select i1 %8, i32 7, i32 9
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 4, %3 ], [ 5, %5 ], [ %9, %7 ]
ret i32 %11
}
void gtk_window_unfullscreen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_unfullscreen() {
ret void
}
int compare(const void *a, const void *b) { return *((int *)a) - *((int *)b); }


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memcpy4_impl(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


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

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

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy4_impl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
long long __rthal_generic_ullimd(long long, unsigned int, unsigned int);
__attribute__((__const__)) long long
__rthal_generic_llimd(long long op, unsigned m, unsigned d) {
  if (op < 0LL)
    return -__rthal_generic_ullimd(-op, m, d);
  return __rthal_generic_ullimd(op, m, d);
}


x86 assembly (clang, -O0):
<__rthal_generic_llimd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1151 <__rthal_generic_llimd+0x41>
xor    %eax,%eax
mov    %eax,%edi
sub    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <__rthal_generic_ullimd@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <__rthal_generic_llimd+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <__rthal_generic_ullimd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rthal_generic_llimd>:
test   %rdi,%rdi
js     111a <__rthal_generic_llimd+0xa>
jmp    1030 <__rthal_generic_ullimd@plt>
push   %rax
neg    %rdi
call   1030 <__rthal_generic_ullimd@plt>
neg    %rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @__rthal_generic_llimd(i64 %0, i32 %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sub nsw i64 0, %0
%7 = tail call i64 @__rthal_generic_ullimd(i64 %6, i32 %1, i32 %2)
%8 = sub nsw i64 0, %7
br label %11
9: ; preds = %3
%10 = tail call i64 @__rthal_generic_ullimd(i64 %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %5
%12 = phi i64 [ %8, %5 ], [ %10, %9 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int a = 100;
  int b = 50;
  {
    int tmp;
    tmp = b;
    b = a;
    a = tmp;
  };
  printf("A = %d B = %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"A = %d B = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 50, i32 100)
ret i32 0
}
/* Variables and functions */
int dwarf_get_LANG_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_LANG_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_LANG_name(val_in, &v);
  return ellipname(res, val_in, v, "LANG", printonerr);
}


x86 assembly (clang, -O0):
<get_LANG_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_LANG_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_LANG_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_LANG_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"LANG\00"
define i8* @get_LANG_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_LANG_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"LANG\00"
define i8* @get_LANG_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_LANG_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
void XcmsLookupColor() {}


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

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

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

LLVM IR (-O2):
define void @XcmsLookupColor() {
ret void
}
/* Variables and functions */
unsigned char *hmac_blake512(unsigned char *, unsigned char const *, size_t,
                             unsigned char const *, size_t);
unsigned char *mac_hmac_blake512(unsigned char *out, const unsigned char *key,
                                 size_t key_len, const unsigned char *msg,
                                 size_t msg_len) {
  return hmac_blake512(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_blake512>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_blake512@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_blake512>:
jmp    1030 <hmac_blake512@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_blake512(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_blake512(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
int rho_ruby_is_boolean(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_is_boolean(i64 %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct TYPE_3__ {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct itimerspec {
  TYPE_2__ member_1;
  TYPE_1__ member_0;
};

/* Variables and functions */
int timerfd_settime(int, int /*<<< orphan*/, struct itimerspec *,
                    int /*<<< orphan*/ *);
int timer_disarm(int fd) {
  struct itimerspec new_time = {{0, 0}, {0, 0}};
  return timerfd_settime(fd, 0, &new_time, NULL);
}


x86 assembly (clang, -O0):
<timer_disarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
lea    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <timerfd_settime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_disarm>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <timerfd_settime@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.itimerspec = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
define i32 @timer_disarm(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.itimerspec
store i32 %0, i32* %2
%4 = bitcast %struct.itimerspec* %3 to i8*
%5 = load i32, i32* %2
%6 = call i32 @timerfd_settime(i32 %5, i32 0, %struct.itimerspec* %3, i32* null)
ret i32 %6
}

LLVM IR (-O2):
%struct.itimerspec = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
define i32 @timer_disarm(i32 %0) {
%2 = alloca %struct.itimerspec
%3 = bitcast %struct.itimerspec* %2 to i8*
%4 = call i32 @timerfd_settime(i32 %0, i32 0, %struct.itimerspec* %2, i32* null)
ret i32 %4
}
void ff_hevc_put_hevc_qpel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IOoutput(int, int /*<<< orphan*/);
void ClearIOchip(int chip_no) { IOoutput(chip_no, 0); }


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

x86 assembly (clang, -O2):
<ClearIOchip>:
xor    %esi,%esi
jmp    1030 <IOoutput@plt>

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

LLVM IR (-O2):
define void @ClearIOchip(i32 %0) {
%2 = tail call i32 @IOoutput(i32 %0, i32 0)
ret void
}
void vec_rhs(double t, double *y, double *ydot, int neq) {}


x86 assembly (clang, -O0):
<vec_rhs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vec_rhs(double %0, double* %1, double* %2, i32 %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @vec_rhs(double %0, double* nocapture %1, double* nocapture %2, i32 %3) {
ret void
}
void exit_hw(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_hw() {
ret void
}
int upperPower2(int n) {
  int shift;
  if (n-- <= 0) {
    return 0;
  }
  for (shift = 1; shift < 8 * sizeof n; shift <<= 1) {
    n |= n >> shift;
  }
  return ++n;
}


x86 assembly (clang, -O0):
<upperPower2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jg     1127 <upperPower2+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1164 <upperPower2+0x64>
movl   $0x1,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1158 <upperPower2+0x58>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <upperPower2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperPower2>:
test   %edi,%edi
jle    112d <upperPower2+0x2d>
add    $0xffffffff,%edi
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
or     %ecx,%eax
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @upperPower2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = icmp sle i32 %5, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %26
9: ; preds = %1
store i32 1, i32* %4
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = icmp ult i64 %12, 32
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = ashr i32 %15, %16
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %14
%21 = load i32, i32* %4
%22 = shl i32 %21, 1
store i32 %22, i32* %4
br label %10
23: ; preds = %10
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @upperPower2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = lshr i32 %4, 1
%6 = or i32 %5, %4
%7 = ashr i32 %6, 2
%8 = or i32 %7, %6
%9 = ashr i32 %8, 4
%10 = or i32 %9, %8
%11 = ashr i32 %10, 8
%12 = or i32 %11, %10
%13 = ashr i32 %12, 16
%14 = or i32 %13, %12
%15 = add nsw i32 %14, 1
br label %16
16: ; preds = %1, %3
%17 = phi i32 [ %15, %3 ], [ 0, %1 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ f0();
int /*<<< orphan*/ f1();
int foo(int x) {
  if ((short int)(x & 0x8000) > (short int)0) {
    f0();
    return 0;
  } else {
    f1();
    return 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x8000,%eax
cwtl
cmp    $0x0,%eax
jle    1150 <foo+0x30>
mov    $0x0,%al
call   1030 <f0@plt>
movl   $0x0,-0x4(%rbp)
jmp    115e <foo+0x3e>
mov    $0x0,%al
call   1040 <f1@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <f1@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 32768
%6 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @f0()
store i32 0, i32* %2
br label %13
11: ; preds = %1
%12 = call i32 (...) @f1()
store i32 1, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 (...) @f1()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ vmi_set_lazy_mode(int);
void arch_enter_lazy_cpu_mode(void) { vmi_set_lazy_mode(0x02); }


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

x86 assembly (clang, -O2):
<arch_enter_lazy_cpu_mode>:
mov    $0x2,%edi
jmp    1030 <vmi_set_lazy_mode@plt>

LLVM IR (-O0):
define void @arch_enter_lazy_cpu_mode() {
%1 = call i32 @vmi_set_lazy_mode(i32 2)
ret void
}

LLVM IR (-O2):
define void @arch_enter_lazy_cpu_mode() {
%1 = tail call i32 @vmi_set_lazy_mode(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ record_stats(void *, size_t, size_t);
size_t resize_exact_fit(size_t current, size_t requested, void *data) {
  if (data)
    record_stats(data, current, requested);
  return requested;
}


x86 assembly (clang, -O0):
<resize_exact_fit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <resize_exact_fit+0x30>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <record_stats@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_exact_fit>:
push   %rbx
mov    %rsi,%rbx
test   %rdx,%rdx
je     1127 <resize_exact_fit+0x17>
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %rbx,%rdx
call   1030 <record_stats@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @resize_exact_fit(i64 %0, i64 returned %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @record_stats(i8* %2, i64 %0, i64 %1)
br label %7
7: ; preds = %5, %3
ret i64 %1
}
int Calculator_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<Calculator_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @Calculator_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Calculator_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
float __infer_nondet_float();
float scalbnf(float x, int n) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<scalbnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @scalbnf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @scalbnf(float %0, i32 %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
int Gtty(int fd, const char *mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @Gtty(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
int whatami(int val) { return (val > 0) - (val < 0); }


x86 assembly (clang, -O0):
<whatami>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whatami>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
sar    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @whatami(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @whatami(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x85() {
  Assert_real((isodigit(133) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              670, ("isodigit should be 0 for 0x85"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x85>:
push   %rbp
mov    %rsp,%rbp
mov    $0x85,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x29e,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x85>:
push   %rax
mov    $0x85,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x85\00"
define void @t_isodigit_0x85() {
%1 = call i64 @isodigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x85\00"
define void @t_isodigit_0x85() {
%1 = tail call i64 @isodigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double hrtime() {
  struct timespec time_obj;
  clock_gettime(CLOCK_MONOTONIC, &time_obj);
  return (double)time_obj.tv_sec + 1e-9 * (double)time_obj.tv_nsec;
}


x86 assembly (clang, -O0):
<hrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrtime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @hrtime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %9, double %6)
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @hrtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *rcalloc(size_t, int);
size_t strlen(char const *);
char *rstrdup(const char *s) {
  char *ret;
  size_t sz = strlen(s);
  ret = rcalloc(sz + 1, 1);
  memcpy(ret, s, sz);
  return ret;
}


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

x86 assembly (clang, -O2):
<rstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1040 <rcalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @rcalloc(i64 %8, i32 1)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @rstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @rcalloc(i64 %3, i32 1)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
ret i8* %4
}
void construct(int n) {}


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

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

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

LLVM IR (-O2):
define void @construct(i32 %0) {
ret void
}
/* Variables and functions */
long strtol(char *, char **, int /*<<< orphan*/);
int readnumber(char word[]) {
  char *error = 0;
  long value = strtol(word, &error, 0);
  if (*error == '\0')
    return (int)value;
  else
    return -1;
}


x86 assembly (clang, -O0):
<readnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1153 <readnumber+0x43>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    115a <readnumber+0x4a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readnumber>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <strtol@plt>
mov    0x8(%rsp),%rcx
cmp    (%rcx),%bl
sbb    %ecx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readnumber(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* null, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strtol(i8* %6, i8** %4, i32 0)
store i64 %7, i64* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %5
%14 = trunc i64 %13 to i32
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @readnumber(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i64 @strtol(i8* %0, i8** %2, i32 0)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = trunc i64 %4 to i32
%9 = select i1 %7, i32 %8, i32 -1
ret i32 %9
}