xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main() {
  char *buf = malloc(10);
  free(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
int remove_milestones(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @remove_milestones() {
ret i32 1
}
double f4_sum_double(double v) { return ((double)(v)); }


x86 assembly (clang, -O0):
<f4_sum_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @f4_sum_double(double returned %0) {
ret double %0
}
void cpu_printflags(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_printflags() {
ret void
}
main() { int ar[] = {[0 ... 9] = 3}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.ar = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *ptr1, *ptr2;
  ptr1 = malloc(sizeof(int));
  *ptr1 = 1234;
  ptr2 = ptr1;
  free(ptr1);
  free(ptr2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x4d2,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x4d2,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 1234, i32* %5
%6 = load i32*, i32** %2
store i32* %6, i32** %3
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 1234, i32* %1
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void server_init(void) {}


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

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

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

LLVM IR (-O2):
define void @server_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ piece(char *, char, char *, int);
char *load_shef_slash_piece(char *destination, char *source, int offset) {
  if (!piece(destination, '/', source, offset))
    return (char *)0;
  return destination;
}


x86 assembly (clang, -O0):
<load_shef_slash_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2f,%esi
call   1030 <piece@plt>
cmp    $0x0,%eax
jne    114e <load_shef_slash_piece+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1156 <load_shef_slash_piece+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_shef_slash_piece>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <piece@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @load_shef_slash_piece(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @piece(i8* %0, i8 signext 47, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* null, i8* %0
ret i8* %6
}
void INT_Excep_RSPI2_SPII2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI2_SPII2() {
ret void
}
/* Variables and functions */
int identity(char);
char tor1(char x) {
  char y = (identity(x) | 1) ? 42 : 43;
  return y;
}


x86 assembly (clang, -O0):
<tor1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
or     $0x1,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor1>:
push   %rax
call   1030 <identity@plt>
mov    $0x2a,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @tor1(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = or i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @tor1(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
ret i8 42
}
/* Variables and functions */
void *calloc(unsigned long, int);
void *emalloc(unsigned long n) { return calloc(n, 1); }


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

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

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

LLVM IR (-O2):
define i8* @emalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void OpenHTML(char *HTMLName) {
  char command[100];
  sprintf(command, "xdg-open %s", HTMLName);
  printf("About to execute %s\n", command);
  system(command);
}


x86 assembly (clang, -O0):
<OpenHTML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenHTML>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"xdg-open %s\00"
@.str.1 = [21 x i8] c"About to execute %s\0A\00"
define void @OpenHTML(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @system(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"xdg-open %s\00"
@.str.1 = [21 x i8] c"About to execute %s\0A\00"
define void @OpenHTML(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt_handler_register(int, void (*)());
void timer_handler_register(void (*handler)(void)) {
  interrupt_handler_register(66, handler);
}


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

x86 assembly (clang, -O2):
<timer_handler_register>:
mov    %rdi,%rsi
mov    $0x42,%edi
jmp    1030 <interrupt_handler_register@plt>

LLVM IR (-O0):
define void @timer_handler_register(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @interrupt_handler_register(i32 66, void (...)* %4)
ret void
}

LLVM IR (-O2):
define void @timer_handler_register(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @interrupt_handler_register(i32 66, void (...)* %2)
ret void
}
/* Variables and functions */
char tolower(char);
char asymbol_2(char t) { return tolower(t); }


x86 assembly (clang, -O0):
<asymbol_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asymbol_2>:
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define signext i8 @asymbol_2(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
ret i8 %2
}
int main(int argc, char **argv) {
  char *p = 0;
  if (argc > 0) {
    p = argv[argc - 1];
  }
  char *a = 0;
  a[0] = *p;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1139 <main+0x39>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O2):
char *cdio_get_default_device_nrg(void) {
  char **drives = cdio_get_devices_nrg();
  char *drive = (drives[0] == ((void *)0)) ? ((void *)0) : strdup(drives[0]);
  cdio_free_device_list(drives);
  return drive;
}


x86 assembly (clang, -O0):
<cdio_get_default_device_nrg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <cdio_get_devices_nrg@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    115e <cdio_get_default_device_nrg+0x2e>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    116e <cdio_get_default_device_nrg+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <cdio_free_device_list@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdio_get_default_device_nrg>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <cdio_get_devices_nrg@plt>
movslq %eax,%rbx
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1151 <cdio_get_default_device_nrg+0x21>
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <cdio_free_device_list@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cdio_get_default_device_nrg() {
%1 = alloca i8**
%2 = alloca i8*
%3 = call i32 (...) @cdio_get_devices_nrg()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8**
store i8** %5, i8*** %1
%6 = load i8**, i8*** %1
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %0
br label %16
11: ; preds = %0
%12 = load i8**, i8*** %1
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i8* @strdup(i8* %14)
br label %16
16: ; preds = %11, %10
%17 = phi i8* [ null, %10 ], [ %15, %11 ]
store i8* %17, i8** %2
%18 = load i8**, i8*** %1
%19 = call i32 (i8**, ...) bitcast (i32 (...)* @cdio_free_device_list to i32 (i8**, ...)*)(i8** %18)
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @cdio_get_default_device_nrg() {
%1 = tail call i32 (...) @cdio_get_devices_nrg()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %0, %6
%9 = phi i8* [ %7, %6 ], [ null, %0 ]
%10 = tail call i32 (i8**, ...) bitcast (i32 (...)* @cdio_free_device_list to i32 (i8**, ...)*)(i8** %3)
ret i8* %9
}
void my_pthread_cleanup_pop(int execute) {
  while (0) {
  };
}


x86 assembly (clang, -O0):
<my_pthread_cleanup_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1116 <my_pthread_cleanup_pop+0x16>
jmp    111b <my_pthread_cleanup_pop+0x1b>
jmp    1107 <my_pthread_cleanup_pop+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @my_pthread_cleanup_pop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %4, %1
br i1 false, label %4, label %5
4: ; preds = %3
br label %3
5: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @my_pthread_cleanup_pop(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int ueld_unblock_signal(int signum) {
  sigset_t set, oset;
  sigemptyset(&set);
  sigaddset(&set, signum);
  return sigprocmask(SIG_UNBLOCK, &set, &oset);
}


x86 assembly (clang, -O0):
<ueld_unblock_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueld_unblock_signal>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define i32 @ueld_unblock_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret i32 %9
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @ueld_unblock_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fdouble(double, double);
void testTortureExecute(void) {
  fdouble(1.0, 2.0);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
call   1030 <fdouble@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
jmp    1030 <fdouble@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @fdouble(double 1.000000e+00, double 2.000000e+00)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @fdouble(double 1.000000e+00, double 2.000000e+00)
ret void
}
int fun408() { return 408; }


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

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

LLVM IR (-O0):
define i32 @fun408() {
ret i32 408
}

LLVM IR (-O2):
define i32 @fun408() {
ret i32 408
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int printwaitn(struct tcb *, int, int /*<<< orphan*/);
int sys_wait4(struct tcb *tcp) { return printwaitn(tcp, 4, 0); }


x86 assembly (clang, -O0):
<sys_wait4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <printwaitn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_wait4>:
mov    $0x4,%esi
xor    %edx,%edx
jmp    1030 <printwaitn@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_wait4(%struct.tcb* %0) {
%2 = tail call i32 @printwaitn(%struct.tcb* %0, i32 4, i32 0)
ret i32 %2
}
void help() {}


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

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

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

LLVM IR (-O2):
define void @help() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ advance_over(char const *, size_t *);
size_t breadth(const char *text) {
  size_t span = 0;
  while (*text != '\0')
    text += advance_over(text, &span);
  return span;
}


x86 assembly (clang, -O0):
<breadth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <breadth+0x46>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <advance_over@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <breadth+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<breadth>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
cmpb   $0x0,(%rdi)
je     114d <breadth+0x3d>
mov    %rdi,%rbx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <advance_over@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1130 <breadth+0x20>
mov    (%rsp),%rax
jmp    114f <breadth+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @breadth(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %0, %1 ]
%8 = call i32 @advance_over(i8* %7, i64* %2)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6
%14 = load i64, i64* %2
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ %14, %13 ], [ 0, %1 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr,
          "ledc [-v] [-c] [-f funcname] [-o file] files\n"
          "  -v            print the version number\n"
          "  -c            only perform checking, do not generate code\n"
          "  -s            declarate image data as static\n"
          "  -f funcname   generate exported function <funcname> (default: "
          "led_load)\n"
          "  -o file       place output in file <file> (default: led.c)\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [329 x i8] c"ledc [-v] [-c] [-f funcname] [-o file] files\0A -v print the version number\0A -c only perform checking, do not generate code\0A -s declarate image data as static\0A -f funcname generate exported function <funcname> (default: led_load)\0A -o file place output in file <file> (default: led.c)\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [329 x i8] c"ledc [-v] [-c] [-f funcname] [-o file] files\0A -v print the version number\0A -c only perform checking, do not generate code\0A -s declarate image data as static\0A -f funcname generate exported function <funcname> (default: led_load)\0A -o file place output in file <file> (default: led.c)\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
float sqrtf(float);
float TH_rsqrtf(float x) { return 1.0f / sqrtf(x); }


x86 assembly (clang, -O0):
<TH_rsqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TH_rsqrtf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <TH_rsqrtf+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <TH_rsqrtf+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @TH_rsqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fdiv float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @TH_rsqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t new_uint64_t(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @new_uint64_t() {
ret i32 0
}
int sfi_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sfi_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello GitHub!\n");
  printf("Test sgit\n");
  printf("Test again\n");
  printf("Test again...\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello GitHub!\0A\00"
@.str.1 = [11 x i8] c"Test sgit\0A\00"
@.str.2 = [12 x i8] c"Test again\0A\00"
@.str.3 = [15 x i8] c"Test again...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello GitHub!\00"
@str.4 = [10 x i8] c"Test sgit\00"
@str.5 = [11 x i8] c"Test again\00"
@str.6 = [14 x i8] c"Test again...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
__attribute__((pure)) unsigned hash_string(const char *str) {
  const unsigned char *p;
  unsigned hash = 2166136261U;
  for (p = (const unsigned char *)str; *p != 0; ++p) {
    hash *= 16777619U;
    hash ^= *p;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114f <hash_string+0x4f>
imul   $0x1000193,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_string+0x27>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movzbl %cl,%ecx
imul   $0x1000193,%eax,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %6, 16777619
%10 = xor i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ -2128831035, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int days(time_t t1, time_t t2) { return (t2 - t1) / 86400; }


x86 assembly (clang, -O0):
<days>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<days>:
sub    %edi,%esi
movslq %esi,%rax
imul   $0xffffffffc22e4507,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @days(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = sdiv i32 %7, 86400
ret i32 %8
}

LLVM IR (-O2):
define i32 @days(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sdiv i32 %3, 86400
ret i32 %4
}
void init_file(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<init_file>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_file>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.init_file = [10 x i8] c"init_file\00"
define void @init_file() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.init_file, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.init_file = [10 x i8] c"init_file\00"
define void @init_file() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.init_file, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_blue_team();
int /*<<< orphan*/ draw_footer();
int /*<<< orphan*/ draw_header();
int /*<<< orphan*/ draw_map();
int /*<<< orphan*/ draw_red_team();
void screen_inicializar() {
  draw_map();
  draw_footer();
  draw_header();
  draw_red_team();
  draw_blue_team();
}


x86 assembly (clang, -O0):
<screen_inicializar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <draw_map@plt>
mov    $0x0,%al
call   1060 <draw_footer@plt>
mov    $0x0,%al
call   1030 <draw_header@plt>
mov    $0x0,%al
call   1050 <draw_red_team@plt>
mov    $0x0,%al
call   1070 <draw_blue_team@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_inicializar>:
push   %rax
xor    %eax,%eax
call   1040 <draw_map@plt>
xor    %eax,%eax
call   1060 <draw_footer@plt>
xor    %eax,%eax
call   1030 <draw_header@plt>
xor    %eax,%eax
call   1050 <draw_red_team@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <draw_blue_team@plt>

LLVM IR (-O0):
define void @screen_inicializar() {
%1 = call i32 (...) @draw_map()
%2 = call i32 (...) @draw_footer()
%3 = call i32 (...) @draw_header()
%4 = call i32 (...) @draw_red_team()
%5 = call i32 (...) @draw_blue_team()
ret void
}

LLVM IR (-O2):
define void @screen_inicializar() {
%1 = tail call i32 (...) @draw_map()
%2 = tail call i32 (...) @draw_footer()
%3 = tail call i32 (...) @draw_header()
%4 = tail call i32 (...) @draw_red_team()
%5 = tail call i32 (...) @draw_blue_team()
ret void
}
/* Variables and functions */
int ns2qvas();
int ns2qvas_(void) { return ns2qvas(); }


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

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

LLVM IR (-O0):
define i32 @ns2qvas_() {
%1 = call i32 (...) @ns2qvas()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ns2qvas_() {
%1 = tail call i32 (...) @ns2qvas()
ret i32 %1
}
copy(from, to) char *from, *to;
{
  register char *rfrom, *rto;
  rfrom = from;
  rto = to;
  while (*rto++ = *rfrom++)
    ;
  return (rto - 1);
}


x86 assembly (clang, -O0):
<copy>:
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
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <copy+0x4b>
jmp    111c <copy+0x1c>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
add    %esi,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @copy(i8* nocapture %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = ptrtoint i8* %5 to i64
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
__attribute__((weak, used)) int _kill(int pid, int sig) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32)* @_kill to i8*)], section "llvm.metadata"
define weak i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EPERM
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32)* @_kill to i8*)], section "llvm.metadata"
define weak i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
int inet_aton(const char *cp, struct in_addr *inp) {
  inp->s_addr = inet_addr(cp);
  return 1;
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rbx
mov    %rsi,%rbx
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in_addr*
store i8* %0, i8** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load i8*, i8** %3
%6 = call i32 @inet_addr(i8* %5)
%7 = load %struct.in_addr*, %struct.in_addr** %4
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %6, i32* %8
ret i32 1
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* nocapture writeonly %1) {
%3 = tail call i32 @inet_addr(i8* %0)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 1
}
void semihost_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @semihost_enable() {
ret void
}
void s5p_cec_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s5p_cec_setname(i8* nocapture %0) {
ret void
}
void lib$insv(int *source, int *position, char *size, int *base) {
  int src = *source;
  int s = *size;
  int pos = *position;
  int src_mask = (1 << s) - 1;
  int dst_mask = 0xffffffff - (src_mask << pos);
  src &= src_mask;
  (*base) &= dst_mask;
  (*base) |= src << pos;
}


x86 assembly (clang, -O0):
<lib$insv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
and    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x20(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib$insv>:
mov    %rcx,%r8
mov    (%rdx),%cl
mov    (%rsi),%dl
mov    $0xffffffff,%esi
shl    %cl,%esi
not    %esi
mov    %esi,%eax
mov    %edx,%ecx
shl    %cl,%eax
and    (%rdi),%esi
not    %eax
shl    %cl,%esi
and    (%r8),%eax
or     %eax,%esi
mov    %esi,(%r8)
ret

LLVM IR (-O0):
define void @"lib$insv"(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i8*, i8** %7
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %10
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
store i32 %20, i32* %11
%21 = load i32, i32* %10
%22 = shl i32 1, %21
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %12
%24 = load i32, i32* %12
%25 = load i32, i32* %11
%26 = shl i32 %24, %25
%27 = sub i32 -1, %26
store i32 %27, i32* %13
%28 = load i32, i32* %12
%29 = load i32, i32* %9
%30 = and i32 %29, %28
store i32 %30, i32* %9
%31 = load i32, i32* %13
%32 = load i32*, i32** %8
%33 = load i32, i32* %32
%34 = and i32 %33, %31
store i32 %34, i32* %32
%35 = load i32, i32* %9
%36 = load i32, i32* %11
%37 = shl i32 %35, %36
%38 = load i32*, i32** %8
%39 = load i32, i32* %38
%40 = or i32 %39, %37
store i32 %40, i32* %38
ret void
}

LLVM IR (-O2):
define void @"lib$insv"(i32* nocapture %0, i32* nocapture %1, i8* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i8, i8* %2
%7 = load i32, i32* %1
%8 = zext i8 %6 to i32
%9 = shl nsw i32 -1, %8
%10 = xor i32 %9, -1
%11 = shl i32 %10, %7
%12 = xor i32 %11, -1
%13 = and i32 %5, %10
%14 = load i32, i32* %3
%15 = and i32 %14, %12
%16 = shl i32 %13, %7
%17 = or i32 %15, %16
store i32 %17, i32* %3
ret void
}
float add(float f1, float f2) { return f1 + f2; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @add(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
int do_819() { return 819; }


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

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

LLVM IR (-O0):
define i32 @do_819() {
ret i32 819
}

LLVM IR (-O2):
define i32 @do_819() {
ret i32 819
}
void heap_swp(unsigned int *dst, unsigned int *src) {
  unsigned int tmp = *src;
  *src = *dst;
  *dst = tmp;
  return;
}


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

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

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

LLVM IR (-O2):
define void @heap_swp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
int hash(const char *key) {
  int temp = 0;
  int i = 0;
  while (key[i] != '\0') {
    temp = ((temp << 4) + key[i]) % 211;
    i++;
  }
  return temp;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <hash+0x58>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    $0xd3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1142 <hash+0x42>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x4,%eax
add    %ecx,%eax
cltq
imul   $0x4da637d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
imul   $0xd3,%ecx,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl nsw i32 %7, 4
%10 = add nsw i32 %9, %8
%11 = srem i32 %10, 211
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}