xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  printf("%d\n", a % 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xec6(%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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void handle_fatal_error(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_fatal_error>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double __rinf(double);
scalar_t__ signbit(double);
double trunc(double);
double ceil(double x) { return signbit(x) ? trunc(x) : __rinf(x); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <signbit@plt>
cmp    $0x0,%rax
je     1165 <ceil+0x35>
movsd  -0x8(%rbp),%xmm0
call   1040 <trunc@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <ceil+0x44>
movsd  -0x8(%rbp),%xmm0
call   1030 <__rinf@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
movsd  %xmm0,(%rsp)
call   1050 <signbit@plt>
test   %rax,%rax
je     114b <ceil+0x1b>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <trunc@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <__rinf@plt>

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @signbit(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @llvm.trunc.f64(double %7)
br label %12
9: ; preds = %1
%10 = load double, double* %2
%11 = call double @__rinf(double %10)
br label %12
12: ; preds = %9, %6
%13 = phi double [ %8, %6 ], [ %11, %9 ]
ret double %13
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call i64 @signbit(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @llvm.trunc.f64(double %0)
br label %8
6: ; preds = %1
%7 = tail call double @__rinf(double %0)
br label %8
8: ; preds = %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ]
ret double %9
}
void PrintFactJNGetVar3(void *theEnv, const char *logicalName, void *theValue) {

}


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

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

LLVM IR (-O0):
define void @PrintFactJNGetVar3(i8* %0, i8* %1, i8* %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
ret void
}

LLVM IR (-O2):
define void @PrintFactJNGetVar3(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
void bkl_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @bkl_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void inserirRegistroPesquisa() {
  printf("Vamos inserir um registro de pesquisa.\n");
  system("pause");
}


x86 assembly (clang, -O0):
<inserirRegistroPesquisa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inserirRegistroPesquisa>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Vamos inserir um registro de pesquisa.\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @inserirRegistroPesquisa() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [39 x i8] c"Vamos inserir um registro de pesquisa.\00"
define void @inserirRegistroPesquisa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_SET_BLANK;
int ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int videoSetBlank(int fd, int state) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_SET_BLANK, state)) < 0) {
    perror("VIDEO SET BLANK: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoSetBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1166 <videoSetBlank+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <videoSetBlank+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoSetBlank>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     113b <videoSetBlank+0x1b>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_SET_BLANK = global i32 0
@.str = [18 x i8] c"VIDEO SET BLANK: \00"
define i32 @videoSetBlank(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @VIDEO_SET_BLANK
%9 = load i32, i32* %5
%10 = call i32 @ioctl(i32 %7, i32 %8, i32 %9)
store i32 %10, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@VIDEO_SET_BLANK = global i32 0
@.str = [18 x i8] c"VIDEO SET BLANK: \00"
define i32 @videoSetBlank(i32 %0, i32 %1) {
%3 = load i32, i32* @VIDEO_SET_BLANK
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int BIO_sock_non_fatal_error(int);
int errno;
int BIO_sock_should_retry(int i) {
  int err;
  if ((i == 0) || (i == -1)) {
    err = errno;
    return (BIO_sock_non_fatal_error(err));
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_sock_should_retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <BIO_sock_should_retry+0x1f>
cmpl   $0xffffffff,-0x8(%rbp)
jne    114b <BIO_sock_should_retry+0x3b>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <BIO_sock_non_fatal_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <BIO_sock_should_retry+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_sock_should_retry>:
add    $0x1,%edi
cmp    $0x1,%edi
ja     1126 <BIO_sock_should_retry+0x16>
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <BIO_sock_non_fatal_error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @BIO_sock_should_retry(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @BIO_sock_non_fatal_error(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ strlen(char *);
int stronger(char *s, char *t) { return strlen(s) - strlen(t) > 0; }


x86 assembly (clang, -O0):
<stronger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stronger>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @stronger(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %6, %8
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @stronger(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int errno;
void *malloc(size_t);
int /*<<< orphan*/ s_error(int /*<<< orphan*/ *);
void *s_malloc(size_t size) {
  void *temp_p;
  int temp_i;
  temp_i = errno;
  errno = 0;
  if ((temp_p = malloc(size)) == NULL) {
    s_error(NULL);
    return (NULL);
  }
  errno = temp_i;
  return temp_p;
}


x86 assembly (clang, -O0):
<s_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2ea1(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1172 <s_malloc+0x52>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <s_error@plt>
movq   $0x0,-0x8(%rbp)
jmp    1186 <s_malloc+0x66>
mov    -0x1c(%rbp),%ecx
mov    0x2e64(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_malloc>:
push   %rbp
push   %r14
push   %rbx
mov    0x2eb5(%rip),%r14
mov    (%r14),%ebp
movl   $0x0,(%r14)
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1147 <s_malloc+0x27>
mov    %ebp,(%r14)
jmp    114e <s_malloc+0x2e>
xor    %edi,%edi
call   1030 <s_error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i8* @s_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
store i64 %0, i64* %3
%6 = load i32, i32* @errno
store i32 %6, i32* %5
store i32 0, i32* @errno
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @s_error(i32* null)
store i8* null, i8** %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %5
store i32 %13, i32* @errno
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %10
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@errno = global i32 0
define noalias i8* @s_malloc(i64 %0) {
%2 = load i32, i32* @errno
store i32 0, i32* @errno
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @s_error(i32* null)
br label %8
7: ; preds = %1
store i32 %2, i32* @errno
br label %8
8: ; preds = %7, %5
ret i8* %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t asri31(int32_t x) { return x >> 31; }


x86 assembly (clang, -O0):
<asri31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asri31>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @asri31(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isCHR(const char *tok) { return strcmp(tok, "chr") == 0; }


x86 assembly (clang, -O0):
<isCHR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCHR>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"chr\00"
define i32 @isCHR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"chr\00"
define i32 @isCHR(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void test_default() { asm volatile("nop" : :); }


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

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

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

LLVM IR (-O2):
define void @test_default() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void emit_type_definition_blob(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_blob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_blob(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_blob(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
int mystrcount(const char *str, int ch) {
  int answer = 0;
  while (*str)
    if (*str++ == ch)
      answer++;
  return answer;
}


x86 assembly (clang, -O0):
<mystrcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <mystrcount+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1143 <mystrcount+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <mystrcount+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <mystrcount+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mystrcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrcount(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %13, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %6 to i32
%11 = icmp eq i32 %10, %1
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %7, %12
%14 = load i8, i8* %9
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %17
}
/* Variables and functions */
int test_lib_foo_global();
int main(int argc, char *argv[]) { return test_lib_foo_global(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_lib_foo_global()
ret i32 %3
}
/* Variables and functions */
int rand();
int RoomSelector() { return (rand() % 7); }


x86 assembly (clang, -O0):
<RoomSelector>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoomSelector>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @RoomSelector() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 7
ret i32 %2
}

LLVM IR (-O2):
define i32 @RoomSelector() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 7
ret i32 %2
}
unsigned long long ceph_sanitize_features(unsigned long long f) {
  if (f & (1ULL << 63)) {
    return 0x1ffffffffull;
  } else {
    return f;
  }
}


x86 assembly (clang, -O0):
<ceph_sanitize_features>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x8000000000000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1133 <ceph_sanitize_features+0x33>
movabs $0x1ffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    113b <ceph_sanitize_features+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_sanitize_features>:
test   %rdi,%rdi
movabs $0x1ffffffff,%rax
cmovns %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ceph_sanitize_features(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, -9223372036854775808
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 8589934591, i64* %2
br label %10
8: ; preds = %1
%9 = load i64, i64* %3
store i64 %9, i64* %2
br label %10
10: ; preds = %8, %7
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @ceph_sanitize_features(i64 %0) {
%2 = icmp sgt i64 %0, -1
%3 = select i1 %2, i64 %0, i64 8589934591
ret i64 %3
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int time_day(time_t t) { return (t / (1000 * 86400)); }


x86 assembly (clang, -O0):
<time_day>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5265c00,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_day>:
movslq %edi,%rax
imul   $0x31b5d43b,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x38,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @time_day(i32 %0) {
%2 = sdiv i32 %0, 86400000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SendSerialByte(int /*<<< orphan*/);
void PrintSerialString(const char *string) {
  while (*string)
    SendSerialByte(*string++);
}


x86 assembly (clang, -O0):
<PrintSerialString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <PrintSerialString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <SendSerialByte@plt>
jmp    111c <PrintSerialString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintSerialString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <PrintSerialString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <SendSerialByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <PrintSerialString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PrintSerialString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @SendSerialByte(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input();
int main() {
  input();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @input()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isspace(char);
char getLetter(FILE *file) {
  char ch;
  while (!feof(file)) {
    ch = fgetc(file);
    if (!isspace(ch))
      return ch;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <getLetter+0x2a>
jmp    1188 <getLetter+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    1183 <getLetter+0x53>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    118c <getLetter+0x5c>
jmp    113c <getLetter+0xc>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLetter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1164 <getLetter+0x34>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
movsbl %al,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1140 <getLetter+0x10>
jmp    1166 <getLetter+0x36>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @getLetter(i32* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = tail call i32 @isspace(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2, %5
%10 = phi i8 [ %6, %5 ], [ 0, %2 ]
ret i8 %10
}
/* Variables and functions */
float __nv_fdiv_rn(float, float);
float __fdiv_rn(float __a, float __b) { return __nv_fdiv_rn(__a, __b); }


x86 assembly (clang, -O0):
<__fdiv_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fdiv_rn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdiv_rn>:
jmp    1030 <__nv_fdiv_rn@plt>

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

LLVM IR (-O2):
define float @__fdiv_rn(float %0, float %1) {
%3 = tail call float @__nv_fdiv_rn(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void printBlu(char *str) { printf("%s%s%s", "\x1B[34m", str, "\x1B[0m"); }


x86 assembly (clang, -O0):
<printBlu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xed8(%rip),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBlu>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee5(%rip),%rcx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [6 x i8] c"\1B[34m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @printBlu(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int LZ4_sizeofStreamStateHC(void) {
  return (4 * (1 << 15) + 2 * (1 << 16) + 56 +
          ((sizeof(void *) == 16) ? 56 : 0));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262200
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262200
}
int get_world_width(void) { return 39; }


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

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

LLVM IR (-O0):
define i32 @get_world_width() {
ret i32 39
}

LLVM IR (-O2):
define i32 @get_world_width() {
ret i32 39
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glPopClientAttrib();
extern void glPopClientAttrib(void) { ptr_glPopClientAttrib(); }


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

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

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

LLVM IR (-O2):
define void @glPopClientAttrib() {
%1 = tail call i32 (...) @ptr_glPopClientAttrib()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_putchar(char);
void kpc(char c) { terminal_putchar(c); }


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

x86 assembly (clang, -O2):
<kpc>:
jmp    1030 <terminal_putchar@plt>

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

LLVM IR (-O2):
define void @kpc(i8 signext %0) {
%2 = tail call i32 @terminal_putchar(i8 signext %0)
ret void
}
void atmel_atmega328_Mcu_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @atmel_atmega328_Mcu_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_authorizations();
int /*<<< orphan*/ open_authorizations(char *);
int /*<<< orphan*/ print_authorizations(char *);
int main(int argc, char **argv) {
  open_authorizations("r");
  print_authorizations(argc > 1 ? argv[1] : NULL);
  close_authorizations();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <open_authorizations@plt>
cmpl   $0x1,-0x8(%rbp)
jle    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1178 <main+0x48>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1178 <main+0x48>
mov    -0x18(%rbp),%rdi
call   1040 <print_authorizations@plt>
mov    $0x0,%al
call   1050 <close_authorizations@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1030 <open_authorizations@plt>
cmp    $0x2,%ebp
jl     114f <main+0x1f>
mov    0x8(%rbx),%rdi
jmp    1151 <main+0x21>
xor    %edi,%edi
call   1040 <print_authorizations@plt>
xor    %eax,%eax
call   1050 <close_authorizations@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\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 @open_authorizations(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ null, %13 ]
%16 = call i32 @print_authorizations(i8* %15)
%17 = call i32 (...) @close_authorizations()
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @open_authorizations(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
%10 = tail call i32 @print_authorizations(i8* %9)
%11 = tail call i32 (...) @close_authorizations()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Running test harness...\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
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 = [25 x i8] c"Running test harness...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Running test harness...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *);
main() {
  char input[1000];
  printf("Enter string to reverse\n");
  gets(input);
  reverse(input);
  printf("Reversed string is \n%s\n", input);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter string to reverse\0A\00"
@.str.1 = [24 x i8] c"Reversed string is \0A%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = call i32 @reverse(i8* %5)
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Reversed string is \0A%s\0A\00"
@str = [24 x i8] c"Enter string to reverse\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @reverse(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __bound_new_region(void *, int);
void __bound_main_arg(void **p) {
  void *start = p;
  while (*p++)
    ;
  __bound_new_region(start, (void *)p - start);
}


x86 assembly (clang, -O0):
<__bound_main_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1142 <__bound_main_arg+0x32>
jmp    1124 <__bound_main_arg+0x14>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1030 <__bound_new_region@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bound_main_arg>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpq   $0x0,(%rdi,%rsi,1)
lea    0x8(%rsi),%rsi
jne    1120 <__bound_main_arg+0x10>
jmp    1030 <__bound_new_region@plt>

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

LLVM IR (-O2):
define void @__bound_main_arg(i8** %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8** [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = bitcast i8** %0 to i8*
%9 = ptrtoint i8** %4 to i64
%10 = ptrtoint i8** %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = tail call i32 @__bound_new_region(i8* %8, i32 %12)
ret void
}
/* Variables and functions */
void *check_not_null(void *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *result = realloc(ptr, size);
  return (check_not_null(result));
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <check_not_null@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <check_not_null@plt>

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i8* @check_not_null(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = tail call i8* @check_not_null(i8* %3)
ret i8* %4
}
int find(int x, int parent[]) {
  while (x != parent[x])
    x = parent[x];
  return (x);
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1132 <find+0x32>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    110b <find+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %edi,%eax
movslq %edi,%rcx
mov    (%rsi,%rcx,4),%edi
cmp    %edi,%ecx
jne    1100 <find>
ret

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

LLVM IR (-O2):
define i32 @find(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %4, %7
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ emulate_adval(int /*<<< orphan*/);
int /*<<< orphan*/ eval_intfactor();
int /*<<< orphan*/ push_int(int /*<<< orphan*/);
void fn_adval(void) { push_int(emulate_adval(eval_intfactor())); }


x86 assembly (clang, -O0):
<fn_adval>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_adval@plt>
mov    %eax,%edi
call   1050 <push_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_adval>:
push   %rax
xor    %eax,%eax
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_adval@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <push_int@plt>

LLVM IR (-O0):
define void @fn_adval() {
%1 = call i32 (...) @eval_intfactor()
%2 = call i32 @emulate_adval(i32 %1)
%3 = call i32 @push_int(i32 %2)
ret void
}

LLVM IR (-O2):
define void @fn_adval() {
%1 = tail call i32 (...) @eval_intfactor()
%2 = tail call i32 @emulate_adval(i32 %1)
%3 = tail call i32 @push_int(i32 %2)
ret void
}
void MemManageException(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<MemManageException>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <MemManageException+0x9>
jmp    1109 <MemManageException+0x9>

x86 assembly (clang, -O2):
<MemManageException>:
jmp    1100 <MemManageException>

LLVM IR (-O0):
define void @MemManageException() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @MemManageException() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct if_nameindex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct if_nameindex *if_nameindex(void) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<if_nameindex>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.if_nameindex = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.if_nameindex* @if_nameindex() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.if_nameindex* null
}

LLVM IR (-O2):
%struct.if_nameindex = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.if_nameindex* @if_nameindex() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.if_nameindex* null
}
float BackMiniScaleOutMax(float p) {
  return ((1.0 / 0.45) * p) > 1.0 ? 1.0 : ((1.0 / 0.45) * p);
}


x86 assembly (clang, -O0):
<BackMiniScaleOutMax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1142 <BackMiniScaleOutMax+0x42>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115c <BackMiniScaleOutMax+0x5c>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackMiniScaleOutMax>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
minsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @BackMiniScaleOutMax(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x4001C71C71C71C72, %4
%6 = fcmp ogt double %5, 1.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
br label %12
8: ; preds = %1
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fmul double 0x4001C71C71C71C72, %10
br label %12
12: ; preds = %8, %7
%13 = phi double [ 1.000000e+00, %7 ], [ %11, %8 ]
%14 = fptrunc double %13 to float
ret float %14
}

LLVM IR (-O2):
define float @BackMiniScaleOutMax(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x4001C71C71C71C72
%4 = fcmp ogt double %3, 1.000000e+00
%5 = select i1 %4, double 1.000000e+00, double %3
%6 = fptrunc double %5 to float
ret float %6
}