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

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_it;
void PKCS12_free(PKCS12 *a) { ASN1_item_free((ASN1_VALUE *)a, &PKCS12_it); }


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

x86 assembly (clang, -O2):
<PKCS12_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PKCS12_it = global i32 0
define void @PKCS12_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PKCS12_it)
ret void
}

LLVM IR (-O2):
@PKCS12_it = global i32 0
define void @PKCS12_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PKCS12_it)
ret void
}
diag(m) {
  printf("%s\n", m);
  iot();
}


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

x86 assembly (clang, -O2):
<diag>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <iot@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @diag(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @iot()
ret i32 undef
}
void os_restart_game(int stage) {}


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

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

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

LLVM IR (-O2):
define void @os_restart_game(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void usage(void) {
  fprintf(stderr, "Usage: mod-extract [-v] <modulefile> <extractfile>\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: mod-extract [-v] <modulefile> <extractfile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: mod-extract [-v] <modulefile> <extractfile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
void foo539() {}


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

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

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

LLVM IR (-O2):
define void @foo539() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
void *zmalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr)
    exit(EXIT_FAILURE);
  return ptr;
}


x86 assembly (clang, -O0):
<zmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <zmalloc+0x32>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <zmalloc+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @zmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @zmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret i8* %2
}
int ld_bun_cr1(long double a1) { return (__builtin_isunordered(100, a1)); }


x86 assembly (clang, -O0):
<ld_bun_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fucomip %st(0),%st
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_cr1>:
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(0),%st
setp   %al
ret

