xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x09() {
  Assert_real((isprint(9) == 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_isprint.c",
              50, ("isprint should be 0 for 0x09"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x09>:
push   %rax
mov    $0x9,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x09\00"
define void @t_isprint_0x09() {
%1 = call i64 @isprint(i32 9)
%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 50, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x09\00"
define void @t_isprint_0x09() {
%1 = tail call i64 @isprint(i32 9)
%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 50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
struct WorldCoor *wcsninit(hstring, lhstring) const char *hstring;
int lhstring;
{
  char mchar;
  mchar = (char)0;
  hlength(hstring, lhstring);
  return (wcsinitc(hstring, &mchar));
}


x86 assembly (clang, -O0):
<wcsninit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <hlength@plt>
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1040 <wcsinitc@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsninit>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xf(%rsp)
xor    %eax,%eax
call   1030 <hlength@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <wcsinitc@plt>
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8 0, i8* %5
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %6, i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %9, i8* %5)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to %struct.WorldCoor*
ret %struct.WorldCoor* %12
}

LLVM IR (-O2):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninit(i8* %0, i32 %1) {
%3 = alloca i8
store i8 0, i8* %3
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %0, i8* %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.WorldCoor*
ret %struct.WorldCoor* %7
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_flushd(unsigned char *);
void test_flushd(unsigned char *p1, unsigned char *p2) {
  __builtin_flushd(p1);
  __builtin_flushd(p2);
  __builtin_flushd(p2 + 1);
  __builtin_flushd(p2 + 2);
  __builtin_flushd(p2 + 2047);
  __builtin_flushd(p2 + 2048);
}


x86 assembly (clang, -O0):
<test_flushd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__builtin_flushd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <__builtin_flushd@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__builtin_flushd@plt>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <__builtin_flushd@plt>
mov    -0x10(%rbp),%rdi
add    $0x7ff,%rdi
call   1030 <__builtin_flushd@plt>
mov    -0x10(%rbp),%rdi
add    $0x800,%rdi
call   1030 <__builtin_flushd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flushd>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__builtin_flushd@plt>
mov    %rbx,%rdi
call   1030 <__builtin_flushd@plt>
lea    0x1(%rbx),%rdi
call   1030 <__builtin_flushd@plt>
lea    0x2(%rbx),%rdi
call   1030 <__builtin_flushd@plt>
lea    0x7ff(%rbx),%rdi
call   1030 <__builtin_flushd@plt>
add    $0x800,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__builtin_flushd@plt>

LLVM IR (-O0):
define void @test_flushd(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 = call i32 @__builtin_flushd(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @__builtin_flushd(i8* %7)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @__builtin_flushd(i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = call i32 @__builtin_flushd(i8* %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2047
%17 = call i32 @__builtin_flushd(i8* %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2048
%20 = call i32 @__builtin_flushd(i8* %19)
ret void
}

LLVM IR (-O2):
define void @test_flushd(i8* %0, i8* %1) {
%3 = tail call i32 @__builtin_flushd(i8* %0)
%4 = tail call i32 @__builtin_flushd(i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @__builtin_flushd(i8* %5)
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @__builtin_flushd(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 2047
%10 = tail call i32 @__builtin_flushd(i8* %9)
%11 = getelementptr inbounds i8, i8* %1, i64 2048
%12 = tail call i32 @__builtin_flushd(i8* %11)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
scalar_t__ isLeapYear(int);
time_t daysPerYear(time_t year) { return isLeapYear(year) ? 366 : 365; }


x86 assembly (clang, -O0):
<daysPerYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isLeapYear@plt>
mov    %rax,%rdx
mov    $0x16d,%eax
mov    $0x16e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daysPerYear>:
push   %rax
call   1030 <isLeapYear@plt>
cmp    $0x1,%rax
mov    $0x16e,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @daysPerYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isLeapYear(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 366, i32 365
ret i32 %7
}

LLVM IR (-O2):
define i32 @daysPerYear(i32 %0) {
%2 = tail call i64 @isLeapYear(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 365, i32 366
ret i32 %4
}
const char *minictk_version() { return "0.4"; }


x86 assembly (clang, -O0):
<minictk_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minictk_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"0.4\00"
define i8* @minictk_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.4\00"
define i8* @minictk_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void __attribute__((__section__("mlocked_text")))
stress_sigabrt_handler(int num) {
  (void)num;
}


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

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

LLVM IR (-O0):
define void @stress_sigabrt_handler(i32 %0) section "mlocked_text" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @stress_sigabrt_handler(i32 %0) section "mlocked_text" {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int status) {
  fprintf(stderr, "Usage:\n"
                  "  mkimage [OPTIONS] header [image] output\n\n"
                  "Options:\n"
                  "  -d\t\tdrive[,part]\tSet default drive and partition\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [111 x i8] c"Usage:\0A mkimage [OPTIONS] header [image] output\0A\0AOptions:\0A -d\09\09drive[,part]\09Set default drive and partition\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [111 x i8] c"Usage:\0A mkimage [OPTIONS] header [image] output\0A\0AOptions:\0A -d\09\09drive[,part]\09Set default drive and partition\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helloWorld(void) {
  printf("Hello World!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @helloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void tdestroy(void *root, void (*free_node)(void *nodep)) {}


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

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

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

LLVM IR (-O2):
define void @tdestroy(i8* nocapture %0, void (i8*)* nocapture %1) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ input(char *, int);
int /*<<< orphan*/ isdigit(char);
int input_int(void) {
  char x[8];
  input(x, 8);
  if (!isdigit(*x))
    return -1;
  return atoi(x);
}


x86 assembly (clang, -O0):
<input_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1030 <input@plt>
movsbl -0xc(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    1164 <input_int+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <input_int+0x40>
lea    -0xc(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_int>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <input@plt>
movsbl (%rsp),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     1155 <input_int+0x25>
mov    %rsp,%rdi
call   1050 <atoi@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @input_int() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @input(i8* %3, i32 8)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = call i32 @isdigit(i8 signext %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %0
store i32 -1, i32* %1
br label %13
10: ; preds = %0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @input_int() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @input(i8* %2, i32 8)
%4 = load i8, i8* %2
%5 = call i32 @isdigit(i8 signext %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @atoi(i8* %2)
br label %9
9: ; preds = %0, %7
%10 = phi i32 [ %8, %7 ], [ -1, %0 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @safe_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_PHONE(int /*<<< orphan*/);
int gen_PHONE() { handle_PHONE(0); }


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

x86 assembly (clang, -O2):
<gen_PHONE>:
xor    %edi,%edi
jmp    1030 <handle_PHONE@plt>

LLVM IR (-O0):
define i32 @gen_PHONE() {
%1 = alloca i32
%2 = call i32 @handle_PHONE(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_PHONE() {
%1 = tail call i32 @handle_PHONE(i32 0)
ret i32 undef
}
int fun1068() { return 1068; }


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

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

LLVM IR (-O0):
define i32 @fun1068() {
ret i32 1068
}

LLVM IR (-O2):
define i32 @fun1068() {
ret i32 1068
}
/* Type definitions */
typedef scalar_t__ __m64;

/* Variables and functions */
int l_mm_extract_pi32(__m64 b, int imm8) {
  unsigned int shift = imm8 & 0x1;
  return ((long long)b >> (shift * 32)) & 0xffffffff;
}


x86 assembly (clang, -O0):
<l_mm_extract_pi32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x5,%ecx
mov    %ecx,%ecx
sar    %cl,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_mm_extract_pi32>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    $0x5,%ecx
sar    %cl,%rax
ret

LLVM IR (-O0):
define i32 @l_mm_extract_pi32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 1
store i32 %7, i32* %5
%8 = load i64, i64* %3
%9 = load i32, i32* %5
%10 = mul i32 %9, 32
%11 = zext i32 %10 to i64
%12 = ashr i64 %8, %11
%13 = and i64 %12, 4294967295
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @l_mm_extract_pi32(i64 %0, i32 %1) {
%3 = shl i32 %1, 5
%4 = and i32 %3, 32
%5 = zext i32 %4 to i64
%6 = ashr i64 %0, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
int opus_packet_get_nb_channels(const unsigned char *data) {
  return (data[0] & 0x4) ? 2 : 1;
}


x86 assembly (clang, -O0):
<opus_packet_get_nb_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x4,%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opus_packet_get_nb_channels>:
mov    (%rdi),%al
and    $0x4,%al
cmp    $0x1,%al
mov    $0x2,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @opus_packet_get_nb_channels(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 = zext i8 %5 to i32
%7 = and i32 %6, 4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 2, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @opus_packet_get_nb_channels(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 1, i32 2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void check_bytes(char *addr) {
  printf("First hex is %x\n", *((unsigned int *)addr));
}


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

x86 assembly (clang, -O2):
<check_bytes>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"First hex is %x\0A\00"
define void @check_bytes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"First hex is %x\0A\00"
define void @check_bytes(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f12(unsigned long long x,
                                                    unsigned long long y) {
  unsigned long long r = x - y;
  if (y >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f12+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
push   %rbx
mov    %rdi,%rbx
sub    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f12+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f12(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
void init(void) { glClearColor(0.2, 0.2, 0.2, 1.0); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm2
movsd  0xee4(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x74() {
  Assert_real((isodigit(116) == 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",
              585, ("isodigit should be 0 for t"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x74>:
push   %rax
mov    $0x74,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x249,%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 = [27 x i8] c"isodigit should be 0 for t\00"
define void @t_isodigit_0x74() {
%1 = call i64 @isodigit(i32 116)
%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 585, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isodigit should be 0 for t\00"
define void @t_isodigit_0x74() {
%1 = tail call i64 @isodigit(i32 116)
%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 585, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int read_directory(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @read_directory(i32 %0) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
__attribute__((__nonnull__)) bool mem_equal(const void *s1, const void *s2,
                                            size_t n) {
  return memcmp(s1, s2, n) == 0;
}


x86 assembly (clang, -O0):
<mem_equal>:
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 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_equal>:
push   %rax
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mem_equal(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 i64 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @mem_equal(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_024() { return 24; }


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

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

LLVM IR (-O0):
define i32 @do_024() {
ret i32 24
}

LLVM IR (-O2):
define i32 @do_024() {
ret i32 24
}
int test_imm_9Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10354688
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_peer_socket(int sockfd) { close(sockfd); }


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

x86 assembly (clang, -O2):
<close_peer_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_peer_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int test_imm_FEuint8_mem(unsigned char *val) {
  return ((*val) & (-0xFE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FEuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff02,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 2
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ cst_safe_alloc(int);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char const *, int);
int strlen(char const *);
unsigned char *cst_strdup(const unsigned char *str) {
  unsigned char *nstr = NULL;
  if (str) {
    nstr = ((unsigned char *)cst_safe_alloc(sizeof(unsigned char) *
                                            (strlen((const char *)str) + 1)));
    memmove(nstr, str, strlen((const char *)str) + 1);
  }
  return nstr;
}


x86 assembly (clang, -O0):
<cst_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1197 <cst_strdup+0x67>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <cst_safe_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1050 <memmove@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cst_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1164 <cst_strdup+0x34>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <cst_safe_alloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <memmove@plt>
jmp    1167 <cst_strdup+0x37>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cst_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %21
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @cst_safe_alloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = load i8*, i8** %2
%18 = call i32 @strlen(i8* %17)
%19 = add nsw i32 %18, 1
%20 = call i32 @memmove(i8* %15, i8* %16, i32 %19)
br label %21
21: ; preds = %6, %1
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @cst_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @cst_safe_alloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strlen(i8* %0)
%9 = add nsw i32 %8, 1
%10 = tail call i32 @memmove(i8* %7, i8* %0, i32 %9)
br label %11
11: ; preds = %3, %1
%12 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int strcasecmp(char *, char *);
int str_caseless_compare(char *str1, char *str2) {
  int c = strcasecmp(str1, str2);
  return (c);
}


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

x86 assembly (clang, -O2):
<str_caseless_compare>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @str_caseless_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_swap2(char *, int);
void bitmap16_swap(char *b) { U_swap2(b, 4); }


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

x86 assembly (clang, -O2):
<bitmap16_swap>:
mov    $0x4,%esi
jmp    1030 <U_swap2@plt>

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

LLVM IR (-O2):
define void @bitmap16_swap(i8* %0) {
%2 = tail call i32 @U_swap2(i8* %0, i32 4)
ret void
}
int lt(x, y) { return x < y; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
double traza(double *matriz, unsigned int n) {
  unsigned int indice;
  double t = 0;
  for (indice = 0; indice < (n * n); indice += (n + 1)) {
    t += *(matriz + indice);
  }
  return t;
}


x86 assembly (clang, -O0):
<traza>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jae    1153 <traza+0x53>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111a <traza+0x1a>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<traza>:
mov    %esi,%eax
imul   %esi,%eax
test   %eax,%eax
je     112e <traza+0x2e>
add    $0x1,%esi
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%edx
addsd  (%rdi,%rdx,8),%xmm0
add    %esi,%ecx
cmp    %eax,%ecx
jb     1120 <traza+0x20>
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @traza(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul i32 %9, %10
%12 = icmp ult i32 %8, %11
br i1 %12, label %13, label %26
13: ; preds = %7
%14 = load double*, double** %3
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double, double* %6
%20 = fadd double %19, %18
store double %20, double* %6
br label %21
21: ; preds = %13
%22 = load i32, i32* %4
%23 = add i32 %22, 1
%24 = load i32, i32* %5
%25 = add i32 %24, %23
store i32 %25, i32* %5
br label %7
26: ; preds = %7
%27 = load double, double* %6
ret double %27
}

LLVM IR (-O2):
define double @traza(double* nocapture %0, i32 %1) {
%3 = mul i32 %1, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = add i32 %1, 1
br label %7
7: ; preds = %5, %7
%8 = phi double [ 0.000000e+00, %5 ], [ %13, %7 ]
%9 = phi i32 [ 0, %5 ], [ %14, %7 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
%13 = fadd double %8, %12
%14 = add i32 %6, %9
%15 = icmp ult i32 %14, %3
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = phi double [ 0.000000e+00, %2 ], [ %13, %7 ]
ret double %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(void) {
  for (int i = 0; i <= 100; i++) {
    printf("Percent complete: %d%%\n", i);
    sleep(1);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1169 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"Percent complete: %d%%\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @putchar(i32 10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 1)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %1, label %3
}
void func3(void) {
  unsigned int i;
  int a = 0;
  for (i = 0; i < 100000; ++i) {
    ++a;
  }
  (void)a;
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jae    1136 <func3+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <func3+0x12>
jmp    1136 <func3+0x36>

x86 assembly (clang, -O2):
<func3>:
jmp    1100 <func3>

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

LLVM IR (-O2):
define void @func3() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ shell_bufferclear();
int /*<<< orphan*/ terminal_clearscreen();
void shell_command_clear() {
  terminal_clearscreen();
  shell_bufferclear();
}


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

x86 assembly (clang, -O2):
<shell_command_clear>:
push   %rax
xor    %eax,%eax
call   1040 <terminal_clearscreen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <shell_bufferclear@plt>

LLVM IR (-O0):
define void @shell_command_clear() {
%1 = call i32 (...) @terminal_clearscreen()
%2 = call i32 (...) @shell_bufferclear()
ret void
}

LLVM IR (-O2):
define void @shell_command_clear() {
%1 = tail call i32 (...) @terminal_clearscreen()
%2 = tail call i32 (...) @shell_bufferclear()
ret void
}
void board_serial_init(void) {
  (*((volatile unsigned short *)((0xfffff300 + 0x00))) = (0x0020));
  (*((volatile unsigned short *)((0xfffff300 + 0x08))) = (0x0000));
  (*((volatile unsigned short *)((0xfffff300 + 0x10))) = (0x0000));
  (*((volatile unsigned short *)((0xfffff300 + 0x14))) = (0x0100 | 5));
}


x86 assembly (clang, -O0):
<board_serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff300,%eax
movw   $0x20,(%rax)
mov    $0xfffff308,%eax
movw   $0x0,(%rax)
mov    $0xfffff310,%eax
movw   $0x0,(%rax)
mov    $0xfffff314,%eax
movw   $0x105,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_serial_init>:
mov    $0xfffff300,%eax
movw   $0x20,(%rax)
movw   $0x0,0x8(%rax)
movw   $0x0,0x10(%rax)
movw   $0x105,0x14(%rax)
ret

LLVM IR (-O0):
define void @board_serial_init() {
store volatile i16 32, i16* inttoptr (i64 4294963968 to i16*)
store volatile i16 0, i16* inttoptr (i64 4294963976 to i16*)
store volatile i16 0, i16* inttoptr (i64 4294963984 to i16*)
store volatile i16 261, i16* inttoptr (i64 4294963988 to i16*)
ret void
}

LLVM IR (-O2):
define void @board_serial_init() {
store volatile i16 32, i16* inttoptr (i64 4294963968 to i16*)
store volatile i16 0, i16* inttoptr (i64 4294963976 to i16*)
store volatile i16 0, i16* inttoptr (i64 4294963984 to i16*)
store volatile i16 261, i16* inttoptr (i64 4294963988 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long volatile, long volatile);
int main(void) {
  volatile long x = 0x6000000000000000LL;
  volatile long y = 0xc000000000000000LL;
  printf("%lx %lx\n", x / y, x % y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x6000000000000000,%rax
mov    %rax,-0x10(%rbp)
movabs $0xc000000000000000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rsi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cqto
idiv   %rcx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6000000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0xc000000000000000,%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1152 <main+0x42>
cqto
idiv   %rcx
mov    %rax,%rsi
jmp    1158 <main+0x48>
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1175 <main+0x65>
cqto
idiv   %rcx
jmp    1179 <main+0x69>
xor    %edx,%edx
div    %ecx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%lx %lx\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store volatile i64 6917529027641081856, i64* %1
%4 = bitcast i64* %2 to i8*
store volatile i64 -4611686018427387904, i64* %2
%5 = load volatile i64, i64* %1
%6 = load volatile i64, i64* %2
%7 = sdiv i64 %5, %6
%8 = load volatile i64, i64* %1
%9 = load volatile i64, i64* %2
%10 = srem i64 %8, %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %10)
ret i32 0
}
char *ctime(t)
long *t;
{ return (asctime(localtime(t))); }


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

x86 assembly (clang, -O2):
<ctime>:
push   %rax
xor    %eax,%eax
call   1030 <localtime@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <asctime@plt>
cltq
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @ctime(i64* %0) {
%2 = tail call i32 (i64*, ...) bitcast (i32 (...)* @localtime to i32 (i64*, ...)*)(i64* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @asctime to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  char s[] = "hello";
  reverse(s);
  printf("hello --> %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x6(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6568,0x8(%rsp)
6c
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"hello\00"
@.str = [14 x i8] c"hello --> %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverse(i8* %3)
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [6 x i8] c"hello\00"
@.str = [14 x i8] c"hello --> %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}