xunge/DecIR huggingface dataset:
/* Type definitions */
struct daemon_session {
  int dummy;
};

/* Variables and functions */
int serve_reg_write(struct daemon_session *);
int serve_udp_write(struct daemon_session *dsess) {
  return serve_reg_write(dsess);
}


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

x86 assembly (clang, -O2):
<serve_udp_write>:
jmp    1030 <serve_reg_write@plt>

LLVM IR (-O0):
%struct.daemon_session = type { i32 }
define i32 @serve_udp_write(%struct.daemon_session* %0) {
%2 = alloca %struct.daemon_session*
store %struct.daemon_session* %0, %struct.daemon_session** %2
%3 = load %struct.daemon_session*, %struct.daemon_session** %2
%4 = call i32 @serve_reg_write(%struct.daemon_session* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.daemon_session = type { i32 }
define i32 @serve_udp_write(%struct.daemon_session* %0) {
%2 = tail call i32 @serve_reg_write(%struct.daemon_session* %0)
ret i32 %2
}
/* Type definitions */
struct shash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int shash_erase(struct shash *, char *, int);
void erase_not_exists(struct shash *shash) {
  assert(shash_erase(shash, "1", 2) == -1);
  assert(shash_erase(shash, "2", 2) == -1);
}


x86 assembly (clang, -O0):
<erase_not_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x2,%edx
call   1030 <shash_erase@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x2,%edx
call   1030 <shash_erase@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_not_exists>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x2,%edx
call   1030 <shash_erase@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <shash_erase@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.shash = type { i32 }
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
define void @erase_not_exists(%struct.shash* %0) {
%2 = alloca %struct.shash*
store %struct.shash* %0, %struct.shash** %2
%3 = load %struct.shash*, %struct.shash** %2
%4 = call i32 @shash_erase(%struct.shash* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.shash*, %struct.shash** %2
%9 = call i32 @shash_erase(%struct.shash* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
%struct.shash = type { i32 }
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
define void @erase_not_exists(%struct.shash* %0) {
%2 = tail call i32 @shash_erase(%struct.shash* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @shash_erase(%struct.shash* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_curve();
void sp_close_contour() { close_curve(); }


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

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

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

LLVM IR (-O2):
define void @sp_close_contour() {
%1 = tail call i32 (...) @close_curve()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc18(void) {
  printf("Executing exitfunc18.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc18>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc18.\0A\00"
define void @exitfunc18() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc18.\00"
define void @exitfunc18() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ff_hevc_put_hevc_uni_qpel_hv8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv8_12_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int);
uint32_t _Nios2_Get_ctlreg_tlbmisc(void) {
  return (uint32_t)__builtin_rdctl(10);
}


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

x86 assembly (clang, -O2):
<_Nios2_Get_ctlreg_tlbmisc>:
mov    $0xa,%edi
jmp    1030 <__builtin_rdctl@plt>

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_tlbmisc() {
%1 = call i32 @__builtin_rdctl(i32 10)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_tlbmisc() {
%1 = tail call i32 @__builtin_rdctl(i32 10)
ret i32 %1
}
void X509V3_set_conf_lhash(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_set_conf_lhash() {
ret void
}
void SPIDmaEnable(unsigned long ulBase, unsigned long ulFlags) {
  (*((volatile unsigned long *)(ulBase + 0x0000012C))) |= ulFlags;
}


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

x86 assembly (clang, -O2):
<SPIDmaEnable>:
or     %rsi,0x12c(%rdi)
ret

LLVM IR (-O0):
define void @SPIDmaEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 300
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SPIDmaEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 300
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LIGHT1;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void toggle_headlight(void) {
  static int headlight_activated = 0;
  if (!headlight_activated)
    glEnable(GL_LIGHT1);
  else
    glDisable(GL_LIGHT1);
  headlight_activated = !headlight_activated;
  return;
}


x86 assembly (clang, -O0):
<toggle_headlight>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    1144 <toggle_headlight+0x24>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    1152 <toggle_headlight+0x32>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
cmpl   $0x0,0x2edb(%rip)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,0x2ecb(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_headlight>:
push   %rax
cmpl   $0x0,0x2f0c(%rip)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
je     113a <toggle_headlight+0x1a>
call   1040 <glDisable@plt>
jmp    113f <toggle_headlight+0x1f>
call   1030 <glEnable@plt>
xor    %eax,%eax
cmpl   $0x0,0x2eec(%rip)
sete   %al
mov    %eax,0x2ee3(%rip)
pop    %rax
ret

LLVM IR (-O0):
@toggle_headlight.headlight_activated = internal global i32 0
@GL_LIGHT1 = global i32 0
define void @toggle_headlight() {
%1 = load i32, i32* @toggle_headlight.headlight_activated
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @GL_LIGHT1
%5 = call i32 @glEnable(i32 %4)
br label %9
6: ; preds = %0
%7 = load i32, i32* @GL_LIGHT1
%8 = call i32 @glDisable(i32 %7)
br label %9
9: ; preds = %6, %3
%10 = load i32, i32* @toggle_headlight.headlight_activated
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* @toggle_headlight.headlight_activated
ret void
}

LLVM IR (-O2):
@toggle_headlight.headlight_activated = internal unnamed_addr global i32 0
@GL_LIGHT1 = global i32 0
define void @toggle_headlight() {
%1 = load i32, i32* @toggle_headlight.headlight_activated
%2 = icmp eq i32 %1, 0
%3 = load i32, i32* @GL_LIGHT1
br i1 %2, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @glEnable(i32 %3)
br label %8
6: ; preds = %0
%7 = tail call i32 @glDisable(i32 %3)
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @toggle_headlight.headlight_activated
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* @toggle_headlight.headlight_activated
ret void
}
int is_empty(const char *s) {
  for (int i = 0; s[i] != '\0'; i++) {
    if (s[i] == '#')
      continue;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <is_empty+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    113e <is_empty+0x3e>
jmp    114a <is_empty+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    115f <is_empty+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_empty+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
movzbl (%rdi),%eax
cmp    $0x23,%al
jne    110d <is_empty+0xd>
add    $0x1,%rdi
jmp    1100 <is_empty>
test   %al,%al
jne    1117 <is_empty+0x17>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %8
i8 35, label %6
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int execvp(char const *, char *const *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
pid_t spawn_with_fn(const char *program, char *const *args,
                    void (*fn)(void *data), void *fn_data) {
  pid_t pid;
  pid = fork();
  if (pid == 0) {
    int ret;
    fn(fn_data);
    ret = execvp(program, args);
    exit(ret);
    return -1;
  }
  return pid;
}


x86 assembly (clang, -O0):
<spawn_with_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1180 <spawn_with_fn+0x50>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <execvp@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1040 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawn_with_fn>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     115c <spawn_with_fn+0x2c>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %r12,%rdi
call   *%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <execvp@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i64 @spawn_with_fn(i8* %0, i8** %1, void (i8*)* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca void (i8*)*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store void (i8*)* %2, void (i8*)** %7
store i8* %3, i8** %8
%11 = call i64 (...) @fork()
store i64 %11, i64* %9
%12 = load i64, i64* %9
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %4
%15 = load void (i8*)*, void (i8*)** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %5
%18 = load i8**, i8*** %6
%19 = call i32 @execvp(i8* %17, i8** %18)
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %4
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @spawn_with_fn(i8* %0, i8** %1, void (i8*)* nocapture %2, i8* %3) {
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
tail call void %2(i8* %3)
%8 = tail call i32 @execvp(i8* %0, i8** %1)
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; argv[i] != NULL; ++i) {
    printf("-> %s\n", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1166 <main+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <main+0x34>
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"-> %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret i32 0
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ 0, %2 ]
%8 = phi i8* [ %12, %6 ], [ %3, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %5, label %6
}
void aeWait(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               36, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<aeWait>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x24,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeWait>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x24,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeWait = [7 x i8] c"aeWait\00"
define void @aeWait() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.aeWait, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeWait = [7 x i8] c"aeWait\00"
define void @aeWait() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.aeWait, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICYINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICYINFO_it;
POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, const unsigned char **in, long len) {
  return (POLICYINFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &POLICYINFO_it);
}


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

x86 assembly (clang, -O2):
<d2i_POLICYINFO>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@POLICYINFO_it = global i32 0
define i32* @d2i_POLICYINFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @POLICYINFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@POLICYINFO_it = global i32 0
define i32* @d2i_POLICYINFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @POLICYINFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
trputc(c) {}


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

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

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

LLVM IR (-O2):
define i32 @trputc(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ data_addcards(int, int, int);
int data_getcards(int, int);
int /*<<< orphan*/ trade_routine_other(int, int, int);
int devcards_YOP(int player) {
  if (data_getcards(player, 3) >= 1) {
    data_addcards(player, 3, -1);
    trade_routine_other(player, 2, 3);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<devcards_YOP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <data_getcards@plt>
cmp    $0x1,%eax
jl     1181 <devcards_YOP+0x51>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
mov    $0xffffffff,%edx
call   1040 <data_addcards@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <trade_routine_other@plt>
movl   $0x1,-0x4(%rbp)
jmp    1188 <devcards_YOP+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devcards_YOP>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
call   1030 <data_getcards@plt>
test   %eax,%eax
jle    116a <devcards_YOP+0x3a>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0xffffffff,%edx
call   1040 <data_addcards@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <trade_routine_other@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @devcards_YOP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @data_getcards(i32 %4, i32 3)
%6 = icmp sge i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @data_addcards(i32 %8, i32 3, i32 -1)
%10 = load i32, i32* %3
%11 = call i32 @trade_routine_other(i32 %10, i32 2, i32 3)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @devcards_YOP(i32 %0) {
%2 = tail call i32 @data_getcards(i32 %0, i32 3)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @data_addcards(i32 %0, i32 3, i32 -1)
%6 = tail call i32 @trade_routine_other(i32 %0, i32 2, i32 3)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %8
}
void mark_multiples(unsigned int **list, unsigned int *N, unsigned int *k) {
  unsigned int multiple = (*k) * (*k);
  while (multiple <= *N) {
    (*list)[multiple] = 1;
    multiple += (*k);
  }
}


x86 assembly (clang, -O0):
<mark_multiples>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
ja     1151 <mark_multiples+0x51>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x1c(%rbp),%ecx
movl   $0x1,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <mark_multiples+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_multiples>:
mov    (%rdx),%eax
imul   %eax,%eax
cmp    (%rsi),%eax
ja     111f <mark_multiples+0x1f>
mov    (%rdi),%rcx
nopl   0x0(%rax)
mov    %eax,%edi
movl   $0x1,(%rcx,%rdi,4)
add    (%rdx),%eax
cmp    (%rsi),%eax
jbe    1110 <mark_multiples+0x10>
ret

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

LLVM IR (-O2):
define void @mark_multiples(i32** nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = mul i32 %4, %4
%6 = load i32, i32* %1
%7 = icmp ugt i32 %5, %6
br i1 %7, label %18, label %8
8: ; preds = %3
%9 = load i32*, i32** %0
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ %5, %8 ], [ %15, %10 ]
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
store i32 1, i32* %13
%14 = load i32, i32* %2
%15 = add i32 %14, %11
%16 = load i32, i32* %1
%17 = icmp ugt i32 %15, %16
br i1 %17, label %18, label %10
18: ; preds = %10, %3
ret void
}
/* Variables and functions */
scalar_t__ remove(char *);
int removeTemp(void) {
  char *filename = "temp";
  if (remove(filename) == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<removeTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    1142 <removeTemp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <removeTemp+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeTemp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <remove@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"temp\00"
define i32 @removeTemp() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @remove(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"temp\00"
define i32 @removeTemp() {
%1 = tail call i64 @remove(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ modify(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int d = 10;
  printf("%d\n", d);
  modify(&d);
  printf("%d\n", d);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <modify@plt>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rdi
call   1030 <modify@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 @modify(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ yyunput(int /*<<< orphan*/, char *);
int go_wrap(void) {
  {
    if (0) {
      yyunput(0, "");
    }
  }
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @go_wrap() {
ret i32 1
}
unsigned int weather_get_ext_press() { return 99; }


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

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

LLVM IR (-O0):
define i32 @weather_get_ext_press() {
ret i32 99
}

LLVM IR (-O2):
define i32 @weather_get_ext_press() {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printf_usage(void) {
  printf("Version: 1.1\n");
  printf("Usage: cvimg <option> input-filename output-filename start-addr "
         "burn-addr [signature]\n");
  printf("<option>: root|linux|boot|all|vmlinux|vmlinuxhdr|signature\n");
  printf("[signature]: user-specified signature (4 characters)\n");
}


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

x86 assembly (clang, -O2):
<printf_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
lea    0xf62(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Version: 1.1\0A\00"
@.str.1 = [87 x i8] c"Usage: cvimg <option> input-filename output-filename start-addr burn-addr [signature]\0A\00"
@.str.2 = [60 x i8] c"<option>: root|linux|boot|all|vmlinux|vmlinuxhdr|signature\0A\00"
@.str.3 = [54 x i8] c"[signature]: user-specified signature (4 characters)\0A\00"
define void @printf_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Version: 1.1\00"
@str.4 = [86 x i8] c"Usage: cvimg <option> input-filename output-filename start-addr burn-addr [signature]\00"
@str.5 = [59 x i8] c"<option>: root|linux|boot|all|vmlinux|vmlinuxhdr|signature\00"
@str.6 = [53 x i8] c"[signature]: user-specified signature (4 characters)\00"
define void @printf_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
ret void
}
const char *divsufsort_version(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @divsufsort_version() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @divsufsort_version() {
ret i8* null
}
/* Variables and functions */
scalar_t__ fun1(char *, char *);
int fun(char *a, char *b) {
  int n = 0;
  for (; *a; a++)
    if (fun1(a, b))
      n++;
  return n;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <fun+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fun1@plt>
cmp    $0x0,%rax
je     1154 <fun+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <fun+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1127 <fun+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     114e <fun+0x3e>
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fun1@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <fun+0x20>
jmp    1150 <fun+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fun(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = tail call i64 @fun1(i8* %7, i8* %1)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Type definitions */
struct sockaddr_in6 {
  void *sin6_port;
};
struct sockaddr_in {
  void *sin_port;
};
struct sockaddr {
  scalar_t__ sa_family;
};
typedef void *in_port_t;

/* Variables and functions */
scalar_t__ AF_INET;
void set_in_port(struct sockaddr *sa, in_port_t val) {
  if (sa->sa_family == AF_INET)
    ((struct sockaddr_in *)sa)->sin_port = val;
  else
    ((struct sockaddr_in6 *)sa)->sin6_port = val;
}


x86 assembly (clang, -O0):
<set_in_port>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
jne    1133 <set_in_port+0x33>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    113e <set_in_port+0x3e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
%struct.sockaddr_in = type { i8* }
%struct.sockaddr_in6 = type { i8* }
@AF_INET = global i64 0
define void @set_in_port(%struct.sockaddr* %0, i8* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i8*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i8* %1, i8** %4
%5 = load %struct.sockaddr*, %struct.sockaddr** %3
%6 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load i64, i64* @AF_INET
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load %struct.sockaddr*, %struct.sockaddr** %3
%13 = bitcast %struct.sockaddr* %12 to %struct.sockaddr_in*
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i8* %11, i8** %14
br label %20
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load %struct.sockaddr*, %struct.sockaddr** %3
%18 = bitcast %struct.sockaddr* %17 to %struct.sockaddr_in6*
%19 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %18, i32 0, i32 0
store i8* %16, i8** %19
br label %20
20: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define void @set_in_port(%struct.sockaddr* nocapture %0, i8* %1) {
%3 = bitcast %struct.sockaddr* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bucketSort(int *);
int /*<<< orphan*/ criaVetorAleatorio(int *);
int /*<<< orphan*/ imprimeVetor(int *);
int /*<<< orphan*/ printf(char *);
int main() {
  int vetor[100000];
  criaVetorAleatorio(vetor);
  printf("Vetor Desordenado:\n");
  imprimeVetor(vetor);
  bucketSort(vetor);
  printf("Vetor Ordenado:\n");
  imprimeVetor(vetor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61a90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x61a90(%rbp),%rdi
call   1060 <criaVetorAleatorio@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x61a90(%rbp),%rdi
call   1050 <imprimeVetor@plt>
lea    -0x61a90(%rbp),%rdi
call   1040 <bucketSort@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x61a90(%rbp),%rdi
call   1050 <imprimeVetor@plt>
xor    %eax,%eax
add    $0x61a90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x61a80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <criaVetorAleatorio@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <imprimeVetor@plt>
mov    %rbx,%rdi
call   1040 <bucketSort@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <imprimeVetor@plt>
xor    %eax,%eax
add    $0x61a80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Vetor Desordenado:\0A\00"
@.str.1 = [17 x i8] c"Vetor Ordenado:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%4 = call i32 @criaVetorAleatorio(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%7 = call i32 @imprimeVetor(i32* %6)
%8 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%9 = call i32 @bucketSort(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [100000 x i32], [100000 x i32]* %2, i64 0, i64 0
%12 = call i32 @imprimeVetor(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Vetor Desordenado:\00"
@str.2 = [16 x i8] c"Vetor Ordenado:\00"
define i32 @main() {
%1 = alloca [100000 x i32]
%2 = bitcast [100000 x i32]* %1 to i8*
%3 = getelementptr inbounds [100000 x i32], [100000 x i32]* %1, i64 0, i64 0
%4 = call i32 @criaVetorAleatorio(i32* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @imprimeVetor(i32* %3)
%7 = call i32 @bucketSort(i32* %3)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @imprimeVetor(i32* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ floor(int);
int log(double);
double sqrt(double);
int fibonacci_index(int F) {
  double y = ((double)F * sqrt(5.0)) + 0.5;
  return (int)floor(log(y) / log(1.618033988749895));
}


x86 assembly (clang, -O0):
<fibonacci_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec3(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,-0x14(%rbp)
movsd  0xe7c(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci_index>:
push   %rbx
cvtsi2sd %edi,%xmm0
mulsd  0xed3(%rip),%xmm0
addsd  0xed3(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0xecc(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
pop    %rbx
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i32 @fibonacci_index(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double @sqrt(double 5.000000e+00)
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double 5.000000e-01)
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 @log(double %8)
%10 = call i32 @log(double 0x3FF9E3779B97F4A8)
%11 = sdiv i32 %9, %10
%12 = call i64 @floor(i32 %11)
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @fibonacci_index(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x4001E3779B97F4A8, double 5.000000e-01)
%4 = tail call i32 @log(double %3)
%5 = tail call i32 @log(double 0x3FF9E3779B97F4A8)
%6 = sdiv i32 %4, %5
%7 = tail call i64 @floor(i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ST7735_OutChar(char);
void ST7735_OutString(char *ptr) {
  while (*ptr) {
    ST7735_OutChar(*ptr);
    ptr = ptr + 1;
  }
}


x86 assembly (clang, -O0):
<ST7735_OutString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <ST7735_OutString+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ST7735_OutChar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ST7735_OutString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST7735_OutString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ST7735_OutString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ST7735_OutChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ST7735_OutString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ST7735_OutString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @ST7735_OutChar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int fputc(int c, FILE *stream) {
  int ret = fwrite(&c, 1, 1, stream);
  return (ret == 1) ? c : EOF;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    114b <fputc+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <fputc+0x47>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     113f <fputc+0x2f>
mov    0x2ea9(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fputc(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 = call i32 @fwrite(i32* %3, i32 1, i32 1, i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* @EOF
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 1, i32 1, i32* %1)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
int test_imm_75uint16_mem(unsigned short *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 117
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}