LLVM IR (-O0):
define i32 @ld_bun_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp uno x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_bun_cr1(x86_fp80 %0) {
%2 = fcmp uno x86_fp80 %0, 0xK00000000000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *julian_to_hhmm(double);
char *julian_hhmm_string(double julian) { return julian_to_hhmm(julian); }


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

x86 assembly (clang, -O2):
<julian_hhmm_string>:
jmp    1030 <julian_to_hhmm@plt>

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

LLVM IR (-O2):
define i8* @julian_hhmm_string(double %0) {
%2 = tail call i8* @julian_to_hhmm(double %0)
ret i8* %2
}
f(x, y) {
  if (x % y != 0)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1133 <f+0x23>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    111a <f+0xa>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = srem i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
unreachable
11: ; preds = %2
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @abort()
unreachable
6: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() {
  f(5);
  f(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 5)
%2 = call i32 @f(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = tail call i32 @f(i32 0)
ret i32 0
}
/* Variables and functions */
double atof(char *);
int numcmp(char *s1, char *s2, ...) {
  double v1, v2;
  v1 = atof(s1);
  v2 = atof(s2);
  if (v1 < v2)
    return -1;
  else if (v1 > v2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <numcmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <numcmp+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1, ...) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ restore(int /*<<< orphan*/);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void sigchld_handler(int signum) {
  int status;
  pid_t pid;
  while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
    restore(pid);
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    115b <sigchld_handler+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <restore@plt>
jmp    112b <sigchld_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    116b <sigchld_handler+0x4b>
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <restore@plt>
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1150 <sigchld_handler+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %3, i32 %6)
store i32 %7, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %4
%11 = call i32 @restore(i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @restore(i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x1d() {
  Assert_real((isalnum(29) == 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_isalnum.c",
              150, ("isalnum should be 0 for 0x1d"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x96,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1d\00"
define void @t_isalnum_0x1d() {
%1 = call i64 @isalnum(i32 29)
%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 150, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1d\00"
define void @t_isalnum_0x1d() {
%1 = tail call i64 @isalnum(i32 29)
%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 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void sys_exit(int code) {
  __asm__ volatile("int $0x80" : : "a"((long)0x01), "b"((long)code));
}


x86 assembly (clang, -O0):
<sys_exit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x1,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_exit>:
push   %rbx
movslq %edi,%rbx
mov    $0x1,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sys_exit(i32 %0) {
%2 = sext i32 %0 to i64
tail call void asm sideeffect "int $$0x80", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
off_t lseek(int fd, off_t offset, int whence) {
  errno = ESPIPE;
  return ((off_t)-1);
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @lseek(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* @ESPIPE
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ESPIPE
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int transfer_ext(uint8_t data, uint8_t *recv) { return 0; }


x86 assembly (clang, -O0):
<transfer_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @transfer_ext(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int PAPI_num_hwctrs();
void papif_num_hwctrs__(int *num) { *num = PAPI_num_hwctrs(); }


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

x86 assembly (clang, -O2):
<papif_num_hwctrs__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_num_hwctrs@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_num_hwctrs__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_num_hwctrs()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(int);
int main(int argc, char **argv) {
  reverse(1534236469);
  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    $0x5b729735,%edi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5b729735,%edi
call   1030 <reverse@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 @reverse(i32 1534236469)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @reverse(i32 1534236469)
ret i32 0
}
void gdk_line_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_line_style_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, float *);
float c_read_float() {
  float f;
  scanf("%f", &f);
  return f;
}


x86 assembly (clang, -O0):
<c_read_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_read_float>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @c_read_float() {
%1 = alloca float
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%3 = load float, float* %1
ret float %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @c_read_float() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void function(char *s, int n) {
  char buf[4];
  strcpy(buf, s);
  printf("%s\n", buf);
}


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

x86 assembly (clang, -O2):
<function>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @function(i8* %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int test_02(char *x, int y) { return x[0] ^ x[-1] ^ x[-2] ^ x[-3]; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl -0x1(%rcx),%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl -0x2(%rcx),%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl -0x3(%rcx),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
movd   -0x3(%rdi),%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
pxor   %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x8,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @test_02(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = xor i32 %8, %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 -2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = xor i32 %13, %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 -3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = xor i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @test_02(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -3
%4 = bitcast i8* %3 to <4 x i8>*
%5 = load <4 x i8>, <4 x i8>* %4
%6 = call i8 @llvm.vector.reduce.xor.v4i8(<4 x i8> %5)
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strstr(char *, char *);
int test();
int main(int argc, char *argv[]) {
  if (strstr(argv[0], "test"))
    return test();
  printf("\nDoes nothing -- please run unit tests instead.\n\n");
  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    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1172 <main+0x42>
mov    $0x0,%al
call   1050 <test@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <main+0x55>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     114d <main+0x1d>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [50 x i8] c"\0ADoes nothing -- please run unit tests instead.\0A\0A\00"
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @strstr(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @test()
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@str = [49 x i8] c"\0ADoes nothing -- please run unit tests instead.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strstr(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @test()
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ 0, %8 ]
ret i32 %11
}
/* Variables and functions */
double M_LOG2E;
double log(double);
double log2(double x) { return (log(x) / M_LOG2E); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
call   1030 <log@plt>
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LOG2E = global double 0.000000e+00
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = load double, double* @M_LOG2E
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_LOG2E = global double 0.000000e+00
define double @log2(double %0) {
%2 = tail call double @log(double %0)
%3 = load double, double* @M_LOG2E
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ consoleTranslUserRmBranch(char *);
void consoleTranslUserRmAll() { consoleTranslUserRmBranch(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @consoleTranslUserRmAll() {
%1 = call i32 @consoleTranslUserRmBranch(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @consoleTranslUserRmAll() {
%1 = tail call i32 @consoleTranslUserRmBranch(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _error(char *, int);
char *strdup(char *);
char *_hash_none(void) {
  char *ret;
  if ((ret = strdup("")) == NULL)
    _error("malloc", 1);
  return ret;
}


x86 assembly (clang, -O0):
<_hash_none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed7(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1153 <_hash_none+0x33>
lea    0xeb7(%rip),%rdi
mov    $0x1,%esi
call   1030 <_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_none>:
push   %rbx
lea    0xede(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <_hash_none+0x26>
lea    0xec4(%rip),%rdi
mov    $0x1,%esi
call   1030 <_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"malloc\00"
define noalias i8* @_hash_none() {
%1 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %5
5: ; preds = %3, %0
ret i8* %1
}
/* Variables and functions */
double log(double);
double pow(double, double);
double bias(double x, double b) { return pow(x, log(b) / -0.69314718); }


x86 assembly (clang, -O0):
<bias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm2
divsd  %xmm2,%xmm1
call   1040 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bias>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <log@plt>
movapd %xmm0,%xmm1
divsd  0xec5(%rip),%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @bias(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 @log(double %6)
%8 = fdiv double %7, 0xBFE62E42FEAD449C
%9 = call double @pow(double %5, double %8)
ret double %9
}

LLVM IR (-O2):
define double @bias(double %0, double %1) {
%3 = tail call double @log(double %1)
%4 = fdiv double %3, 0xBFE62E42FEAD449C
%5 = tail call double @pow(double %0, double %4)
ret double %5
}
char test_171_12(char *mem) {
  char newval = 5;
  char prevval;
  __atomic_exchange(mem + 4, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_171_12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x5,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x9(%rbp),%al
xchg   %al,0x4(%rcx)
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_171_12>:
mov    $0x5,%al
xchg   %al,0x4(%rdi)
ret

LLVM IR (-O0):
define signext i8 @test_171_12(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
store i8 5, i8* %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = load i8, i8* %3
%8 = atomicrmw xchg i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_171_12(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw xchg i8* %2, i8 5 acq_rel
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ palavra;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *palavra[] = {"casa", "carro"};
  for (int i = 0; i < sizeof(palavra) / sizeof(palavra[0]); i++) {
    printf("%s", palavra[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x2,%rax
jae    116d <main+0x5d>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef3(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"casa\00"
@.str.1 = [6 x i8] c"carro\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int sarwaitbar_open(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sarwaitbar_open() {
ret i32 0
}
unsigned xrop3_252_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T | S;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_252_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_252_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
double sqrt(double const);
double vector_magnitude_2d(const double v[2]) {
  return sqrt(v[0] * v[0] + v[1] * v[1]);
}


x86 assembly (clang, -O0):
<vector_magnitude_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_magnitude_2d>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <vector_magnitude_2d+0x24>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vector_magnitude_2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = call double @sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
define double @vector_magnitude_2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Pedro(void) { printf("Hola mundo perras\n"); }


x86 assembly (clang, -O0):
<Pedro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hola mundo perras\0A\00"
define i32 @Pedro() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [18 x i8] c"Hola mundo perras\00"
define i32 @Pedro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void portable_gets(char *buf) { fgets(buf, 80, stdin); }


x86 assembly (clang, -O0):
<portable_gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1030 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_gets>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
jmp    1030 <fgets@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @portable_gets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 80, i32 %4)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @portable_gets(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgets(i8* %0, i32 80, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ read_size();
char *fill_buffer() {
  uint32_t size = read_size();
  char *buffer = malloc(size);
  read(STDIN_FILENO, buffer, size);
  return buffer;
}


x86 assembly (clang, -O0):
<fill_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_size@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <read@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buffer>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <read_size@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <read@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i8* @fill_buffer() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @read_size()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %2
%6 = load i32, i32* @STDIN_FILENO
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i32 @read(i32 %6, i8* %7, i32 %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define noalias i8* @fill_buffer() {
%1 = tail call i32 (...) @read_size()
%2 = tail call i8* @malloc(i32 %1)
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @read(i32 %3, i8* %2, i32 %1)
ret i8* %2
}
void f1(void) {
  short a;
  short b = 1;
  int c = 3;
#pragma omp atomic capture
  a = b = c << b;
  if (b != 6 || a != 6)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x1,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movswl -0x4(%rbp),%ecx
shl    %cl,%eax
mov    %ax,-0x4(%rbp)
mov    %ax,-0x2(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x6,%eax
jne    1150 <f1+0x40>
movswl -0x2(%rbp),%eax
cmp    $0x6,%eax
je     1155 <f1+0x45>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i32
store i16 1, i16* %2
store i32 3, i32* %3
%4 = load i32, i32* %3
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = shl i32 %4, %6
%8 = trunc i32 %7 to i16
store i16 %8, i16* %2
store i16 %8, i16* %1
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = icmp ne i32 %10, 6
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = load i16, i16* %1
%14 = sext i16 %13 to i32
%15 = icmp ne i32 %14, 6
br i1 %15, label %16, label %17
16: ; preds = %12, %0
unreachable
17: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
void *_zero_arr_plus_other_fn(unsigned int, void *, int, int, char const *,
                              unsigned int);
void *_zero_arr_inplace_plus_other_fn(unsigned t, void **x, int orig_i,
                                      const char *filename, unsigned lineno) {
  *x = _zero_arr_plus_other_fn(t, *x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_other_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x1,%edx
call   1030 <_zero_arr_plus_other_fn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_other_fn>:
push   %rbx
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rbx
mov    (%rsi),%rsi
mov    $0x1,%edx
call   1030 <_zero_arr_plus_other_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_zero_arr_inplace_plus_other_fn(i32 %0, i8** %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %12
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i8* @_zero_arr_plus_other_fn(i32 %11, i8* %13, i32 1, i32 %14, i8* %15, i32 %16)
%18 = load i8**, i8*** %7
store i8* %17, i8** %18
%19 = load i8**, i8*** %7
%20 = load i8*, i8** %19
ret i8* %20
}

LLVM IR (-O2):
define i8* @_zero_arr_inplace_plus_other_fn(i32 %0, i8** nocapture %1, i32 %2, i8* %3, i32 %4) {
%6 = load i8*, i8** %1
%7 = tail call i8* @_zero_arr_plus_other_fn(i32 %0, i8* %6, i32 1, i32 %2, i8* %3, i32 %4)
store i8* %7, i8** %1
ret i8* %7
}
void RTUtf16GetCpExInternal(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16GetCpExInternal() {
ret void
}
int mempool_init(int pool_sizes[24]) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @mempool_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCMinus() {
  long int stat = 99;
  BNCIO(17);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCMinus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x11,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCMinus>:
push   %rax
mov    $0x11,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCMinus() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 17)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCMinus() {
%1 = tail call i32 @BNCIO(i32 17)
ret i64 99
}