xunge/DecIR huggingface dataset:
float ceilf(float x) {}


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

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

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

LLVM IR (-O2):
define float @ceilf(float %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ addCodeLine(char *, char ***, unsigned int *);
char *concatenateStrings(int, char *, char const *, char *);
int /*<<< orphan*/ free(char *);
void generateCodeForSearchPathInclude(const char *header, char ***codeLines,
                                      unsigned *numLines) {
  char *relativeInclude = concatenateStrings(3, "#include <", header, ">");
  addCodeLine(relativeInclude, codeLines, numLines);
  free(relativeInclude);
}


x86 assembly (clang, -O0):
<generateCodeForSearchPathInclude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xeac(%rip),%rsi
lea    0xeb0(%rip),%rcx
call   1050 <concatenateStrings@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <addCodeLine@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateCodeForSearchPathInclude>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rdx
lea    0xebb(%rip),%rsi
lea    0xebf(%rip),%rcx
mov    $0x3,%edi
call   1050 <concatenateStrings@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <addCodeLine@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"#include <\00"
@.str.1 = [2 x i8] c">\00"
define void @generateCodeForSearchPathInclude(i8* %0, i8*** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8***
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i8*** %1, i8**** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i8* @concatenateStrings(i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8***, i8**** %5
%12 = load i32*, i32** %6
%13 = call i32 @addCodeLine(i8* %10, i8*** %11, i32* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"#include <\00"
@.str.1 = [2 x i8] c">\00"
define void @generateCodeForSearchPathInclude(i8* %0, i8*** %1, i32* %2) {
%4 = tail call i8* @concatenateStrings(i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @addCodeLine(i8* %4, i8*** %1, i32* %2)
%6 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int z(int);
int main() { printf("%d\n", z(42)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <z@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <z@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @z(i32 42)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @z(i32 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned long UARTTxIntModeGet(unsigned long ulBase) {

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000030))) &
          (0x00000010 | 0x00000000));
}


x86 assembly (clang, -O0):
<UARTTxIntModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
and    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxIntModeGet>:
mov    0x30(%rdi),%rax
and    $0x10,%eax
ret

LLVM IR (-O0):
define i64 @UARTTxIntModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 48
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 16
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTTxIntModeGet(i64 %0) {
%2 = add i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 16
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int inputInt() {
  printf("input int : ");
  int a;
  scanf("%d", &a);
  return a;
}


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

x86 assembly (clang, -O2):
<inputInt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"input int : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputInt() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ send_command(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void dc_time(unsigned char *buffer) {
  time_t t;
  time(&t);
  send_command("RETV", t, t, NULL, 0);
}


x86 assembly (clang, -O0):
<dc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <time@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_time>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
mov    0x4(%rsp),%edx
lea    0xeca(%rip),%rdi
mov    %edx,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <send_command@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"RETV\00"
define void @dc_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* %3)
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @send_command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"RETV\00"
define void @dc_time(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @send_command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5, i32* null, i32 0)
ret void
}
/* Variables and functions */
int str2signum(char const *);
int str2sig(char const *signame, int *signum) {
  *signum = str2signum(signame);
  return *signum < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<str2sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str2signum@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2sig>:
push   %rbx
mov    %rsi,%rbx
call   1030 <str2signum@plt>
mov    %eax,(%rbx)
sar    $0x1f,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @str2sig(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 = call i32 @str2signum(i8* %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @str2sig(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @str2signum(i8* %0)
store i32 %3, i32* %1
%4 = ashr i32 %3, 31
ret i32 %4
}
void lower_case(char *str) {
  char *s;
  for (s = str; *s; s++) {
    if ('A' <= *s && *s <= 'Z') {
      *s += (-'A' + 'a');
    }
  }
}


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <lower_case+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <lower_case+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <lower_case+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1152 <lower_case+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <lower_case+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_case>:
mov    (%rdi),%al
test   %al,%al
je     112a <lower_case+0x2a>
add    $0x1,%rdi
jmp    111b <lower_case+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lower_case+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lower_case+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lower_case+0x10>
ret

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

LLVM IR (-O2):
define void @lower_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
void C_init_optional_attributes(struct C *_C) {}


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

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

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

LLVM IR (-O2):
%struct.C = type opaque
define void @C_init_optional_attributes(%struct.C* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int atoi(const char *str) { return (int)strtol(str, (char **)NULL, 10); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void beg_food() {}


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

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

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

LLVM IR (-O2):
define void @beg_food() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decawm(int flag) {
  if (flag)
    sm("?7");
  else
    rm("?7");
}


x86 assembly (clang, -O0):
<decawm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decawm+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decawm+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decawm>:
test   %edi,%edi
je     1130 <decawm+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"?7\00"
define void @decawm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int epoll_create1(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int xepoll_create1(int flags) {
  int fd;
  fd = epoll_create1(flags);
  if (fd < 0)
    errx(1, "epoll_create1: %s", strerror(errno));
  return fd;
}


x86 assembly (clang, -O0):
<xepoll_create1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <epoll_create1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1171 <xepoll_create1+0x41>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe94(%rip),%rsi
call   1030 <errx@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xepoll_create1>:
push   %rbx
call   1050 <epoll_create1@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115d <xepoll_create1+0x2d>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeaf(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1030 <errx@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"epoll_create1: %s\00"
@errno = global i32 0
define i32 @xepoll_create1(i32 %0) {
%2 = tail call i32 @epoll_create1(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ str_to_int(char *, int *);
int natural_string(char *str) {
  int i;
  if (!str_to_int(str, &i))
    return -1;
  else if (i < 0)
    return -1;
  else
    return i;
}


x86 assembly (clang, -O0):
<natural_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <str_to_int@plt>
cmp    $0x0,%eax
jne    113e <natural_string+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <natural_string+0x4a>
cmpl   $0x0,-0x14(%rbp)
jge    1154 <natural_string+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <natural_string+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<natural_string>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <str_to_int@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
mov    $0xffffffff,%edx
cmovns %ecx,%edx
cmp    $0x1,%eax
sbb    %eax,%eax
or     %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @natural_string(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @str_to_int(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, -1
%8 = select i1 %7, i32 %6, i32 -1
%9 = select i1 %5, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ HandleInterrupt(int);
void INT_P4(void) { HandleInterrupt(4); }


x86 assembly (clang, -O0):
<INT_P4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <HandleInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_P4>:
mov    $0x4,%edi
jmp    1030 <HandleInterrupt@plt>

LLVM IR (-O0):
define void @INT_P4() {
%1 = call i32 @HandleInterrupt(i32 4)
ret void
}

LLVM IR (-O2):
define void @INT_P4() {
%1 = tail call i32 @HandleInterrupt(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRBA_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRBA_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRBA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateRTCTrimSet(unsigned long ulTrim) {
  DEBUG_ASSERT(ulTrim < 0x10000);
  (*((volatile unsigned long *)(0x400FC024))) = ulTrim;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCTrimSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x10000,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fc024,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCTrimSet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x10000,%rbx
setb   %dil
call   1040 <DEBUG_ASSERT@plt>
mov    %rbx,0x400fc024
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCTrimSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 65536
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
store volatile i64 %7, i64* inttoptr (i64 1074774052 to i64*)
%8 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCTrimSet(i64 %0) {
%2 = icmp ult i64 %0, 65536
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
store volatile i64 %0, i64* inttoptr (i64 1074774052 to i64*)
%5 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
char strlen(char *);
char *corta_string(char *apuntador) {
  if (strlen(apuntador) != '\0')
    return apuntador + 1;
  else
    return "Error, introduce algun caracter!!!\n";
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     1142 <corta_string+0x32>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114d <corta_string+0x3d>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%rbx
test   %al,%al
lea    0xeda(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Error, introduce algun caracter!!!\0A\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call signext i8 @strlen(i8* %4)
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [36 x i8] c"Error, introduce algun caracter!!!\0A\00"
define i8* @corta_string(i8* %0) {
%2 = tail call signext i8 @strlen(i8* %0)
%3 = icmp eq i8 %2, 0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int RLFL_randrange(int, int);
int RLFL_randspread(int origin, int range) {
  return RLFL_randrange(origin - range, origin + range + 1);
}


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

x86 assembly (clang, -O2):
<RLFL_randspread>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
sub    %esi,%edi
mov    %eax,%esi
jmp    1030 <RLFL_randrange@plt>

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

LLVM IR (-O2):
define i32 @RLFL_randspread(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = add i32 %0, 1
%5 = add i32 %4, %1
%6 = tail call i32 @RLFL_randrange(i32 %3, i32 %5)
ret i32 %6
}
__attribute__((always_)) double min_double(double a, double b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<min_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min_double+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min_double+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_double>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min_double(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 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
_Atomic(int) compound_mul(_Atomic(int) in) { return (in *= 5); }


x86 assembly (clang, -O0):
<compound_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
lea    (%rcx,%rcx,4),%ecx
mov    %ecx,-0xc(%rbp)
lock cmpxchg %ecx,-0x4(%rbp)
sete   %cl
test   $0x1,%cl
mov    %eax,-0x8(%rbp)
jne    1135 <compound_mul+0x35>
jmp    110d <compound_mul+0xd>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_mul>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
nopl   0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%ecx
lock cmpxchg %ecx,-0x4(%rsp)
jne    1110 <compound_mul+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compound_mul(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load atomic i32, i32* %2 seq_cst
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %8, %4 ]
%6 = mul nsw i32 %5, 5
%7 = cmpxchg i32* %2, i32 %5, i32 %6 seq_cst seq_cst
%8 = extractvalue { i32, i1 } %7, 0
%9 = extractvalue { i32, i1 } %7, 1
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 %6
}

LLVM IR (-O2):
define i32 @compound_mul(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load atomic i32, i32* %2 seq_cst
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %8, %4 ]
%6 = mul nsw i32 %5, 5
%7 = cmpxchg i32* %2, i32 %5, i32 %6 seq_cst seq_cst
%8 = extractvalue { i32, i1 } %7, 0
%9 = extractvalue { i32, i1 } %7, 1
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 %6
}
/* Variables and functions */
int ziplistCompare(unsigned char *, unsigned char *, int);
int quicklistCompare(unsigned char *p1, unsigned char *p2, int p2_len) {
  return ziplistCompare(p1, p2, p2_len);
}


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

x86 assembly (clang, -O2):
<quicklistCompare>:
jmp    1030 <ziplistCompare@plt>

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

LLVM IR (-O2):
define i32 @quicklistCompare(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ziplistCompare(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void traverse(void *data) { printf("%d ", *((int *)data)); }


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

x86 assembly (clang, -O2):
<traverse>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @traverse(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
size_t childl(size_t ix) { return ix * 2 + 1; }


x86 assembly (clang, -O0):
<childl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<childl>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @childl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @childl(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
char *mp_store_float(char *, float);
char *mp_store_u8(char *, int);
char *mp_encode_float(char *data, float num) {
  data = mp_store_u8(data, 0xca);
  return mp_store_float(data, num);
}


x86 assembly (clang, -O0):
<mp_encode_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xca,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <mp_store_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0xca,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <mp_store_float@plt>

LLVM IR (-O0):
define i8* @mp_encode_float(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = call i8* @mp_store_u8(i8* %5, i32 202)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load float, float* %4
%9 = call i8* @mp_store_float(i8* %7, float %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @mp_encode_float(i8* %0, float %1) {
%3 = tail call i8* @mp_store_u8(i8* %0, i32 202)
%4 = tail call i8* @mp_store_float(i8* %3, float %1)
ret i8* %4
}
void LOS_EvbUartInit(void) { return; }


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

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

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

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

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int fileRead32(FILE *fp) {
  unsigned int r = fgetc(fp);
  r |= fgetc(fp) << 8;
  r |= fgetc(fp) << 16;
  r |= fgetc(fp) << 24;
  return r;
}


x86 assembly (clang, -O0):
<fileRead32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileRead32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fileRead32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = call i32 @fgetc(i32* %11)
%13 = shl i32 %12, 16
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @fgetc(i32* %16)
%18 = shl i32 %17, 24
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @fileRead32(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Found B\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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Found B\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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Found B\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int best_fit_memory_init(size_t size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @best_fit_memory_init(i64 %0) {
ret i32 0
}
/* Variables and functions */
double Slater_2S_4S(double, double, double);
double Slater_4S_2S(double rij, double xii, double xij) {
  return Slater_2S_4S(rij, xij, xii);
}


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

x86 assembly (clang, -O2):
<Slater_4S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_2S_4S@plt>

LLVM IR (-O0):
define double @Slater_4S_2S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @Slater_2S_4S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @Slater_4S_2S(double %0, double %1, double %2) {
%4 = tail call double @Slater_2S_4S(double %0, double %2, double %1)
ret double %4
}
maior(int x, int y, int z) {
  int max;
  max = x;
  if (max < y)
    max = y;
  if (max < z)
    max = z;
  return (max);
}


x86 assembly (clang, -O0):
<maior>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1125 <maior+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1137 <maior+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maior>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @maior(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void USBHostRequestINClear(unsigned long ulBase, unsigned long ulEndpoint) {
  unsigned long ulRegister;
  ;

  ;
  if (ulEndpoint == 0x00000000) {
    ulRegister = 0x00000102;
  } else {
    ulRegister = 0x00000116 + (ulEndpoint - 0x10);
  }
  (*((volatile unsigned char *)(ulBase + ulRegister))) &= ~0x00000020;
}


x86 assembly (clang, -O0):
<USBHostRequestINClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <USBHostRequestINClear+0x24>
movq   $0x102,-0x18(%rbp)
jmp    1136 <USBHostRequestINClear+0x36>
mov    -0x10(%rbp),%rax
sub    $0x10,%rax
add    $0x116,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
and    $0xffffffdf,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestINClear>:
lea    0x106(%rsi),%rax
test   %rsi,%rsi
mov    $0x102,%ecx
cmovne %rax,%rcx
andb   $0xdf,(%rcx,%rdi,1)
ret

LLVM IR (-O0):
define void @USBHostRequestINClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 258, i64* %5
br label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = sub i64 %10, 16
%12 = add i64 278, %11
store i64 %12, i64* %5
br label %13
13: ; preds = %9, %8
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = add i64 %14, %15
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, -33
%21 = trunc i32 %20 to i8
store volatile i8 %21, i8* %17
ret void
}

LLVM IR (-O2):
define void @USBHostRequestINClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = add i64 %1, 262
%5 = select i1 %3, i64 258, i64 %4
%6 = add i64 %5, %0
%7 = inttoptr i64 %6 to i8*
%8 = load volatile i8, i8* %7
%9 = and i8 %8, -33
store volatile i8 %9, i8* %7
ret void
}
/* Variables and functions */
int extract_tarball(char const *);
int extract(const char *path) { return extract_tarball(path); }


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

x86 assembly (clang, -O2):
<extract>:
jmp    1030 <extract_tarball@plt>

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

LLVM IR (-O2):
define i32 @extract(i8* %0) {
%2 = tail call i32 @extract_tarball(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: smoke [image]\n");
  printf("'h'           - help\n");
  printf("'f'           - toggle fog\n");
  printf("left mouse    - pan\n");
  printf("right mouse   - rotate\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: smoke [image]\0A\00"
@.str.1 = [22 x i8] c"'h' - help\0A\00"
@.str.2 = [28 x i8] c"'f' - toggle fog\0A\00"
@.str.3 = [21 x i8] c"left mouse - pan\0A\00"
@.str.4 = [24 x i8] c"right mouse - rotate\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Usage: smoke [image]\00"
@str.5 = [21 x i8] c"'h' - help\00"
@str.6 = [27 x i8] c"'f' - toggle fog\00"
@str.7 = [20 x i8] c"left mouse - pan\00"
@str.8 = [23 x i8] c"right mouse - rotate\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
ret void
}
int floatcmp(const void *x, const void *y) {
  float d = *(float *)x - *(float *)y;
  if (d > 0) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<floatcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    113e <floatcmp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <floatcmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatcmp>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @floatcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = fsub float %9, %12
store float %13, float* %6
%14 = load float, float* %6
%15 = fcmp ogt float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @floatcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fcmp ogt float %7, 0.000000e+00
%9 = select i1 %8, i32 1, i32 -1
ret i32 %9
}
/* Variables and functions */
int _convert(char *, char *);
int write_scite(char *filename, char *src) { return _convert(src, filename); }


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

x86 assembly (clang, -O2):
<write_scite>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <_convert@plt>

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

LLVM IR (-O2):
define i32 @write_scite(i8* %0, i8* %1) {
%3 = tail call i32 @_convert(i8* %1, i8* %0)
ret i32 %3
}
signed long int signedlongint_ignoring_unsignedlong(signed long int x,
                                                    unsigned long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_unsignedlong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_unsignedlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}