xunge/DecIR huggingface dataset:
unsigned long __ffs(unsigned long word) {
  asm volatile("rep; bsf %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__ffs>:
mov    %rdi,-0x8(%rsp)
tzcnt  -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm sideeffect "rep; bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = tail call i64 asm sideeffect "rep; bsf $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello world (Ansi C)");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [21 x i8] c"Hello world (Ansi C)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [21 x i8] c"Hello world (Ansi C)\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(unsigned char *, int);
int /*<<< orphan*/ shake128(unsigned char *, int, unsigned char *, int);
void print_hash(unsigned char *buf, int len) {
  unsigned char tmp[10];
  shake128(tmp, 10, buf, len);
  print_hex(tmp, 10);
}


x86 assembly (clang, -O0):
<print_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0xa,%esi
call   1040 <shake128@plt>
lea    -0x16(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_hex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hash>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <shake128@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print_hex@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [10 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @shake128(i8* %6, i32 10, i8* %7, i32 %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = call i32 @print_hex(i8* %10, i32 10)
ret void
}

LLVM IR (-O2):
define void @print_hash(i8* %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @shake128(i8* %4, i32 10, i8* %0, i32 %1)
%6 = call i32 @print_hex(i8* %4, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void cmdshell_print_status_write_dir(const char *desc) {
  printf("\n"
         "Write directory description:\n"
         "%s"
         "\n",
         (*desc != '\0' ? desc : "empty\n"));
}


x86 assembly (clang, -O0):
<cmdshell_print_status_write_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <cmdshell_print_status_write_dir+0x29>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1149 <cmdshell_print_status_write_dir+0x39>
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1149 <cmdshell_print_status_write_dir+0x39>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdshell_print_status_write_dir>:
cmpb   $0x0,(%rdi)
lea    0xf08(%rip),%rsi
cmovne %rdi,%rsi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AWrite directory description:\0A%s\0A\00"
@.str.1 = [7 x i8] c"empty\0A\00"
define void @cmdshell_print_status_write_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %9 ]
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0AWrite directory description:\0A%s\0A\00"
@.str.1 = [7 x i8] c"empty\0A\00"
define void @cmdshell_print_status_write_dir(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char arr[16];
  strcpy(arr, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int errno;
void setErrno(int value) { errno = value; }


x86 assembly (clang, -O0):
<setErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setErrno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
@errno = global i32 0
define void @setErrno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @setErrno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
int Decrement(int a) { return --a; }


x86 assembly (clang, -O0):
<Decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrement>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @Decrement(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
f() {
  extern int i __asm("renamed");
  i = 2;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movl   $0x2,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2ee1(%rip),%rax
movl   $0x2,(%rax)
ret

LLVM IR (-O0):
@renamed = external global i32
define i32 @f() {
%1 = alloca i32
store i32 2, i32* @renamed
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
@renamed = external global i32
define i32 @f() {
store i32 2, i32* @renamed
ret i32 undef
}
unsigned xrop3_114_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_114_1_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
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_114_1_1>:
mov    %esi,%ecx
or     %edi,%esi
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%ecx
mov    %ecx,%edx
xor    %eax,%edx
or     $0xff,%edx
or     %esi,%eax
or     %ecx,%eax
not    %eax
and    %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_114_1_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
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_114_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, %4
%8 = or i32 %7, 255
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %4, %10
%12 = or i32 %11, %6
%13 = xor i32 %12, -1
%14 = and i32 %8, %13
%15 = or i32 %14, %10
ret i32 %15
}
void ucs_arch_generic_wait_mem(void *address) {}


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

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

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

LLVM IR (-O2):
define void @ucs_arch_generic_wait_mem(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double *CopyFloat(const void *pFloat) {
  double *d = (double *)malloc(sizeof(double));
  if (d == NULL) {
    fprintf(stderr, "error: not enought memory\n");
    exit(1);
  }
  *d = *(double *)pFloat;
  return d;
}


x86 assembly (clang, -O0):
<CopyFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <CopyFloat+0x44>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyFloat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     114d <CopyFloat+0x1d>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rax)
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"error: not enought memory\0A\00"
define double* @CopyFloat(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %3
%6 = load double*, double** %3
%7 = icmp eq double* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = load double*, double** %3
store double %15, double* %16
%17 = load double*, double** %3
ret double* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"error: not enought memory\0A\00"
define double* @CopyFloat(i8* nocapture %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = bitcast i8* %0 to double*
%11 = load double, double* %10
store double %11, double* %3
ret double* %3
}
int load_blktrace(struct thread_data *td, const char *fname, int need_swap) {
  return 1;
}


x86 assembly (clang, -O0):
<load_blktrace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.thread_data = type opaque
define i32 @load_blktrace(%struct.thread_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.thread_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.thread_data* %0, %struct.thread_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 1
}

LLVM IR (-O2):
%struct.thread_data = type opaque
define i32 @load_blktrace(%struct.thread_data* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
double exp(int);
double alphaN(double v) {
  return 0.01 * (10 - v) / (exp((10 - v) / 10.0) - 1.0);
}


x86 assembly (clang, -O0):
<alphaN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec5(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe93(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphaN>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  0xedf(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <exp@plt>
addsd  0xec9(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @alphaN(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+01, %3
%5 = fmul double 1.000000e-02, %4
%6 = load double, double* %2
%7 = fsub double 1.000000e+01, %6
%8 = fdiv double %7, 1.000000e+01
%9 = fptosi double %8 to i32
%10 = call double @exp(i32 %9)
%11 = fsub double %10, 1.000000e+00
%12 = fdiv double %5, %11
ret double %12
}

LLVM IR (-O2):
define double @alphaN(double %0) {
%2 = fsub double 1.000000e+01, %0
%3 = fmul double %2, 1.000000e-02
%4 = fdiv double %2, 1.000000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @exp(i32 %5)
%7 = fadd double %6, -1.000000e+00
%8 = fdiv double %3, %7
ret double %8
}
int char_in_range(const char c, const char low, const char high) {
  return (c >= low && c <= high) ? 0 : 1;
}


x86 assembly (clang, -O0):
<char_in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%ecx
movsbl -0x2(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x4(%rbp)
jl     113a <char_in_range+0x3a>
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_in_range>:
cmp    %sil,%dil
setl   %al
cmp    %dl,%dil
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @char_in_range(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %8, %10
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %14, %16
br label %18
18: ; preds = %12, %3
%19 = phi i1 [ false, %3 ], [ %17, %12 ]
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @char_in_range(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp slt i8 %0, %1
%5 = icmp sgt i8 %0, %2
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *ch_flightstick_pro_init() { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ch_flightstick_pro_init() {
ret i8* null
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CRxFIFOFlush(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000F04))) |= 0x40000000;
}


x86 assembly (clang, -O0):
<I2CRxFIFOFlush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf04(%rax),%rcx
or     $0x40000000,%rcx
mov    %rcx,0xf04(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CRxFIFOFlush>:
orq    $0x40000000,0xf04(%rdi)
ret

LLVM IR (-O0):
define void @I2CRxFIFOFlush(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 3844
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1073741824
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CRxFIFOFlush(i64 %0) {
%2 = add nsw i64 %0, 3844
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1073741824
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ remainder(double, double);
long double remainderl(long double x, long double y) {
  return (long double)remainder((double)x, (double)y);
}


x86 assembly (clang, -O0):
<remainderl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <remainder@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainderl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <remainder@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @remainder(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @remainder(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct node *);
extern void dlink_node_free(struct node *nptr) { free(nptr); }


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

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

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

LLVM IR (-O2):
%struct.node = type { i32 }
define void @dlink_node_free(%struct.node* nocapture %0) {
%2 = tail call i32 @free(%struct.node* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void manos_idle_watcher_destroy(void *watcher) { free(watcher); }


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

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

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

LLVM IR (-O2):
define void @manos_idle_watcher_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int expressao_simples();
int /*<<< orphan*/ relacao();
int expressao(void) {
  int tipo;
  tipo = expressao_simples();
  relacao();
  return tipo;
}


x86 assembly (clang, -O0):
<expressao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <expressao_simples@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <relacao@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expressao>:
push   %rbx
xor    %eax,%eax
call   1040 <expressao_simples@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <relacao@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @expressao() {
%1 = alloca i32
%2 = call i32 (...) @expressao_simples()
store i32 %2, i32* %1
%3 = call i32 (...) @relacao()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @expressao() {
%1 = tail call i32 (...) @expressao_simples()
%2 = tail call i32 (...) @relacao()
ret i32 %1
}
unsigned xrop3_205_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_205_1_0>:
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    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_205_1_0(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 = xor i32 %5, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int i2c_close(int handle) {
  if ((close(handle)) != 0) {
    fprintf(stderr, "i2c_close error: %s\n", strerror(errno));
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<i2c_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1185 <i2c_close+0x55>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <i2c_close+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_close>:
push   %rbx
call   1030 <close@plt>
test   %rax,%rax
je     116a <i2c_close+0x3a>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea7(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"i2c_close error: %s\0A\00"
@errno = global i32 0
define i32 @i2c_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"i2c_close error: %s\0A\00"
@errno = global i32 0
define i32 @i2c_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
main() {
  char ch;
  while ((ch = getchar()) != EOF) {
    if ((ch >= 'A') && (ch <= 'Z'))
      ch += 'a' - 'A';
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1180 <main+0x60>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1172 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1172 <main+0x52>
movsbl -0x5(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%al
je     1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1a,%cl
movzbl %al,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
movsbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %25
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 90
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 32
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %22
22: ; preds = %17, %13, %9
%23 = load i8, i8* %2
%24 = call i32 @putchar(i8 signext %23)
br label %3
25: ; preds = %3
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %11, %4 ], [ %1, %0 ]
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 26
%8 = add i8 %5, 32
%9 = select i1 %7, i8 %8, i8 %5
%10 = tail call i32 @putchar(i8 signext %9)
%11 = tail call signext i8 (...) @getchar()
%12 = load i8, i8* @EOF
%13 = icmp eq i8 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double opr_sub(struct lifo *stack) {
  double op1, op2;
  op1 = pop(stack);
  op2 = pop(stack);
  return op2 - op1;
}


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

x86 assembly (clang, -O2):
<opr_sub>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <pop@plt>
subsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_sub(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
%4 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%5 = load %struct.lifo*, %struct.lifo** %2
%6 = call double @pop(%struct.lifo* %5)
store double %6, double* %3
%7 = load %struct.lifo*, %struct.lifo** %2
%8 = call double @pop(%struct.lifo* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
ret double %11
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_sub(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @pop(%struct.lifo* %0)
%4 = fsub double %3, %2
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ diag_vdump_buf_with_offset(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/ *);
void diag_dump_buf_with_offset(uint8_t *p, uint32_t s, uint8_t *base) {
  diag_vdump_buf_with_offset(p, s, base);
}


x86 assembly (clang, -O0):
<diag_dump_buf_with_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <diag_vdump_buf_with_offset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag_dump_buf_with_offset>:
jmp    1030 <diag_vdump_buf_with_offset@plt>

LLVM IR (-O0):
define void @diag_dump_buf_with_offset(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** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @diag_vdump_buf_with_offset(i32* %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @diag_dump_buf_with_offset(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @diag_vdump_buf_with_offset(i32* %0, i32 %1, i32* %2)
ret void
}
int toni(int i, int j, int n) { return n - 1 - i; }


x86 assembly (clang, -O0):
<toni>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toni>:
not    %edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @toni(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* %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @toni(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = add i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test(void (*fn)(), char *name) {
  printf("Testing %s\n", name);
  fn();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
@.str = [12 x i8] c"Testing %s\0A\00"
define void @test(void (...)* nocapture %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
tail call void (...) %0()
ret void
}
/* Variables and functions */
double distance(int, int, int, int);
int /*<<< orphan*/ hello(char *);
int /*<<< orphan*/ print_zlib();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  hello("Demo");
  printf("distance ((1,2), (4,4)) = %.f\n", distance(1, 2, 4, 4));
  print_zlib();
  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)
lea    0xea3(%rip),%rdi
call   1040 <hello@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%ecx
mov    %ecx,%edx
call   1060 <distance@plt>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_zlib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <hello@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1060 <distance@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <print_zlib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Demo\00"
@.str.1 = [31 x i8] c"distance ((1,2), (4,4)) = %.f\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 = call i32 @hello(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call double @distance(i32 1, i32 2, i32 4, i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = call i32 (...) @print_zlib()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Demo\00"
@.str.1 = [31 x i8] c"distance ((1,2), (4,4)) = %.f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hello(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call double @distance(i32 1, i32 2, i32 4, i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call i32 (...) @print_zlib()
ret i32 0
}
int HelpItem8(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem8() {
ret i32 0
}
/* Variables and functions */
int foo1(int);
int main() { return foo1(1); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <foo1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo1(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int multiplicador = 1000, multiplicando = 2;
  printf("Resultado: %d\n", multiplicando * multiplicador);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xec5(%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
mov    $0x7d0,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Resultado: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void C_INTFACE(int *i) { fprintf(stdout, "UPPER\n"); }


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

x86 assembly (clang, -O2):
<C_INTFACE>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"UPPER\0A\00"
define void @C_INTFACE(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"UPPER\0A\00"
define void @C_INTFACE(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void die_(int line, const char *msg) {
  fprintf(stderr, "At line %d: ", line);
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<die_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die_>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"At line %d: \00"
define void @die_(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"At line %d: \00"
define void @die_(i32 %0, i8* nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int in(int entrada) {
  scanf("&d", &entrada);
  return entrada;
}


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

x86 assembly (clang, -O2):
<in>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"&d\00"
define i32 @in(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_brcth(int, int);
int /*<<< orphan*/ check_risbxg();
int main() {
  check_brcth(5, 3);
  check_brcth(1, 30);
  check_brcth(16, 1);
  check_risbxg();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <check_brcth@plt>
mov    $0x1,%edi
mov    $0x1e,%esi
call   1040 <check_brcth@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1040 <check_brcth@plt>
mov    $0x0,%al
call   1030 <check_risbxg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <check_brcth@plt>
mov    $0x1,%edi
mov    $0x1e,%esi
call   1040 <check_brcth@plt>
mov    $0x10,%edi
mov    $0x1,%esi
call   1040 <check_brcth@plt>
xor    %eax,%eax
call   1030 <check_risbxg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @check_brcth(i32 5, i32 3)
%3 = call i32 @check_brcth(i32 1, i32 30)
%4 = call i32 @check_brcth(i32 16, i32 1)
%5 = call i32 (...) @check_risbxg()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check_brcth(i32 5, i32 3)
%2 = tail call i32 @check_brcth(i32 1, i32 30)
%3 = tail call i32 @check_brcth(i32 16, i32 1)
%4 = tail call i32 (...) @check_risbxg()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int feet, fathoms;
  fathoms = 2;
  feet = 6 * fathoms;
  printf("There are %d feet in %d fathoms!\n", fathoms, feet);
  printf("Yes, I said %d feet!\n", 6 * fathoms);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
imul   $0x6,-0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x6,-0xc(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0xc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"There are %d feet in %d fathoms!\0A\00"
@.str.1 = [22 x i8] c"Yes, I said %d feet!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
%4 = load i32, i32* %3
%5 = mul nsw i32 6, %4
store i32 %5, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = mul nsw i32 6, %9
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"There are %d feet in %d fathoms!\0A\00"
@.str.1 = [22 x i8] c"Yes, I said %d feet!\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 2, i32 12)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 12)
ret i32 0
}