xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ remove(char *);
int main() {
  if (remove("this test file should not exist")) {
    printf("asdf");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <remove@plt>
test   %rax,%rax
je     113e <main+0x1e>
lea    0xee7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"this test file should not exist\00"
@.str.1 = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @remove(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [32 x i8] c"this test file should not exist\00"
@.str.1 = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = tail call i64 @remove(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
int /*<<< orphan*/ readsock(int, int);
void basReadSock() {
  int sock, numbytes;
  numbytes = popNumber();
  sock = popNumber();
  pushString(readsock(sock, numbytes));
}


x86 assembly (clang, -O0):
<basReadSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <readsock@plt>
mov    %eax,%edi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basReadSock>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <readsock@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <pushString@plt>

LLVM IR (-O0):
define void @basReadSock() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %2
%4 = call i32 (...) @popNumber()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @readsock(i32 %5, i32 %6)
%8 = call i32 @pushString(i32 %7)
ret void
}

LLVM IR (-O2):
define void @basReadSock() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 @readsock(i32 %2, i32 %1)
%4 = tail call i32 @pushString(i32 %3)
ret void
}
void dummy_handler(void) {
  while (1) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<dummy_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <dummy_handler+0x9>
nop
jmp    1109 <dummy_handler+0x9>

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

LLVM IR (-O0):
define void @dummy_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @dummy_handler() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 1024 * 1024 * 1024);
  printf("%d\n", 1024 * 1024);
  printf("%d\n", 1024);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x40000000,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x100000,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1073741824)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1048576)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1024)
ret i32 0
}
void fun5() {}


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

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

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

