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

/* Variables and functions */
int /*<<< orphan*/ free(struct dr_connector *);
void free_drc_info(struct dr_connector *drc_list) { free(drc_list); }


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

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

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

LLVM IR (-O2):
%struct.dr_connector = type { i32 }
define void @free_drc_info(%struct.dr_connector* nocapture %0) {
%2 = tail call i32 @free(%struct.dr_connector* %0)
ret void
}
/* Type definitions */
typedef char uint64_t;

/* Variables and functions */
uint64_t mp_set_hex_256(uint64_t a[4], char *hex) {
  a[1] = hex[0] + hex[1] + hex[2] + hex[3];
  return 0;
}


x86 assembly (clang, -O0):
<mp_set_hex_256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_set_hex_256>:
mov    0x1(%rsi),%al
add    (%rsi),%al
add    0x2(%rsi),%al
add    0x3(%rsi),%al
mov    %al,0x1(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @mp_set_hex_256(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %18, %22
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8 %24, i8* %26
ret i8 0
}

LLVM IR (-O2):
define signext i8 @mp_set_hex_256(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = add i8 %5, %3
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = load i8, i8* %7
%9 = add i8 %6, %8
%10 = getelementptr inbounds i8, i8* %1, i64 3
%11 = load i8, i8* %10
%12 = add i8 %9, %11
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %13
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ syntax_error_msg_with_arg(char *, int /*<<< orphan*/ *);
void syntax_error() { syntax_error_msg_with_arg("Syntax error", NULL); }


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

x86 assembly (clang, -O2):
<syntax_error>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <syntax_error_msg_with_arg@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Syntax error\00"
define void @syntax_error() {
%1 = call i32 @syntax_error_msg_with_arg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Syntax error\00"
define void @syntax_error() {
%1 = tail call i32 @syntax_error_msg_with_arg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disable_permissive_pipes();
int /*<<< orphan*/ enable_permissive_pipes();
void set_permissive_pipes(int p) {
  if (p)
    enable_permissive_pipes();
  else
    disable_permissive_pipes();
}


x86 assembly (clang, -O0):
<set_permissive_pipes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <set_permissive_pipes+0x21>
mov    $0x0,%al
call   1040 <enable_permissive_pipes@plt>
jmp    1148 <set_permissive_pipes+0x28>
mov    $0x0,%al
call   1030 <disable_permissive_pipes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_permissive_pipes>:
xor    %eax,%eax
test   %edi,%edi
je     112b <set_permissive_pipes+0xb>
jmp    1040 <enable_permissive_pipes@plt>
jmp    1030 <disable_permissive_pipes@plt>

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

LLVM IR (-O2):
define void @set_permissive_pipes(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @enable_permissive_pipes()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @disable_permissive_pipes()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *cmd) {
  fprintf(stderr, "Usage: \t%s \"A test string as argument\" \"A substring\"\n",
          cmd);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: \09%s \22A test string as argument\22 \22A substring\22\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: \09%s \22A test string as argument\22 \22A substring\22\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void GpsMcuInit(void) {}


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

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

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

LLVM IR (-O2):
define void @GpsMcuInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_ver1_func2(void) { printf("A - version 1 func2\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"A - version 1 func2\00"
define void @iface1_ver1_func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void adp_ind_cycle() {}


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

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

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

LLVM IR (-O2):
define void @adp_ind_cycle() {
ret void
}
/* Variables and functions */
double THRandom_logNormal(double, double);
double Random_logNormal(double mean, double stdv) {
  return THRandom_logNormal(mean, stdv);
}


x86 assembly (clang, -O0):
<Random_logNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <THRandom_logNormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random_logNormal>:
jmp    1030 <THRandom_logNormal@plt>

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

LLVM IR (-O2):
define double @Random_logNormal(double %0, double %1) {
%3 = tail call double @THRandom_logNormal(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int /*<<< orphan*/);
int conn_chk_respmagic(char *str) {
  if (!strncasecmp("rpcresp", str, strlen("rpcresp"))) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<conn_chk_respmagic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb3(%rip),%rdi
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1167 <conn_chk_respmagic+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <conn_chk_respmagic+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conn_chk_respmagic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"rpcresp\00"
define i32 @conn_chk_respmagic(i8* nocapture %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strncasecmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x5b() {
  Assert_real((isodigit(91) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              460, ("isodigit should be 0 for ["));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1cc,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for [\00"
define void @t_isodigit_0x5b() {
%1 = call i64 @isodigit(i32 91)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for [\00"
define void @t_isodigit_0x5b() {
%1 = tail call i64 @isodigit(i32 91)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from subdir2/prog2.c\n");
  func2();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello from subdir2/prog2.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Hello from subdir2/prog2.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func2()
ret i32 0
}
/* Variables and functions */
bool is_valid_ipv6(char value[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @is_valid_ipv6(i8* nocapture readnone %0) {
ret i32 0
}
int is_numeric(int ch) {
  int i;
  for (i = 0; i < 9; ++i) {
    if (ch == i) {
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1143 <is_numeric+0x43>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1130 <is_numeric+0x30>
movl   $0x1,-0x4(%rbp)
jmp    114a <is_numeric+0x4a>
jmp    1135 <is_numeric+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_numeric+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
xor    %eax,%eax
cmp    $0x9,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i32 %0) {
%2 = icmp ult i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *p = malloc(n);
  if (p == NULL)
    error(EXIT_FAILURE, errno, "xmalloc failed");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <xmalloc+0x42>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xmalloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"xmalloc failed\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i32, i32* @errno
%11 = call i32 @error(i32 %9, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"xmalloc failed\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret i8* %2
}
int strc2p(char *pstr, char *cstr) {
  int i;
  for (i = 0; cstr[i] != 0; i++)
    pstr[i + 1] = cstr[i];
  pstr[0] = i;
  return i;
}


x86 assembly (clang, -O0):
<strc2p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <strc2p+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strc2p+0x13>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strc2p>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1121 <strc2p+0x21>
nopl   0x0(%rax,%rax,1)
mov    %cl,0x1(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strc2p+0x10>
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define i32 @strc2p(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 = %25, %2
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
store i8 %19, i8* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
%29 = load i32, i32* %5
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 0
store i8 %30, i8* %32
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
define i32 @strc2p(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %7, i8* %9
%10 = getelementptr inbounds i8, i8* %1, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %8 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = trunc i32 %16 to i8
store i8 %17, i8* %0
ret i32 %16
}
unsigned invert(unsigned x, int p, int n) {
  unsigned mask = (~0 << p) | ~(~0 << (p - n));
  return x ^ (~mask);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
sub    %edx,%ecx
not    %eax
shr    %cl,%eax
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(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* %5
%9 = shl i32 -1, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = shl i32 -1, %12
%14 = xor i32 %13, -1
%15 = or i32 %9, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = xor i32 %17, -1
%19 = xor i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %1
%5 = sub nsw i32 %1, %2
%6 = shl nsw i32 -1, %5
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = xor i32 %8, %0
ret i32 %9
}
int nfsd4_init_pnfs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nfsd4_init_pnfs() {
ret i32 0
}
void bluetooth_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bluetooth_init() {
ret void
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
int /*<<< orphan*/ gfx_pci_config_write(int, unsigned long);
int sc1200_disable_softvga(void) {
  unsigned long reg_val;
  reg_val = gfx_pci_config_read(0x80009444);
  reg_val |= 0x1;
  gfx_pci_config_write(0x80009444, reg_val);
  reg_val = gfx_pci_config_read(0x80009444);
  if ((reg_val & 0x1) == 0x1)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x80009444,%edi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    117c <sc1200_disable_softvga+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <sc1200_disable_softvga+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
or     $0x1,%rax
mov    $0x80009444,%edi
mov    %rax,%rsi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
and    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sc1200_disable_softvga() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%2 = or i64 %1, 1
%3 = tail call i32 @gfx_pci_config_write(i32 -2147445692, i64 %2)
%4 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
int SQLITE_IOERR_DELETE;
int SQLITE_OK;
int /*<<< orphan*/ printfHelper(char *, char const *);
int wrap_Delete(sqlite3_vfs *pVfs, const char *zPath, int dirSync) {
  int rc = 0;
  printfHelper("wrap_Delete %s\n", zPath);
  return (rc == 0 ? SQLITE_OK : SQLITE_IOERR_DELETE);
}


x86 assembly (clang, -O0):
<wrap_Delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printfHelper@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1155 <wrap_Delete+0x45>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1161 <wrap_Delete+0x51>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_Delete>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printfHelper@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"wrap_Delete %s\0A\00"
@SQLITE_OK = global i32 0
@SQLITE_IOERR_DELETE = global i32 0
define i32 @wrap_Delete(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8*, i8** %5
%9 = call i32 @printfHelper(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* @SQLITE_OK
br label %16
14: ; preds = %3
%15 = load i32, i32* @SQLITE_IOERR_DELETE
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"wrap_Delete %s\0A\00"
@SQLITE_OK = global i32 0
@SQLITE_IOERR_DELETE = global i32 0
define i32 @wrap_Delete(i32* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @printfHelper(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i32, i32* @SQLITE_OK
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sieve_eratosthenes(int, int *);
int main() {
  int np;
  sieve_eratosthenes(100, &np);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
lea    -0x8(%rbp),%rsi
call   1030 <sieve_eratosthenes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x64,%edi
call   1030 <sieve_eratosthenes@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sieve_eratosthenes(i32 100, i32* %1)
ret i32 0
}
int next3_acl_chmod(struct inode *inode) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @next3_acl_chmod(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @next3_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ server();
int main() {
  server();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <server@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <server@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @server()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void clar_print_init(int test_count, int suite_count, const char *suite_names) {
  (void)test_count;
  printf("Loaded %d suites: %s\n", (int)suite_count, suite_names);
  printf("Started\n");
}


x86 assembly (clang, -O0):
<clar_print_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clar_print_init>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"Loaded %d suites: %s\0A\00"
@str = [8 x i8] c"Started\00"
define void @clar_print_init(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void RTDbgModLineCount(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModLineCount() {
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double TimeSpecToSeconds(struct timespec *ts) {
  return (double)ts->tv_sec + (double)ts->tv_nsec / 1000000000.0;
}


x86 assembly (clang, -O0):
<TimeSpecToSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeSpecToSeconds>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @TimeSpecToSeconds(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @TimeSpecToSeconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+09
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ glDrawElements(int, int, int, int /*<<< orphan*/);
void render_quad() { glDrawElements(0x0004, 6, 0x1403, 0); }


x86 assembly (clang, -O0):
<render_quad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x6,%esi
mov    $0x1403,%edx
xor    %ecx,%ecx
call   1030 <glDrawElements@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_quad>:
mov    $0x4,%edi
mov    $0x6,%esi
mov    $0x1403,%edx
xor    %ecx,%ecx
jmp    1030 <glDrawElements@plt>

LLVM IR (-O0):
define void @render_quad() {
%1 = call i32 @glDrawElements(i32 4, i32 6, i32 5123, i32 0)
ret void
}

LLVM IR (-O2):
define void @render_quad() {
%1 = tail call i32 @glDrawElements(i32 4, i32 6, i32 5123, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f10(long j) {
  if ((j & ((1UL << (10)) - 1)) >= ((1UL << ((10) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3ff,%rax
cmp    $0x202,%rax
jb     1139 <f10+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
and    $0x3fe,%edi
cmp    $0x202,%edi
jae    111f <f10+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f10(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1023
%5 = icmp uge i64 %4, 514
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f10(i64 %0) {
%2 = and i64 %0, 1022
%3 = icmp ugt i64 %2, 513
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tst_module_exists_(void (*)(), char const *, char **);
void tst_module_exists(void(cleanup_fn)(void), const char *mod_name,
                       char **mod_path) {
  tst_module_exists_(cleanup_fn, mod_name, mod_path);
}


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

x86 assembly (clang, -O2):
<tst_module_exists>:
jmp    1030 <tst_module_exists_@plt>

LLVM IR (-O0):
define void @tst_module_exists(void ()* %0, i8* %1, i8** %2) {
%4 = alloca void ()*
%5 = alloca i8*
%6 = alloca i8**
store void ()* %0, void ()** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load void ()*, void ()** %4
%8 = bitcast void ()* %7 to void (...)*
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = call i32 @tst_module_exists_(void (...)* %8, i8* %9, i8** %10)
ret void
}

LLVM IR (-O2):
define void @tst_module_exists(void ()* %0, i8* %1, i8** %2) {
%4 = bitcast void ()* %0 to void (...)*
%5 = tail call i32 @tst_module_exists_(void (...)* %4, i8* %1, i8** %2)
ret void
}
/* Type definitions */
struct linked_list_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct linked_list_data *);
void linked_list_cleanup_task(void *group_data, void *task_data) {
  struct linked_list_data *data = (struct linked_list_data *)task_data;
  free(data);
}


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

x86 assembly (clang, -O2):
<linked_list_cleanup_task>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.linked_list_data = type { i32 }
define void @linked_list_cleanup_task(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.linked_list_data*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.linked_list_data*
store %struct.linked_list_data* %7, %struct.linked_list_data** %5
%8 = load %struct.linked_list_data*, %struct.linked_list_data** %5
%9 = call i32 @free(%struct.linked_list_data* %8)
ret void
}

LLVM IR (-O2):
%struct.linked_list_data = type { i32 }
define void @linked_list_cleanup_task(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to %struct.linked_list_data*
%4 = tail call i32 @free(%struct.linked_list_data* %3)
ret void
}
int letsgo_get_y(int p) { return p & 31; }


x86 assembly (clang, -O0):
<letsgo_get_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letsgo_get_y>:
mov    %edi,%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @letsgo_get_y(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int send_message(int client, char *message) {
  if (write(client, message, strlen(message)) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1169 <send_message+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <send_message+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @send_message(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
ret i32 %6
}
unsigned long strlen(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("dumpdfs - Dump the contents of a Dragon FS\n\n");
  printf("Usage:\n");
  printf("   dumpdfs -l file.dfs -- List contents\n");
  printf("   dumpdfs -e file.dfs file -- Extract single file to stdout\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"dumpdfs - Dump the contents of a Dragon FS\0A\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [41 x i8] c" dumpdfs -l file.dfs -- List contents\0A\00"
@.str.3 = [62 x i8] c" dumpdfs -e file.dfs file -- Extract single file to stdout\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"dumpdfs - Dump the contents of a Dragon FS\0A\00"
@str.4 = [7 x i8] c"Usage:\00"
@str.5 = [40 x i8] c" dumpdfs -l file.dfs -- List contents\00"
@str.6 = [61 x i8] c" dumpdfs -e file.dfs file -- Extract single file to stdout\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.6, i64 0, i64 0))
ret void
}
void hfi1_dbg_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hfi1_dbg_init() {
ret void
}
/* Variables and functions */
char *c();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *str = c();
  printf("%s\n", str);
  free(str);
  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)
mov    $0x0,%al
call   1050 <c@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <c@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @c()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
__attribute__((__visibility__("hidden"))) float __math_check_uflowf(float y) {
  return y == 0.0f ? (y) : y;
}


x86 assembly (clang, -O0):
<__math_check_uflowf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112f <__math_check_uflowf+0x2f>
jp     112f <__math_check_uflowf+0x2f>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1139 <__math_check_uflowf+0x39>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define hidden float @__math_check_uflowf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float, float* %2
br label %9
7: ; preds = %1
%8 = load float, float* %2
br label %9
9: ; preds = %7, %5
%10 = phi float [ %6, %5 ], [ %8, %7 ]
ret float %10
}

LLVM IR (-O2):
define hidden float @__math_check_uflowf(float returned %0) {
ret float %0
}