xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char const *);
const char *getenv_with_default(const char *envname, const char *def) {
  const char *res = getenv(envname);
  if (res != NULL)
    return res;
  else
    return def;
}


x86 assembly (clang, -O0):
<getenv_with_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1145 <getenv_with_default+0x35>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <getenv_with_default+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_with_default>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getenv_with_default(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %1, i8* %3
ret i8* %5
}
int __attribute__((no)) nltu(unsigned a, unsigned b) { return -(a < b); }


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

x86 assembly (clang, -O2):
<nltu>:
cmp    %esi,%edi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nltu(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 ult i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @nltu(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
unsigned int _uiCommSendData(unsigned int uiCommType, unsigned char *psSendData,
                             unsigned int uiSendLen) {
  return (0x0312);
}


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

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

LLVM IR (-O0):
define i32 @_uiCommSendData(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 786
}

LLVM IR (-O2):
define i32 @_uiCommSendData(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 786
}
/* Variables and functions */
char *appaserver_link_source_directory(char *, char *);
char *appaserver_link_get_source_directory(char *document_root_directory,
                                           char *application_name) {
  return appaserver_link_source_directory(document_root_directory,
                                          application_name);
}


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

x86 assembly (clang, -O2):
<appaserver_link_get_source_directory>:
jmp    1030 <appaserver_link_source_directory@plt>

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

LLVM IR (-O2):
define i8* @appaserver_link_get_source_directory(i8* %0, i8* %1) {
%3 = tail call i8* @appaserver_link_source_directory(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fizzBuzz(int, int);
main(int argc, char *argv[]) {
  int begin = atoi(argv[1]);
  int end = atoi(argv[2]);
  fizzBuzz(begin, end);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <fizzBuzz@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <fizzBuzz@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @fizzBuzz(i32 %5, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _IOLBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void setlinebuf(FILE *fp) { setvbuf(fp, NULL, _IOLBF, 0); }


x86 assembly (clang, -O0):
<setlinebuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlinebuf>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOLBF = global i32 0
define void @setlinebuf(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @_IOLBF
%5 = call i32 @setvbuf(i32* %3, i32* null, i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@_IOLBF = global i32 0
define void @setlinebuf(i32* nocapture %0) {
%2 = load i32, i32* @_IOLBF
%3 = tail call i32 @setvbuf(i32* %0, i32* null, i32 %2, i32 0)
ret void
}
int test_imm_31uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x31 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_31uint64_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, 49
%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_31uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3211264
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ XWindows_SwapGraphicsBuffers();
void Host_SwapGraphicsBuffers(void) { XWindows_SwapGraphicsBuffers(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ NID_dsa;
int jksengine_digests_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int jksengine_mddsa_init(EVP_MD_CTX *ctx) {
  ;
  return (jksengine_digests_init(ctx, NID_dsa));
}


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

x86 assembly (clang, -O2):
<jksengine_mddsa_init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <jksengine_digests_init@plt>

LLVM IR (-O0):
@NID_dsa = global i32 0
define i32 @jksengine_mddsa_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_dsa
%5 = call i32 @jksengine_digests_init(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@NID_dsa = global i32 0
define i32 @jksengine_mddsa_init(i32* %0) {
%2 = load i32, i32* @NID_dsa
%3 = tail call i32 @jksengine_digests_init(i32* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ prt_depth();
int /*<<< orphan*/ prt_map();
int /*<<< orphan*/ prt_search();
int /*<<< orphan*/ prt_stat_block();
int /*<<< orphan*/ put_qio();
void draw_cave() {
  clear_screen();
  prt_stat_block();
  prt_map();
  prt_depth();
  prt_search();
  put_qio();
}


x86 assembly (clang, -O0):
<draw_cave>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clear_screen@plt>
mov    $0x0,%al
call   1030 <prt_stat_block@plt>
mov    $0x0,%al
call   1050 <prt_map@plt>
mov    $0x0,%al
call   1040 <prt_depth@plt>
mov    $0x0,%al
call   1070 <prt_search@plt>
mov    $0x0,%al
call   1080 <put_qio@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_cave>:
push   %rax
xor    %eax,%eax
call   1060 <clear_screen@plt>
xor    %eax,%eax
call   1030 <prt_stat_block@plt>
xor    %eax,%eax
call   1050 <prt_map@plt>
xor    %eax,%eax
call   1040 <prt_depth@plt>
xor    %eax,%eax
call   1070 <prt_search@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <put_qio@plt>

LLVM IR (-O0):
define void @draw_cave() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @prt_stat_block()
%3 = call i32 (...) @prt_map()
%4 = call i32 (...) @prt_depth()
%5 = call i32 (...) @prt_search()
%6 = call i32 (...) @put_qio()
ret void
}

LLVM IR (-O2):
define void @draw_cave() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @prt_stat_block()
%3 = tail call i32 (...) @prt_map()
%4 = tail call i32 (...) @prt_depth()
%5 = tail call i32 (...) @prt_search()
%6 = tail call i32 (...) @put_qio()
ret void
}
void next_String(_loc, _Base_String, _loc_0, _Base_String_0) int *_loc,
    *_Base_String, _loc_0, _Base_String_0;
{ String_NEXT_FNC_OBJ(_loc, _Base_String, _loc_0, _Base_String_0); }


x86 assembly (clang, -O0):
<next_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x0,%al
call   1030 <String_NEXT_FNC_OBJ@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @next_String(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @String_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @next_String(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @String_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
void __SLIC_fun_free_irq_return(unsigned int __SLIC_arg_1, void *__SLIC_arg_2) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_free_irq_return(i32 %0, i8* nocapture %1) {
ret void
}
void RTDirRemoveRecursive(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirRemoveRecursive() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char);
void putch(int fcolor, int bcolor, char ch) {
  printf("\033[%dm\033[%dm%c\033[0m", fcolor, bcolor, ch);
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed0(%rip),%rdi
movsbl -0x9(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[%dm\1B[%dm%c\1B[0m\00"
define void @putch(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[%dm\1B[%dm%c\1B[0m\00"
define void @putch(i32 %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8 signext %2)
ret void
}
/* Variables and functions */
int partition(int *, int);
void sort(int *a, int n) {
  int pindex;
  if (n <= 1)
    return;
  pindex = partition(a, n);
  sort(a, pindex);
  sort(a + pindex + 1, n - pindex - 1);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <sort+0x1e>
jmp    117a <sort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <sort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <sort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <sort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <sort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @sort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ abs(int);
float range_mid(int start, int end) { return (float)(abs(start + end)) / 2.0; }


x86 assembly (clang, -O0):
<range_mid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
call   1030 <abs@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_mid>:
push   %rax
add    %esi,%edi
call   1030 <abs@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @range_mid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i64 @abs(i32 %7)
%9 = sitofp i64 %8 to float
%10 = fpext float %9 to double
%11 = fdiv double %10, 2.000000e+00
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @range_mid(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i64 @abs(i32 %3)
%5 = sitofp i64 %4 to float
%6 = fmul float %5, 5.000000e-01
ret float %6
}
int compare_float(const void *a, const void *b) {
  if (*(float *)a > *(float *)b)
    return 1;
  if (*(float *)a < *(float *)b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <compare_float+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <compare_float+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <compare_float+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <compare_float+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_float(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 float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp ogt float %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 float*
%17 = load float, float* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp olt float %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 @compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
extern void ctags_free(char *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<ctags_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ctags_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctags_free>:
test   %rdi,%rdi
je     111a <ctags_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ctags_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ctags_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", fun(10));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <fun@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
double factorial(double x) {
  double res = 0.0;
  if (x == 0) {
    res = 1;
  } else {
    res = x * factorial(x - 1);
  }
  return res;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114f <factorial+0x3f>
jp     114f <factorial+0x3f>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1180 <factorial+0x70>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    112b <factorial+0x1b>
jp     112b <factorial+0x1b>
movsd  0xed7(%rip),%xmm0
pop    %rax
ret
movsd  0xed5(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <factorial@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %3
br label %13
7: ; preds = %1
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fsub double %9, 1.000000e+00
%11 = call double @factorial(double %10)
%12 = fmul double %8, %11
store double %12, double* %3
br label %13
13: ; preds = %7, %6
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @factorial(double %6)
%8 = fmul double %7, %0
br label %3
}
/* Variables and functions */
int f79(int *);
int f80(int *p) { return f79(p); }


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

x86 assembly (clang, -O2):
<f80>:
jmp    1030 <f79@plt>

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

LLVM IR (-O2):
define i32 @f80(i32* %0) {
%2 = tail call i32 @f79(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void main(void) {
  char *argv[] = {"hello", "world", 0};
  int argc = 0;
  do {
    printf("argv[%d] = %s\n", argc, argv[argc]);
  } while (argv[argc++] != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
cmpq   $0x0,-0x20(%rbp,%rax,8)
jne    1140 <main+0x30>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@__const.main.argv = [3 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [15 x i8] c"argv[%d] = %s\0A\00"
define void @main() {
%1 = alloca [3 x i8*]
%2 = alloca i32
%3 = bitcast [3 x i8*]* %1 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5, i8* %9)
br label %11
11: ; preds = %4
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = icmp ne i8* %16, null
br i1 %17, label %4, label %18
18: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [15 x i8] c"argv[%d] = %s\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_version(void) {
  puts("seqc bioinformatics tool "
       "0.1.6"
       "\n"
       "written by modulated");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"seqc bioinformatics tool 0.1.6\0Awritten by modulated\00"
define void @print_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"seqc bioinformatics tool 0.1.6\0Awritten by modulated\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
void produce_z(int *z) {
  for (int i = 0; i < 1000; i++) {
    for (int j = 0; j < 1000; ++j) {
    }
  }
  *z = 2;
}


x86 assembly (clang, -O0):
<produce_z>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1156 <produce_z+0x56>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    1143 <produce_z+0x43>
jmp    1135 <produce_z+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <produce_z+0x23>
jmp    1148 <produce_z+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <produce_z+0xf>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<produce_z>:
movl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @produce_z(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret void
}
/* Variables and functions */
int ext2fs_test_bit(unsigned int nr, const void *addr) {
  int mask;
  const unsigned char *ADDR = (const unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << (nr & 0x07);
  return (mask & *ADDR);
}


x86 assembly (clang, -O0):
<ext2fs_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
movzbl (%rsi,%rax,1),%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ext2fs_test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %6
%8 = load i32, i32* %3
%9 = lshr i32 %8, 3
%10 = load i8*, i8** %6
%11 = zext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %6
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = shl i32 1, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @ext2fs_test_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xca() {
  Assert_real((isalnum(202) == 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_isalnum.c",
              1015, ("isalnum should be 0 for 0xca"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xca>:
push   %rax
mov    $0xca,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f7,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xca\00"
define void @t_isalnum_0xca() {
%1 = call i64 @isalnum(i32 202)
%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 1015, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xca\00"
define void @t_isalnum_0xca() {
%1 = tail call i64 @isalnum(i32 202)
%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 1015, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void memory_deallocate(void *ptr) { free(ptr); }


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

LLVM IR (-O0):
define void @memory_deallocate(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 @memory_deallocate(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
long *malloc(size_t);
int /*<<< orphan*/ memcpy(long *, long const *, size_t);
long *zldup(long const *src, size_t len) {
  long *p = malloc(len * sizeof(long));
  memcpy(p, src, len * sizeof(long));
  return p;
}


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

x86 assembly (clang, -O2):
<zldup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x0(,%rsi,8),%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64* @zldup(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* %4
%7 = mul i64 %6, 8
%8 = call i64* @malloc(i64 %7)
store i64* %8, i64** %5
%9 = load i64*, i64** %5
%10 = load i64*, i64** %3
%11 = load i64, i64* %4
%12 = mul i64 %11, 8
%13 = call i32 @memcpy(i64* %9, i64* %10, i64 %12)
%14 = load i64*, i64** %5
ret i64* %14
}

LLVM IR (-O2):
define i64* @zldup(i64* %0, i64 %1) {
%3 = shl i64 %1, 3
%4 = tail call i64* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i64* %4, i64* %0, i64 %3)
ret i64* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void main(int argc, char *argv[], char *envp[]) {
  printf("Hello World %d %s\n", argc, argv[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%eax
mov    (%rsi),%rdx
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Hello World %d %s\0A\00"
define void @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
ret void
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
int /*<<< orphan*/ pl011_uart_putc(char const);
int32_t early_debug_write(const char *buffer, size_t size) {
  size_t i;
  for (i = 0; i < size; i++) {
    pl011_uart_putc(buffer[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<early_debug_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <early_debug_write+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <pl011_uart_putc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <early_debug_write+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<early_debug_write>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
test   %rsi,%rsi
je     1143 <early_debug_write+0x33>
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <pl011_uart_putc@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <early_debug_write+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @early_debug_write(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 = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @pl011_uart_putc(i8 signext %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @early_debug_write(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @pl011_uart_putc(i8 signext %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int next_collatz_num(int);
void next_collatz_num_test(void) {
  assert(next_collatz_num(13) == 40);
  assert(next_collatz_num(16) == 8);
}


x86 assembly (clang, -O0):
<next_collatz_num_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1040 <next_collatz_num@plt>
cmp    $0x28,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x10,%edi
call   1040 <next_collatz_num@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_collatz_num_test>:
push   %rax
mov    $0xd,%edi
call   1040 <next_collatz_num@plt>
xor    %edi,%edi
cmp    $0x28,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x10,%edi
call   1040 <next_collatz_num@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @next_collatz_num_test() {
%1 = call i32 @next_collatz_num(i32 13)
%2 = icmp eq i32 %1, 40
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @next_collatz_num(i32 16)
%6 = icmp eq i32 %5, 8
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}

LLVM IR (-O2):
define void @next_collatz_num_test() {
%1 = tail call i32 @next_collatz_num(i32 13)
%2 = icmp eq i32 %1, 40
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @next_collatz_num(i32 16)
%6 = icmp eq i32 %5, 8
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_nine_decimals() {
  char *str = "1234.000000001";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 1);
}


x86 assembly (clang, -O0):
<test_nine_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1172 <test_nine_decimals+0x52>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nine_decimals>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"1234.000000001\00"
define void @test_nine_decimals() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 1
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"1234.000000001\00"
define void @test_nine_decimals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
void __change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(long) * 8)));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (sizeof(long) * 8));
  *p ^= mask;
}


x86 assembly (clang, -O0):
<__change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__change_bit>:
movslq %edi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x6,%rcx
xor    %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @__change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %8, 64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = xor i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = xor i64 %8, %5
store i64 %9, i64* %7
ret void
}
void foo(int a, int b) {
  for (; a != b; a += 4)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1129 <foo+0x29>
jmp    111b <foo+0x1b>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <foo+0xa>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
void float_test_call(void) {}


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

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

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

LLVM IR (-O2):
define void @float_test_call() {
ret void
}
int rct_is_cf_trueide(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @rct_is_cf_trueide() {
ret i32 0
}

LLVM IR (-O2):
define i32 @rct_is_cf_trueide() {
ret i32 0
}