xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_alib(void) {
  printf("This is a \"alib\" target.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"This is a \22alib\22 target.\0A\00"
define i32 @test_alib() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"This is a \22alib\22 target.\00"
define i32 @test_alib() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct windowlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ refreshAll(struct windowlist *);
int /*<<< orphan*/ resizeAll(struct windowlist *);
int /*<<< orphan*/ writeContents(struct windowlist *);
int /*<<< orphan*/ writeTitles(struct windowlist *);
void writeAllRefresh(struct windowlist *list) {
  resizeAll(list);
  writeContents(list);
  writeTitles(list);
  refreshAll(list);
  return;
}


x86 assembly (clang, -O0):
<writeAllRefresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <resizeAll@plt>
mov    -0x8(%rbp),%rdi
call   1050 <writeContents@plt>
mov    -0x8(%rbp),%rdi
call   1040 <writeTitles@plt>
mov    -0x8(%rbp),%rdi
call   1030 <refreshAll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeAllRefresh>:
push   %rbx
mov    %rdi,%rbx
call   1060 <resizeAll@plt>
mov    %rbx,%rdi
call   1050 <writeContents@plt>
mov    %rbx,%rdi
call   1040 <writeTitles@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <refreshAll@plt>

LLVM IR (-O0):
%struct.windowlist = type { i32 }
define void @writeAllRefresh(%struct.windowlist* %0) {
%2 = alloca %struct.windowlist*
store %struct.windowlist* %0, %struct.windowlist** %2
%3 = load %struct.windowlist*, %struct.windowlist** %2
%4 = call i32 @resizeAll(%struct.windowlist* %3)
%5 = load %struct.windowlist*, %struct.windowlist** %2
%6 = call i32 @writeContents(%struct.windowlist* %5)
%7 = load %struct.windowlist*, %struct.windowlist** %2
%8 = call i32 @writeTitles(%struct.windowlist* %7)
%9 = load %struct.windowlist*, %struct.windowlist** %2
%10 = call i32 @refreshAll(%struct.windowlist* %9)
ret void
}

LLVM IR (-O2):
%struct.windowlist = type { i32 }
define void @writeAllRefresh(%struct.windowlist* %0) {
%2 = tail call i32 @resizeAll(%struct.windowlist* %0)
%3 = tail call i32 @writeContents(%struct.windowlist* %0)
%4 = tail call i32 @writeTitles(%struct.windowlist* %0)
%5 = tail call i32 @refreshAll(%struct.windowlist* %0)
ret void
}
/* Type definitions */
struct ectp_packet {
  int dummy;
};
struct ectp_message {
  int dummy;
};

/* Variables and functions */
struct ectp_message *ectp_get_msg_ptr(int /*<<< orphan*/,
                                      struct ectp_packet const *);
int /*<<< orphan*/ ectp_get_skipcount(struct ectp_packet const *);
struct ectp_message *ectp_get_curr_msg_ptr(const struct ectp_packet *ectp_pkt) {
  return ectp_get_msg_ptr(ectp_get_skipcount(ectp_pkt), ectp_pkt);
}


x86 assembly (clang, -O0):
<ectp_get_curr_msg_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ectp_get_skipcount@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <ectp_get_msg_ptr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ectp_get_curr_msg_ptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ectp_get_skipcount@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ectp_get_msg_ptr@plt>

LLVM IR (-O0):
%struct.ectp_message = type { i32 }
%struct.ectp_packet = type { i32 }
define %struct.ectp_message* @ectp_get_curr_msg_ptr(%struct.ectp_packet* %0) {
%2 = alloca %struct.ectp_packet*
store %struct.ectp_packet* %0, %struct.ectp_packet** %2
%3 = load %struct.ectp_packet*, %struct.ectp_packet** %2
%4 = call i32 @ectp_get_skipcount(%struct.ectp_packet* %3)
%5 = load %struct.ectp_packet*, %struct.ectp_packet** %2
%6 = call %struct.ectp_message* @ectp_get_msg_ptr(i32 %4, %struct.ectp_packet* %5)
ret %struct.ectp_message* %6
}

LLVM IR (-O2):
%struct.ectp_message = type { i32 }
%struct.ectp_packet = type { i32 }
define %struct.ectp_message* @ectp_get_curr_msg_ptr(%struct.ectp_packet* %0) {
%2 = tail call i32 @ectp_get_skipcount(%struct.ectp_packet* %0)
%3 = tail call %struct.ectp_message* @ectp_get_msg_ptr(i32 %2, %struct.ectp_packet* %0)
ret %struct.ectp_message* %3
}
int test4() {
  int a, b;
  if (a < 1) {
    if (a < 2)
      b = 1;
    else
      b = 2;
  } else
    b = 3;
  return a + b;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x1,-0x4(%rbp)
jge    1130 <test4+0x30>
cmpl   $0x2,-0x4(%rbp)
jge    1124 <test4+0x24>
movl   $0x1,-0x8(%rbp)
jmp    112b <test4+0x2b>
movl   $0x2,-0x8(%rbp)
jmp    1137 <test4+0x37>
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test4() {
ret i32 undef
}
/* Variables and functions */
char *getprogname();
int /*<<< orphan*/ printf(char *, char *);
void usage() { printf("%s [-v|--verbose]\n", getprogname()); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s [-v|--verbose]\0A\00"
define void @usage() {
%1 = call i8* (...) @getprogname()
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s [-v|--verbose]\0A\00"
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int IFNAMSIZ;
int ifnamsiz() { return IFNAMSIZ; }


x86 assembly (clang, -O0):
<ifnamsiz>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifnamsiz>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@IFNAMSIZ = global i32 0
define i32 @ifnamsiz() {
%1 = load i32, i32* @IFNAMSIZ
ret i32 %1
}

LLVM IR (-O2):
@IFNAMSIZ = global i32 0
define i32 @ifnamsiz() {
%1 = load i32, i32* @IFNAMSIZ
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *str_cpy(const char *str) {
  if (str == NULL)
    return NULL;
  char *new_str = (char *)malloc(strlen(str) + 1);
  if (new_str == NULL)
    return NULL;
  strcpy(new_str, str);
  return new_str;
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <str_cpy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119a <str_cpy+0x6a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <str_cpy+0x55>
movq   $0x0,-0x8(%rbp)
jmp    119a <str_cpy+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <str_cpy+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <str_cpy+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <str_cpy+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_cpy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %9, %3, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handleData5(char *data, int len) {
  printf("# vulnserver_cov: Handledata5: %i\n", len);
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"# vulnserver_cov: Handledata5: %i\0A\00"
define void @handleData5(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"# vulnserver_cov: Handledata5: %i\0A\00"
define void @handleData5(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *ERR_error_string(int, char *);
char *__ustream_ssl_strerror(int error, char *buffer, int len) {
  return ERR_error_string(error, buffer);
}


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

x86 assembly (clang, -O2):
<__ustream_ssl_strerror>:
jmp    1030 <ERR_error_string@plt>

LLVM IR (-O0):
define i8* @__ustream_ssl_strerror(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
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i8* @ERR_error_string(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @__ustream_ssl_strerror(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ERR_error_string(i32 %0, i8* %1)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void usart_putc(int fd, uint8_t c) { write(fd, &c, 1); }


x86 assembly (clang, -O0):
<usart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_putc>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @usart_putc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i32* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @usart_putc(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 1)
ret void
}
mcompile() {
  void gtm$compile();
  gtm$compile();
}


x86 assembly (clang, -O0):
<mcompile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gtm$compile@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcompile>:
xor    %eax,%eax
jmp    1030 <gtm$compile@plt>

LLVM IR (-O0):
define i32 @mcompile() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mcompile() {
tail call void (...) @"gtm$compile"()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h265nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h265nal_set_type(int /*<<< orphan*/ *, int);
void h265eos_init(uint8_t *p_h265eos) {
  h265nal_init(p_h265eos);
  h265nal_set_type(p_h265eos, 36);
}


x86 assembly (clang, -O0):
<h265eos_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h265nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x24,%esi
call   1030 <h265nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265eos_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h265nal_init@plt>
mov    %rbx,%rdi
mov    $0x24,%esi
pop    %rbx
jmp    1030 <h265nal_set_type@plt>

LLVM IR (-O0):
define void @h265eos_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h265nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h265nal_set_type(i32* %5, i32 36)
ret void
}

LLVM IR (-O2):
define void @h265eos_init(i32* %0) {
%2 = tail call i32 @h265nal_init(i32* %0)
%3 = tail call i32 @h265nal_set_type(i32* %0, i32 36)
ret void
}
void wx11er(errnum, errsev) int *errnum, *errsev;
{}


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

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

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

LLVM IR (-O2):
define void @wx11er(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ haffman_code(int *);
int main() {
  int frequent[10] = {1, 3, 5, 7};
  haffman_code(frequent);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x3,-0x2c(%rbp)
movl   $0x5,-0x28(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <haffman_code@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <haffman_code@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = bitcast i8* %2 to [10 x i32]*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 1
store i32 3, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 2
store i32 5, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i32 0, i32 3
store i32 7, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = call i32 @haffman_code(i32* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %6
%7 = call i32 @haffman_code(i32* %5)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void set_bit_reg16(volatile uint16_t *reg, uint8_t bit) {
  (*(volatile unsigned int *)(((((uint32_t)reg & 0xF0000000) + 0x02000000 +
                                (((uint32_t)reg & 0xFFFFF) << 5) +
                                (bit << 2))))) = 0x1;
}


x86 assembly (clang, -O0):
<set_bit_reg16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0000000,%eax
add    $0x2000000,%eax
mov    -0x8(%rbp),%rcx
and    $0xfffff,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_reg16>:
mov    %edi,%eax
and    $0xf0000000,%eax
shl    $0x5,%edi
and    $0x1ffffe0,%edi
or     %eax,%edi
lea    (%rdi,%rsi,4),%eax
add    $0x2000000,%eax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @set_bit_reg16(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 = ptrtoint i32* %5 to i32
%7 = and i32 %6, -268435456
%8 = add i32 %7, 33554432
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i32
%11 = and i32 %10, 1048575
%12 = shl i32 %11, 5
%13 = add i32 %8, %12
%14 = load i32, i32* %4
%15 = shl i32 %14, 2
%16 = add i32 %13, %15
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 1, i32* %18
ret void
}

LLVM IR (-O2):
define void @set_bit_reg16(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, -268435456
%6 = shl i32 %4, 5
%7 = and i32 %6, 33554400
%8 = or i32 %5, %7
%9 = shl i32 %1, 2
%10 = add i32 %9, 33554432
%11 = add i32 %10, %8
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 1, i32* %13
ret void
}
int max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sbox_run(int, int, char *, char *, char const *);
void dhcp_waitll(const char *ifname) {
  sbox_run((1 << 0) | (1 << 4) | (1 << 2), 3,
           ("/run"
            "/firejail"
            "/lib"
            "/fnet"),
           "waitll", ifname);
}


x86 assembly (clang, -O0):
<dhcp_waitll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
mov    $0x15,%edi
mov    $0x3,%esi
lea    0xecf(%rip),%rdx
lea    0xedf(%rip),%rcx
call   1030 <sbox_run@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_waitll>:
mov    %rdi,%r8
lea    0xee6(%rip),%rdx
lea    0xef6(%rip),%rcx
mov    $0x15,%edi
mov    $0x3,%esi
jmp    1030 <sbox_run@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/run/firejail/lib/fnet\00"
@.str.1 = [7 x i8] c"waitll\00"
define void @dhcp_waitll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sbox_run(i32 21, i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/run/firejail/lib/fnet\00"
@.str.1 = [7 x i8] c"waitll\00"
define void @dhcp_waitll(i8* %0) {
%2 = tail call i32 @sbox_run(i32 21, i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void rct_set_ssi_clk_src(int src) {}


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

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

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

LLVM IR (-O2):
define void @rct_set_ssi_clk_src(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
int main() {
  c();
  d();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @c()
%3 = call i32 (...) @d()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @d()
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *octave_strdup_wrapper(const char *str) { return strdup(str); }


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

x86 assembly (clang, -O2):
<octave_strdup_wrapper>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @octave_strdup_wrapper(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Process_MGR(int, int);
int DownloadProcessVars(int bus_id) {
  int i;
  for (i = 0; i < 4 * 128; i++)
    Process_MGR(bus_id, i);
  return 0;
}


x86 assembly (clang, -O0):
<DownloadProcessVars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1148 <DownloadProcessVars+0x38>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Process_MGR@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <DownloadProcessVars+0x12>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DownloadProcessVars>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <Process_MGR@plt>
add    $0x1,%ebp
cmp    $0x200,%ebp
jne    1120 <DownloadProcessVars+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @DownloadProcessVars(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @Process_MGR(i32 %0, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 512
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int PckBacpNetRqtEx(unsigned char *, int, int, unsigned int, unsigned char *);
int PckBacpNetRqt(unsigned char *pAppBuf, int nAppBufLen, unsigned int nSeq,
                  unsigned char *pFrm) {
  return PckBacpNetRqtEx(pAppBuf, nAppBufLen, 1, nSeq, pFrm);
}


x86 assembly (clang, -O0):
<PckBacpNetRqt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0x1,%edx
call   1030 <PckBacpNetRqtEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PckBacpNetRqt>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <PckBacpNetRqtEx@plt>

LLVM IR (-O0):
define i32 @PckBacpNetRqt(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @PckBacpNetRqtEx(i8* %9, i32 %10, i32 1, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @PckBacpNetRqt(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @PckBacpNetRqtEx(i8* %0, i32 %1, i32 1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    return c - 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ modp_tolower_map();
int /*<<< orphan*/ modp_toprint_map();
int /*<<< orphan*/ modp_toupper_map();
int main() {
  modp_toupper_map();
  modp_tolower_map();
  modp_toprint_map();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <modp_toupper_map@plt>
mov    $0x0,%al
call   1040 <modp_tolower_map@plt>
mov    $0x0,%al
call   1030 <modp_toprint_map@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @modp_toupper_map()
%3 = call i32 (...) @modp_tolower_map()
%4 = call i32 (...) @modp_toprint_map()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @modp_toupper_map()
%2 = tail call i32 (...) @modp_tolower_map()
%3 = tail call i32 (...) @modp_toprint_map()
ret i32 0
}
void libopencore_amrnb_init() {}


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

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

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

LLVM IR (-O2):
define void @libopencore_amrnb_init() {
ret void
}
f(long l) {
  switch (l) {
  case 3:
    return 1;
  case 2L:
    return 2;
  }
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x2,%rax
je     113e <f+0x3e>
jmp    111f <f+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x3,%rax
jne    114a <f+0x4a>
jmp    1132 <f+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1151 <f+0x51>
movl   $0x2,-0x4(%rbp)
jmp    1151 <f+0x51>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %ecx,%ecx
cmp    $0x2,%rdi
sete   %cl
xor    $0x3,%ecx
cmp    $0x3,%rdi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %7 [
i64 3, label %5
i64 2, label %6
]
5: ; preds = %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
store i32 2, i32* %2
br label %8
7: ; preds = %1
store i32 3, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = icmp eq i64 %0, 2
%3 = select i1 %2, i32 2, i32 3
%4 = icmp eq i64 %0, 3
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sys_defs_free();
int /*<<< orphan*/ sys_defs_init();
int /*<<< orphan*/ testWordNew();
void testWord() {
  sys_defs_init();
  testWordNew();
  sys_defs_free();
}


x86 assembly (clang, -O0):
<testWord>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sys_defs_init@plt>
mov    $0x0,%al
call   1030 <testWordNew@plt>
mov    $0x0,%al
call   1040 <sys_defs_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testWord>:
push   %rax
xor    %eax,%eax
call   1050 <sys_defs_init@plt>
xor    %eax,%eax
call   1030 <testWordNew@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sys_defs_free@plt>

LLVM IR (-O0):
define void @testWord() {
%1 = call i32 (...) @sys_defs_init()
%2 = call i32 (...) @testWordNew()
%3 = call i32 (...) @sys_defs_free()
ret void
}

LLVM IR (-O2):
define void @testWord() {
%1 = tail call i32 (...) @sys_defs_init()
%2 = tail call i32 (...) @testWordNew()
%3 = tail call i32 (...) @sys_defs_free()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ eembed_stream(int /*<<< orphan*/ *);
int /*<<< orphan*/ eembed_system_fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ eembed_system_fprintf(int /*<<< orphan*/ *, char *);
void eembed_stream_eol(FILE *stream) {
  eembed_stream(stream);
  eembed_system_fprintf(stream, "\n");
  eembed_system_fflush(stream);
}


x86 assembly (clang, -O0):
<eembed_stream_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <eembed_stream@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <eembed_system_fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <eembed_system_fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_stream_eol>:
push   %rbx
mov    %rdi,%rbx
call   1050 <eembed_stream@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <eembed_system_fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <eembed_system_fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @eembed_stream_eol(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @eembed_stream(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @eembed_system_fprintf(i32* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @eembed_system_fflush(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @eembed_stream_eol(i32* %0) {
%2 = tail call i32 @eembed_stream(i32* %0)
%3 = tail call i32 @eembed_system_fprintf(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @eembed_system_fflush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ strncmp(char *, char *, int);
void strncmp_equal_length() {
  Assert_real((strncmp("equal", "equalbar", 5) == 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/string/strncmp.c",
              14, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<strncmp_equal_length>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xe,%edx
lea    0xf58(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_equal_length>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec6(%rip),%rsi
lea    0xf63(%rip),%rcx
mov    $0xe,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"equalbar\00"
@.str.2 = [164 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/string/strncmp.c\00"
@.str.3 = [15 x i8] c"Should be == 0\00"
define void @strncmp_equal_length() {
%1 = call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"equalbar\00"
@.str.2 = [164 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/string/strncmp.c\00"
@.str.3 = [15 x i8] c"Should be == 0\00"
define void @strncmp_equal_length() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void freeArrayOfObjects_free(void **arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    free(arr[i]);
  };
  free(arr);
}


x86 assembly (clang, -O0):
<freeArrayOfObjects_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeArrayOfObjects_free+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeArrayOfObjects_free+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArrayOfObjects_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeArrayOfObjects_free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeArrayOfObjects_free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeArrayOfObjects_free(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
/* Type definitions */
struct SXConnection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void pongHandler(void *data, size_t size, int sock, struct SXConnection *conn) {
  (void)(data);
  (void)(size);
  (void)(sock);
  (void)(conn);
  puts("Pong received");
}


x86 assembly (clang, -O0):
<pongHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.SXConnection = type { i32 }
@.str = [14 x i8] c"Pong received\00"
define void @pongHandler(i8* %0, i64 %1, i32 %2, %struct.SXConnection* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca %struct.SXConnection*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store %struct.SXConnection* %3, %struct.SXConnection** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
%12 = load %struct.SXConnection*, %struct.SXConnection** %8
%13 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.SXConnection = type { i32 }
@.str = [14 x i8] c"Pong received\00"
define void @pongHandler(i8* nocapture readnone %0, i64 %1, i32 %2, %struct.SXConnection* nocapture readnone %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int make_leaf_prediction_multiregr_nosave() { return -1; }


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

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

LLVM IR (-O0):
define i32 @make_leaf_prediction_multiregr_nosave() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @make_leaf_prediction_multiregr_nosave() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t write_int32(FILE *fp, int32_t i) { return fwrite(&i, sizeof(i), 1, fp); }


x86 assembly (clang, -O0):
<write_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int32>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @write_int32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i64 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @write_int32(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret i64 %4
}
unsigned xrop3_66_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ D;
  stk2 = T ^ D;
  stk1 = stk1 & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_66_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_66_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
and    %eax,%ecx
movzbl %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_66_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_66_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = and i32 %4, 255
%9 = xor i32 %8, 255
%10 = and i32 %9, %7
%11 = or i32 %10, %3
ret i32 %11
}
void X509_NAME_add_entry(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_add_entry() {
ret void
}
int args2(void *arg1, void *arg2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @args2(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
float sin(float);
float cxvec_sinc(float x) {
  if (x == 0.0f)
    return .9999999999;
  return sin((3.14159265358979323846264338327f) * x) /
         ((3.14159265358979323846264338327f) * x);
}


x86 assembly (clang, -O0):
<cxvec_sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <cxvec_sinc+0x36>
jp     1146 <cxvec_sinc+0x36>
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <cxvec_sinc+0x5e>
movss  0xeb2(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movss  0xea0(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cxvec_sinc>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1125 <cxvec_sinc+0x15>
jp     1125 <cxvec_sinc+0x15>
movss  0xedd(%rip),%xmm0
pop    %rax
ret
mulss  0xed7(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <sin@plt>
divss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @cxvec_sinc(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul float %0, 0x400921FB60000000
%5 = tail call float @sin(float %4)
%6 = fdiv float %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ 1.000000e+00, %1 ]
ret float %8
}
/* Variables and functions */
float sincoshf(float const, int);
float coshf(const float x) { return sincoshf(x, 1); }


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

x86 assembly (clang, -O2):
<coshf>:
mov    $0x1,%edi
jmp    1030 <sincoshf@plt>

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

LLVM IR (-O2):
define float @coshf(float %0) {
%2 = tail call float @sincoshf(float %0, i32 1)
ret float %2
}