xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
size_t get_size(FILE *file) {
  fseek(file, 0, SEEK_END);
  int size = ftell(file);
  fseek(file, 0, SEEK_SET);
  return (size_t)size;
}


x86 assembly (clang, -O0):
<get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
movslq %ebp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
%7 = sext i32 %4 to i64
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int engine_free_util(int /*<<< orphan*/ *, int);
int ENGINE_free(ENGINE *e) { return engine_free_util(e, 1); }


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

x86 assembly (clang, -O2):
<ENGINE_free>:
mov    $0x1,%esi
jmp    1030 <engine_free_util@plt>

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

LLVM IR (-O2):
define i32 @ENGINE_free(i32* %0) {
%2 = tail call i32 @engine_free_util(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nested() { printf("Parentheses/braces are nested properly.\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Parentheses/braces are nested properly.\0A\00"
define void @nested() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Parentheses/braces are nested properly.\00"
define void @nested() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int d_strcasecmp(const char *s1, const char *s2) { return strcasecmp(s1, s2); }


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

x86 assembly (clang, -O2):
<d_strcasecmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @d_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
int security_module_initialize(struct module *mod_user) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define i32 @security_module_initialize(%struct.module* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int usleep(unsigned int);
int metal_sleep_usec(unsigned int usec) { return usleep(usec); }


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

x86 assembly (clang, -O2):
<metal_sleep_usec>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define i32 @metal_sleep_usec(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_ft(int akm) {
  return !!(akm & (BIT(6) | BIT(5) | BIT(24) | BIT(11) | BIT(20) | BIT(21)));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_ft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x5,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x14,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x15,%edi
call   1030 <BIT@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_ft>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x18,%edi
call   1030 <BIT@plt>
mov    %eax,%r15d
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
or     %r15d,%ebp
or     %ebx,%ebp
mov    $0x14,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
mov    $0x15,%edi
call   1030 <BIT@plt>
or     %ebx,%eax
or     %ebp,%eax
xor    %ecx,%ecx
test   %r14d,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_ft(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 6)
%5 = call i32 @BIT(i32 5)
%6 = or i32 %4, %5
%7 = call i32 @BIT(i32 24)
%8 = or i32 %6, %7
%9 = call i32 @BIT(i32 11)
%10 = or i32 %8, %9
%11 = call i32 @BIT(i32 20)
%12 = or i32 %10, %11
%13 = call i32 @BIT(i32 21)
%14 = or i32 %12, %13
%15 = and i32 %3, %14
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_ft(i32 %0) {
%2 = tail call i32 @BIT(i32 6)
%3 = tail call i32 @BIT(i32 5)
%4 = or i32 %3, %2
%5 = tail call i32 @BIT(i32 24)
%6 = or i32 %4, %5
%7 = tail call i32 @BIT(i32 11)
%8 = or i32 %6, %7
%9 = tail call i32 @BIT(i32 20)
%10 = or i32 %8, %9
%11 = tail call i32 @BIT(i32 21)
%12 = or i32 %10, %11
%13 = and i32 %12, %0
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ nbYear(int, int, int, int);
int main() { nbYear(1000, 2, 50, 1200); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
mov    $0x2,%esi
mov    $0x32,%edx
mov    $0x4b0,%ecx
call   1030 <nbYear@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
mov    $0x2,%esi
mov    $0x32,%edx
mov    $0x4b0,%ecx
call   1030 <nbYear@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @nbYear(i32 1000, i32 2, i32 50, i32 1200)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nbYear(i32 1000, i32 2, i32 50, i32 1200)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_queue(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_queue() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _start();
int main(int argc, char *argv[]) {
  _start();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @_start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @_start()
ret i32 0
}
/* Variables and functions */
char *dlerror(void) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlerror() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ form();
int /*<<< orphan*/ getsym();
void programme(void) {
  ;
  getsym();
  form();
  ;
}


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

x86 assembly (clang, -O2):
<programme>:
push   %rax
xor    %eax,%eax
call   1040 <getsym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <form@plt>

LLVM IR (-O0):
define void @programme() {
%1 = call i32 (...) @getsym()
%2 = call i32 (...) @form()
ret void
}

LLVM IR (-O2):
define void @programme() {
%1 = tail call i32 (...) @getsym()
%2 = tail call i32 (...) @form()
ret void
}
void gdk_display_manager_set_default_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_manager_set_default_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OptionsProc();
void DoGeneral(int n) { OptionsProc(); }


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

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

LLVM IR (-O0):
define void @DoGeneral(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @OptionsProc()
ret void
}

LLVM IR (-O2):
define void @DoGeneral(i32 %0) {
%2 = tail call i32 (...) @OptionsProc()
ret void
}
void reverse(char *begin, char *end) {
  for (char *l = begin, *r = end - 1; l < r; ++l, --r) {
    char tmp = *l;
    *l = *r;
    *r = tmp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1169 <reverse+0x69>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1120 <reverse+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jbe    112c <reverse+0x2c>
add    $0x1,%rdi
nopl   (%rax)
movzbl -0x1(%rdi),%eax
movzbl (%rsi),%ecx
mov    %cl,-0x1(%rdi)
mov    %al,(%rsi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = icmp ugt i8* %3, %0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i8* [ %12, %6 ], [ %3, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
store i8 %10, i8* %8
store i8 %9, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = getelementptr inbounds i8, i8* %7, i64 -1
%13 = icmp ult i8* %11, %12
br i1 %13, label %6, label %5
}
void md5_write_hexnumber(char *outstr, unsigned x) {
  const char *dict = "0123456789abcdef";
  outstr[0] = dict[(x / 16) % 16];
  outstr[1] = dict[x % 16];
}


x86 assembly (clang, -O0):
<md5_write_hexnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_write_hexnumber>:
mov    %esi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xef1(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rdi)
and    $0xf,%esi
mov    (%rsi,%rcx,1),%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @md5_write_hexnumber(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* %4
%8 = udiv i32 %7, 16
%9 = urem i32 %8, 16
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = urem i32 %16, 16
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @md5_write_hexnumber(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 4
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %0
%8 = and i32 %1, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sys_exit(int /*<<< orphan*/);
int /*<<< orphan*/ main();
void start(void) { __sys_exit(main()); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <__sys_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
xor    %eax,%eax
call   1030 <main@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <__sys_exit@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 (...) @main()
%2 = call i32 @__sys_exit(i32 %1)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 (...) @main()
%2 = tail call i32 @__sys_exit(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short const, unsigned char);
scalar_t__ serial_is_transmit_empty(unsigned short const);
void serial_write_char(unsigned char a, const unsigned short com) {
  while (serial_is_transmit_empty(com) == 0)
    ;
  outb(com, a);
}


x86 assembly (clang, -O0):
<serial_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%edi
call   1030 <serial_is_transmit_empty@plt>
cmp    $0x0,%rax
jne    114d <serial_write_char+0x2d>
jmp    1135 <serial_write_char+0x15>
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
movzbl -0x1(%rbp),%esi
call   1040 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movzwl %si,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <serial_is_transmit_empty@plt>
test   %rax,%rax
je     1130 <serial_write_char+0x10>
movzbl %bl,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outb@plt>

LLVM IR (-O0):
define void @serial_write_char(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
br label %5
5: ; preds = %9, %2
%6 = load i16, i16* %4
%7 = call i64 @serial_is_transmit_empty(i16 zeroext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i16, i16* %4
%12 = load i8, i8* %3
%13 = call i32 @outb(i16 zeroext %11, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @serial_write_char(i8 zeroext %0, i16 zeroext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @serial_is_transmit_empty(i16 zeroext %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i32 @outb(i16 zeroext %1, i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_power_of_two(uint32_t n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int ENXIO;
int pm8921_bms_dump_all(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_bms_dump_all>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_dump_all>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_bms_dump_all() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_bms_dump_all() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
void __attribute__((weak)) EXTI11_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI11_Callback() {
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, char *);
void mb_socket_name(char *buffer, size_t length) {
  const char *dir = getenv("LXK_RUNTIME_DIR");
  if (!dir)
    dir = ".";
  snprintf(buffer, length, "%s/%s", dir, "membroker");
}


x86 assembly (clang, -O0):
<mb_socket_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <mb_socket_name+0x36>
lea    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xea9(%rip),%rdx
lea    0xea8(%rip),%r8
call   1040 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_socket_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xed0(%rip),%rcx
cmovne %rax,%rcx
lea    0xec7(%rip),%rdx
lea    0xec6(%rip),%r8
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"LXK_RUNTIME_DIR\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [6 x i8] c"%s/%s\00"
@.str.3 = [10 x i8] c"membroker\00"
define void @mb_socket_name(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %10
10: ; preds = %9, %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = load i8*, i8** %5
%14 = call i32 @snprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"LXK_RUNTIME_DIR\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [6 x i8] c"%s/%s\00"
@.str.3 = [10 x i8] c"membroker\00"
define void @mb_socket_name(i8* %0, i64 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %3
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x06() {
  Assert_real((islower(6) == 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_islower.c",
              35, ("islower should be 0 for 0x06"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x06>:
push   %rax
mov    $0x6,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x06\00"
define void @t_islower_0x06() {
%1 = tail call i64 @islower(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int hash(unsigned char *a) { return ((a[0] * 7 + a[1]) * 7 + a[2]) % 509; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
imul   $0x7,%eax,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
imul   $0x7,%eax,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    $0x1fd,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movzbl (%rdi),%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
movzbl 0x1(%rdi),%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
movzbl 0x2(%rdi),%eax
add    %ecx,%eax
movzwl %ax,%ecx
imul   $0x183,%ecx,%ecx
shr    $0x10,%ecx
mov    %eax,%edx
sub    %ecx,%edx
movzwl %dx,%edx
shr    %edx
add    %ecx,%edx
movzbl %dh,%ecx
imul   $0x1fd,%ecx,%ecx
sub    %ecx,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
%13 = mul nsw i32 %12, 7
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = srem i32 %18, 509
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = mul nuw nsw i16 %3, 7
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = add nuw nsw i16 %4, %7
%9 = mul nuw nsw i16 %8, 7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = add nuw nsw i16 %9, %12
%14 = urem i16 %13, 509
%15 = zext i16 %14 to i32
ret i32 %15
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ PASS(char *);
int foo();
int main() {
  if (foo() == 10)
    PASS("non-lazy-weak");
  else
    FAIL("non-lazy-weak");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0xa,%eax
jne    1160 <main+0x30>
lea    0xeaa(%rip),%rdi
call   1040 <PASS@plt>
jmp    116c <main+0x3c>
lea    0xe99(%rip),%rdi
call   1050 <FAIL@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
lea    0xec1(%rip),%rdi
cmp    $0xa,%eax
jne    114b <main+0x1b>
call   1040 <PASS@plt>
jmp    1150 <main+0x20>
call   1050 <FAIL@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"non-lazy-weak\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp eq i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @PASS(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @FAIL(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"non-lazy-weak\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 10
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @PASS(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @FAIL(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
double cos(double);
double acos(double x) { return -cos(x); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
call   1030 <cos@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = fneg double %4
ret double %5
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @cos(double %0)
%3 = fneg double %2
ret double %3
}
double normal1(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<normal1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal1>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @normal1(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 @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @normal1(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
void UI_get_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get_ex_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_bit(int, void *);
void *mb_correct_addr_and_bit(int *, void *);
void mb_clear_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  clear_bit(bit, addr);
}


x86 assembly (clang, -O0):
<mb_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_clear_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1040 <clear_bit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mb_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %5)
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @clear_bit(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @mb_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @clear_bit(i32 %5, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ svz_log(int /*<<< orphan*/, char *);
void *svz_realloc_func(void *, size_t);
void *svz_prealloc(void *ptr, size_t size) {
  void *dst = svz_realloc_func(ptr, size);
  if (dst == NULL) {
    svz_log(0, "realloc: virtual memory exhausted\n");
    exit(1);
  }
  return dst;
}


x86 assembly (clang, -O0):
<svz_prealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <svz_realloc_func@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1174 <svz_prealloc+0x44>
xor    %edi,%edi
lea    0xe9b(%rip),%rsi
call   1050 <svz_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_prealloc>:
push   %rax
call   1030 <svz_realloc_func@plt>
test   %rax,%rax
je     113d <svz_prealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rsi
xor    %edi,%edi
call   1050 <svz_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"realloc: virtual memory exhausted\0A\00"
define i8* @svz_prealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @svz_realloc_func(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @svz_log(i32 0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [35 x i8] c"realloc: virtual memory exhausted\0A\00"
define i8* @svz_prealloc(i8* %0, i64 %1) {
%3 = tail call i8* @svz_realloc_func(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @svz_log(i32 0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int gcd_get_result(unsigned int *val) {
  return sys_call(0x07, 0, (unsigned int)val, 0, 0);
}


x86 assembly (clang, -O0):
<gcd_get_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edx
mov    $0x7,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_get_result>:
mov    %rdi,%rdx
mov    $0x7,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @gcd_get_result(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i32
%5 = call i32 @sys_call(i32 7, i32 0, i32 %4, i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @gcd_get_result(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @sys_call(i32 7, i32 0, i32 %3, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int close(int);
int cwx_socket_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<cwx_socket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @cwx_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int get16(unsigned char *);
int /*<<< orphan*/ lprintf(int, char *, int);
int decode_ambiguity(unsigned char *element, int element_len) {
  int ambiguity;
  ambiguity = get16(element);
  lprintf(14, "Position +/- %d meters\r\n", ambiguity);
  return 0;
}


x86 assembly (clang, -O0):
<decode_ambiguity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get16@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    $0xe,%edi
lea    0xeb6(%rip),%rsi
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_ambiguity>:
push   %rax
call   1030 <get16@plt>
lea    0xed3(%rip),%rsi
mov    $0xe,%edi
mov    %eax,%edx
call   1040 <lprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Position +/- %d meters\0D\0A\00"
define i32 @decode_ambiguity(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @get16(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = call i32 @lprintf(i32 14, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Position +/- %d meters\0D\0A\00"
define i32 @decode_ambiguity(i8* %0, i32 %1) {
%3 = tail call i32 @get16(i8* %0)
%4 = tail call i32 @lprintf(i32 14, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned int);
void print_item(const char *name, unsigned data) {
  printf("%s\t%u\n", name, data);
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09%u\0A\00"
define void @print_item(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void wpa_supplicant_mesh_add_scan_ie(struct wpa_supplicant *wpa_s,
                                     struct wpabuf **extra_ie) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpabuf = type opaque
define void @wpa_supplicant_mesh_add_scan_ie(%struct.wpa_supplicant* %0, %struct.wpabuf** %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpabuf**
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpabuf** %1, %struct.wpabuf*** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpabuf = type opaque
define void @wpa_supplicant_mesh_add_scan_ie(%struct.wpa_supplicant* nocapture %0, %struct.wpabuf** nocapture %1) {
ret void
}
/* Variables and functions */
int format_number_sigsafe(unsigned long, char *, int, int);
int format_dec_number_sigsafe(unsigned long x, char *buf, int buf_len) {
  return format_number_sigsafe(x, buf, buf_len, 10);
}


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

x86 assembly (clang, -O2):
<format_dec_number_sigsafe>:
mov    $0xa,%ecx
jmp    1030 <format_number_sigsafe@plt>

LLVM IR (-O0):
define i32 @format_dec_number_sigsafe(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @format_number_sigsafe(i64 %7, i8* %8, i32 %9, i32 10)
ret i32 %10
}

LLVM IR (-O2):
define i32 @format_dec_number_sigsafe(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 @format_number_sigsafe(i64 %0, i8* %1, i32 %2, i32 10)
ret i32 %4
}
unsigned multiply(unsigned a, unsigned b) { return a * b; }


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

x86 assembly (clang, -O2):
<multiply>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ default_line_gwt();
int /*<<< orphan*/ rect1(double, double, double, double);
int /*<<< orphan*/ set_line_gwt(double, double, int);
void rect(double x1, double y1, double x2, double y2, double g, double w,
          int it) {
  set_line_gwt(g, w, it);
  rect1(x1, y1, x2, y2);
  default_line_gwt();
  return;
}


x86 assembly (clang, -O0):
<rect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %edi,-0x34(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x34(%rbp),%edi
call   1030 <set_line_gwt@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1040 <rect1@plt>
mov    $0x0,%al
call   1050 <default_line_gwt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
call   1030 <set_line_gwt@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1040 <rect1@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1050 <default_line_gwt@plt>

LLVM IR (-O0):
define void @rect(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store i32 %6, i32* %14
%15 = load double, double* %12
%16 = load double, double* %13
%17 = load i32, i32* %14
%18 = call i32 @set_line_gwt(double %15, double %16, i32 %17)
%19 = load double, double* %8
%20 = load double, double* %9
%21 = load double, double* %10
%22 = load double, double* %11
%23 = call i32 @rect1(double %19, double %20, double %21, double %22)
%24 = call i32 (...) @default_line_gwt()
ret void
}

LLVM IR (-O2):
define void @rect(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = tail call i32 @set_line_gwt(double %4, double %5, i32 %6)
%9 = tail call i32 @rect1(double %0, double %1, double %2, double %3)
%10 = tail call i32 (...) @default_line_gwt()
ret void
}
int main() {
  int x, *p, **pp;
  x = 0;
  p = &x;
  pp = &p;
  return **pp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fn19(void) {
  static const int e = 6;
  return e;
}


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

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

LLVM IR (-O0):
@fn19.e = internal constant i32 6
define i32 @fn19() {
ret i32 6
}

LLVM IR (-O2):
define i32 @fn19() {
ret i32 6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int write_xim_header(FILE *fp, int w, int h) {
  fputc(w, fp);
  fputc(h, fp);
  return 0;
}


x86 assembly (clang, -O0):
<write_xim_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write_xim_header(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fputc(i32 %1, i32* %0)
%5 = tail call i32 @fputc(i32 %2, i32* %0)
ret i32 0
}