LLVM IR (-O2):
define void @fun5() {
ret void
}
char *return_str_literal() {
  char *name;
  name = "String literal test...\n";
  return name;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"String literal test...\0A\00"
define i8* @return_str_literal() {
%1 = alloca i8*
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [24 x i8] c"String literal test...\0A\00"
define i8* @return_str_literal() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long euclidean_gcd(unsigned int, unsigned int);
unsigned int lcm(unsigned int a, unsigned int b) {
  return (unsigned int)(((unsigned long)(a * b)) / euclidean_gcd(a, b));
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <euclidean_gcd@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
xor    %edx,%edx
div    %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <euclidean_gcd@plt>
cmp    %rax,%rbx
jb     112b <lcm+0x1b>
mov    %rax,%rcx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(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 = mul i32 %5, %6
%8 = zext i32 %7 to i64
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i64 @euclidean_gcd(i32 %9, i32 %10)
%12 = udiv i64 %8, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = zext i32 %3 to i64
%5 = tail call i64 @euclidean_gcd(i32 %0, i32 %1)
%6 = udiv i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
const char *get_usage(void) {
  return "spc_playlet_dec usage:\n"
         "\t--cpu_mem    | -c <cpu memory configuration filepath>\n"
         "\t--rom        | -r <original rom filepath>\n"
         "\t--xml        | -x <output xml playlet filepath>\n"
         "\t--version    | -v <version>\n"
         "\t--help       | -h <help>\n";
}


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

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

LLVM IR (-O0):
@.str = [226 x i8] c"spc_playlet_dec usage:\0A\09--cpu_mem | -c <cpu memory configuration filepath>\0A\09--rom | -r <original rom filepath>\0A\09--xml | -x <output xml playlet filepath>\0A\09--version | -v <version>\0A\09--help | -h <help>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [226 x i8] c"spc_playlet_dec usage:\0A\09--cpu_mem | -c <cpu memory configuration filepath>\0A\09--rom | -r <original rom filepath>\0A\09--xml | -x <output xml playlet filepath>\0A\09--version | -v <version>\0A\09--help | -h <help>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void show_options(int n) {
  printf("options are: file [-o[utput] file] [-r[epetitions] number] "
         "[-p[retty]] [-h[elp]]\n");
  exit(n);
}


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

x86 assembly (clang, -O2):
<show_options>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"options are: file [-o[utput] file] [-r[epetitions] number] [-p[retty]] [-h[elp]]\0A\00"
define void @show_options(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [81 x i8] c"options are: file [-o[utput] file] [-r[epetitions] number] [-p[retty]] [-h[elp]]\00"
define void @show_options(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
int RotWord(int w) { return (w << 8) | ((w >> 24) & 0xFF); }


x86 assembly (clang, -O0):
<RotWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotWord>:
mov    %edi,%eax
rol    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @RotWord(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @RotWord(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_key_val_end(void *s) {
  fprintf(stderr, "key_val_end\n");
  return true;
}


x86 assembly (clang, -O0):
<tread_key_val_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tread_key_val_end>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"key_val_end\0A\00"
define i32 @tread_key_val_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"key_val_end\0A\00"
define i32 @tread_key_val_end(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void rcu_end_inkernel_boot(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_end_inkernel_boot() {
ret void
}
/* Variables and functions */
int EAI_SYSTEM;
int /*<<< orphan*/ errno;
char const *gai_strerror(int);
char const *strerror(int /*<<< orphan*/);
const char *getxinfo_strerr(int err) {
  if (err == EAI_SYSTEM)
    return strerror(errno);
  return gai_strerror(err);
}


x86 assembly (clang, -O0):
<getxinfo_strerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1154 <getxinfo_strerr+0x34>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rax,-0x8(%rbp)
jmp    1160 <getxinfo_strerr+0x40>
mov    -0xc(%rbp),%edi
call   1030 <gai_strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getxinfo_strerr>:
mov    0x2ec1(%rip),%rax
cmp    %edi,(%rax)
jne    1139 <getxinfo_strerr+0x19>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
jmp    1040 <strerror@plt>
jmp    1030 <gai_strerror@plt>

LLVM IR (-O0):
@EAI_SYSTEM = global i32 0
@errno = global i32 0
define i8* @getxinfo_strerr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @EAI_SYSTEM
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i8* @gai_strerror(i32 %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %7
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@EAI_SYSTEM = global i32 0
@errno = global i32 0
define i8* @getxinfo_strerr(i32 %0) {
%2 = load i32, i32* @EAI_SYSTEM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i8* @gai_strerror(i32 %0)
br label %9
9: ; preds = %7, %4
%10 = phi i8* [ %6, %4 ], [ %8, %7 ]
ret i8* %10
}
int dsl_allows(char *typ, char *ps, char *s, int n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dsl_allows(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(void *elem, void *data) { printf("%d\n", *(int *)elem); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_200() {
  Assert_real((isqrt(200) == 14),
              "/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/stdlib/isqrt.c",
              1005, ("Integer square root of 200 should be 14"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3ed,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0xc8,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3ed,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 200 should be 14\00"
define void @t_sqrt_200() {
%1 = call i32 @isqrt(i32 200)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 200 should be 14\00"
define void @t_sqrt_200() {
%1 = tail call i32 @isqrt(i32 200)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + (unsigned short)48993;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x20ea,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jge    114e <RandomFunc+0x4e>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1129 <RandomFunc+0x29>
movzwl -0x12(%rbp),%eax
add    $0xbf61,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xffffb5f7,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 8426
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %23, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = load i16*, i16** %3
%19 = getelementptr inbounds i16, i16* %18, i64 1
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp slt i32 %17, %21
br i1 %22, label %23, label %28
23: ; preds = %15
%24 = load i16, i16* %6
%25 = zext i16 %24 to i64
%26 = add i64 %25, 2
%27 = trunc i64 %26 to i16
store i16 %27, i16* %6
br label %15
28: ; preds = %15
%29 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%30 = load i16, i16* %29
%31 = zext i16 %30 to i32
%32 = add nsw i32 %31, 48993
%33 = trunc i32 %32 to i16
%34 = load i16*, i16** %4
%35 = getelementptr inbounds i16, i16* %34, i64 0
store i16 %33, i16* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, -18953
store i16 %4, i16* %1
ret void
}
int test_imm_0Dint8_reg(signed char val) {
  return ((val) & (0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Dint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Dint8_reg(i8 signext %0) {
%2 = and i8 %0, 13
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  size_t i;
  for (i = 0; s[i] && i < n; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test 3 is running.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [20 x i8] c"Test 3 is running.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Test 3 is running.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_tracyWidom() {
  printf("\nHELP: ./tracyWidom options \n\n"
         "mandatory:\n"
         "        -i input_file         -- eigenvalues file (one column)\n\n"
         "optional:\n"
         "        -h                    -- help\n"
         "        -o output_file        -- output file (default: "
         "input_file.tracywidom)\n");
}


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

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

LLVM IR (-O0):
@.str = [233 x i8] c"\0AHELP: ./tracyWidom\C2\A0options \0A\0Amandatory:\0A -i input_file -- eigenvalues file (one column)\0A\0Aoptional:\0A -h -- help\0A -o output_file -- output file (default: input_file.tracywidom)\0A\00"
define void @print_help_tracyWidom() {
%1 = call i32 @printf(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [232 x i8] c"\0AHELP: ./tracyWidom\C2\A0options \0A\0Amandatory:\0A -i input_file -- eigenvalues file (one column)\0A\0Aoptional:\0A -h -- help\0A -o output_file -- output file (default: input_file.tracywidom)\00"
define void @print_help_tracyWidom() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([232 x i8], [232 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
scalar_t__ floor(double);
long lround(double t) {
  return t >= 0.0 ? (long)floor(t + 0.5) : (long)ceil(t - 0.5);
}


x86 assembly (clang, -O0):
<lround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115a <lround+0x3a>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
jmp    1174 <lround+0x54>
movsd  -0x8(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lround>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1137 <lround+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i64 @lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call i64 @floor(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = call i64 @ceil(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi i64 [ %8, %5 ], [ %12, %9 ]
ret i64 %14
}

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call i64 @floor(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call i64 @ceil(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
ret i64 %10
}
int pos_byte(int num_bloque) { return (num_bloque / 8) % 1024; }


x86 assembly (clang, -O0):
<pos_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_byte>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
lea    0x3ff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffc00,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pos_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 8
%5 = srem i32 %4, 1024
ret i32 %5
}

LLVM IR (-O2):
define i32 @pos_byte(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = srem i32 %2, 1024
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void depwait_delete(void *self) { free(self); }


x86 assembly (clang, -O0):
<depwait_delete>:
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):
<depwait_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @depwait_delete(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 @depwait_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct winsize {
  int ws_row;
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TIOCSWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int /*<<< orphan*/ memset(struct winsize *, int /*<<< orphan*/, int);
void set_window_size(const int w, const int h) {
  struct winsize ws;
  memset(&ws, 0, sizeof(struct winsize));
  ws.ws_row = h;
  ws.ws_col = w;
  ioctl(STDIN_FILENO, TIOCSWINSZ, &ws);
}


x86 assembly (clang, -O0):
<set_window_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_window_size>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %ebx,0x8(%rsp)
mov    %ebp,0xc(%rsp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.winsize = type { i32, i32 }
@STDIN_FILENO = global i32 0
@TIOCSWINSZ = global i32 0
define void @set_window_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.winsize
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @memset(%struct.winsize* %5, i32 0, i32 8)
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds %struct.winsize, %struct.winsize* %5, i32 0, i32 1
store i32 %9, i32* %10
%11 = load i32, i32* @STDIN_FILENO
%12 = load i32, i32* @TIOCSWINSZ
%13 = call i32 @ioctl(i32 %11, i32 %12, %struct.winsize* %5)
ret void
}

LLVM IR (-O2):
%struct.winsize = type { i32, i32 }
@STDIN_FILENO = global i32 0
@TIOCSWINSZ = global i32 0
define void @set_window_size(i32 %0, i32 %1) {
%3 = alloca %struct.winsize
%4 = bitcast %struct.winsize* %3 to i8*
%5 = call i32 @memset(%struct.winsize* %3, i32 0, i32 8)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %3, i64 0, i32 1
store i32 %0, i32* %7
%8 = load i32, i32* @STDIN_FILENO
%9 = load i32, i32* @TIOCSWINSZ
%10 = call i32 @ioctl(i32 %8, i32 %9, %struct.winsize* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ convolution(int const, int const, int const,
                               int /*<<< orphan*/ const *, float *,
                               int /*<<< orphan*/ *);
void pencil_convolution(const int rows, const int cols, const int step,
                        const uint8_t src[], float kernel[], uint8_t conv[]) {
  convolution(rows, cols, step, src, kernel, conv);
}


x86 assembly (clang, -O0):
<pencil_convolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <convolution@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pencil_convolution>:
jmp    1030 <convolution@plt>

LLVM IR (-O0):
define void @pencil_convolution(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca float*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store float* %4, float** %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32*, i32** %10
%17 = load float*, float** %11
%18 = load i32*, i32** %12
%19 = call i32 @convolution(i32 %13, i32 %14, i32 %15, i32* %16, float* %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @pencil_convolution(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, i32* %5) {
%7 = tail call i32 @convolution(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, i32* %5)
ret void
}
/* Variables and functions */
int int_value();
int int_range(int min, int max) {
  int n = int_value();
  return n < min || max < n ? min : n;
}


x86 assembly (clang, -O0):
<int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <int_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1140 <int_range+0x30>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114b <int_range+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <int_range+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <int_value@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmovg  %ebp,%ecx
cmp    %ebp,%eax
cmovl  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @int_value()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10, %2
%15 = load i32, i32* %3
br label %18
16: ; preds = %10
%17 = load i32, i32* %5
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @int_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @int_value()
%4 = icmp slt i32 %3, %0
%5 = icmp sgt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
/* Type definitions */
struct _stat {
  int dummy;
};

/* Variables and functions */
int dll_stat(char const *, struct _stat *);
int __wrap__stat(const char *path, struct _stat *buffer) {
  return dll_stat(path, buffer);
}


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

x86 assembly (clang, -O2):
<__wrap__stat>:
jmp    1030 <dll_stat@plt>

LLVM IR (-O0):
%struct._stat = type { i32 }
define i32 @__wrap__stat(i8* %0, %struct._stat* %1) {
%3 = alloca i8*
%4 = alloca %struct._stat*
store i8* %0, i8** %3
store %struct._stat* %1, %struct._stat** %4
%5 = load i8*, i8** %3
%6 = load %struct._stat*, %struct._stat** %4
%7 = call i32 @dll_stat(i8* %5, %struct._stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct._stat = type { i32 }
define i32 @__wrap__stat(i8* %0, %struct._stat* %1) {
%3 = tail call i32 @dll_stat(i8* %0, %struct._stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_print(char *arr) {
  fprintf(stderr,
          "\n%s  converts the intensity file into sum of itself three times "
          "rotated 90 degrees\n",
          arr);
  fprintf(stderr,
          "\nUSAGE: %s F > M_F  where F is the file in gnuplot format, M_F is "
          "the output file in the gnuplot format\n\n",
          arr);
}


x86 assembly (clang, -O0):
<error_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf1a(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"\0A%s converts the intensity file into sum of itself three times rotated 90 degrees\0A\00"
@.str.1 = [106 x i8] c"\0AUSAGE: %s F > M_F where F is the file in gnuplot format, M_F is the output file in the gnuplot format\0A\0A\00"
define void @error_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"\0A%s converts the intensity file into sum of itself three times rotated 90 degrees\0A\00"
@.str.1 = [106 x i8] c"\0AUSAGE: %s F > M_F where F is the file in gnuplot format, M_F is the output file in the gnuplot format\0A\0A\00"
define void @error_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void RTNetIPv4HdrChecksum(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4HdrChecksum() {
ret void
}
int test_imm_81uint32_reg(unsigned int val) {
  return ((val) & (0x81 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_81uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x81,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_81uint32_reg(i32 %0) {
%2 = and i32 %0, 129
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct ipr_dev {
  int dummy;
};

/* Variables and functions */
scalar_t__ ipr_find_zeroed_dev(struct ipr_dev *);
int ipr_device_is_zeroed(struct ipr_dev *dev) {
  if (ipr_find_zeroed_dev(dev))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ipr_device_is_zeroed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ipr_find_zeroed_dev@plt>
cmp    $0x0,%rax
je     113b <ipr_device_is_zeroed+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ipr_device_is_zeroed+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ipr_dev = type { i32 }
define i32 @ipr_device_is_zeroed(%struct.ipr_dev* %0) {
%2 = alloca i32
%3 = alloca %struct.ipr_dev*
store %struct.ipr_dev* %0, %struct.ipr_dev** %3
%4 = load %struct.ipr_dev*, %struct.ipr_dev** %3
%5 = call i64 @ipr_find_zeroed_dev(%struct.ipr_dev* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.ipr_dev = type { i32 }
define i32 @ipr_device_is_zeroed(%struct.ipr_dev* %0) {
%2 = tail call i64 @ipr_find_zeroed_dev(%struct.ipr_dev* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void av_buffer_ref() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_ref() {
ret void
}
int condition_o(char c) { return c == 'o'; }


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

x86 assembly (clang, -O2):
<condition_o>:
xor    %eax,%eax
cmp    $0x6f,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @condition_o(i8 signext %0) {
%2 = icmp eq i8 %0, 111
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgravity_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xgravity.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xgravity_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgravity_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_mask_port_command_error_interrupt(size_t ahbregaddr) {
  (*(volatile uint32_t *)((136 << 2) + (ahbregaddr))) |= (1 << 7);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x220,%rax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x80,0x220(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_mask_port_command_error_interrupt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 544, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 128
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_mask_port_command_error_interrupt(i64 %0) {
%2 = add i64 %0, 544
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 128
store volatile i32 %5, i32* %3
ret void
}
int cmp_double_desc(const void *p1, const void *p2) {
  if (*((const double *)p1) > *((const double *)p2)) {
    return -1;
  } else if (*((const double *)p1) < *((const double *)p2)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<cmp_double_desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <cmp_double_desc+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <cmp_double_desc+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <cmp_double_desc+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <cmp_double_desc+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double_desc>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_double_desc(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_double_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}