xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ say_goodbye_and_exit(int /*<<< orphan*/);
cmd_quit() { say_goodbye_and_exit(0); }


x86 assembly (clang, -O0):
<cmd_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <say_goodbye_and_exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_quit>:
xor    %edi,%edi
jmp    1030 <say_goodbye_and_exit@plt>

LLVM IR (-O0):
define i32 @cmd_quit() {
%1 = alloca i32
%2 = call i32 @say_goodbye_and_exit(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @cmd_quit() {
%1 = tail call i32 @say_goodbye_and_exit(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dostuff(int const *);
void exp05() {
  const int x = 42;
  int y = (int)x;
  int *p;
  p = (int *)&x;
  const int data[] = {1, 2, 3, 4};
  dostuff(data);
}


x86 assembly (clang, -O0):
<exp05>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2a,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <dostuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp05>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <dostuff@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.exp05.data = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @exp05() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [4 x i32]
store i32 42, i32* %1
store i32 42, i32* %2
store i32* %1, i32** %3
%5 = bitcast [4 x i32]* %4 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%7 = call i32 @dostuff(i32* %6)
ret void
}

LLVM IR (-O2):
@__const.exp05.data = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @exp05() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @dostuff(i32* %3)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strlen(char const *);
int unicsv_strrcmp(const char *s1, const char *s2) {
  int l1, l2;
  l1 = strlen(s1);
  l2 = strlen(s2);
  if ((l1 - l2) >= 0)
    return strcmp(s1 + (l1 - l2), s2);
  else
    return 1;
}


x86 assembly (clang, -O0):
<unicsv_strrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cmp    $0x0,%eax
jl     1177 <unicsv_strrcmp+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <unicsv_strrcmp+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicsv_strrcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
js     1151 <unicsv_strrcmp+0x31>
mov    %ebp,%eax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @unicsv_strrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sub nsw i32 %3, %4
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ 1, %2 ]
ret i32 %12
}
void test_non_identifiers() {
  int i, x;
#pragma omp target teams distribute parallel for;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute parallel for private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute parallel for, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
double endian_read_double(void const *, int);
double le_read_double(const void *ptr) { return endian_read_double(ptr, 1); }


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

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

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

LLVM IR (-O2):
define double @le_read_double(i8* %0) {
%2 = tail call double @endian_read_double(i8* %0, i32 1)
ret double %2
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *generate_name(int id) {
  char *name = (char *)calloc(128, sizeof(char));
  sprintf(name, "/_%d_%d", getpid(), id);
  return name;
}


x86 assembly (clang, -O0):
<generate_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xe93(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_name>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x80,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
mov    %ebp,%ecx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/_%d_%d\00"
define i8* @generate_name(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @calloc(i32 128, i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"/_%d_%d\00"
define i8* @generate_name(i32 %0) {
%2 = tail call i64 @calloc(i32 128, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ setchr8(int /*<<< orphan*/);
int /*<<< orphan*/ setprg32(int, int /*<<< orphan*/);
void Sync(void) {
  setprg32(0x8000, 0);
  setchr8(0);
}


x86 assembly (clang, -O0):
<Sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000,%edi
xor    %esi,%esi
call   1030 <setprg32@plt>
xor    %edi,%edi
call   1040 <setchr8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sync>:
push   %rax
mov    $0x8000,%edi
xor    %esi,%esi
call   1030 <setprg32@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <setchr8@plt>

LLVM IR (-O0):
define void @Sync() {
%1 = call i32 @setprg32(i32 32768, i32 0)
%2 = call i32 @setchr8(i32 0)
ret void
}

LLVM IR (-O2):
define void @Sync() {
%1 = tail call i32 @setprg32(i32 32768, i32 0)
%2 = tail call i32 @setchr8(i32 0)
ret void
}
int raise(int sig) {
  int rc;
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int hider() {
  char msg[80];
  while (fgets(msg, 80, stdin)) {
    encrypt(msg);
    printf("%s", msg);
  }
}


x86 assembly (clang, -O0):
<hider>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x60(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1177 <hider+0x47>
lea    -0x60(%rbp),%rdi
call   1040 <encrypt@plt>
lea    -0x60(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1138 <hider+0x8>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hider>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1188 <hider+0x58>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
call   1040 <encrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1160 <hider+0x30>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @hider() {
%1 = alloca i32
%2 = alloca [80 x i8]
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %4, i32 80, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = call i32 @encrypt(i8* %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @hider() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 @encrypt(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %2, i32 80, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 undef
}
long GETPMC(pmctable, pmtname)
struct mctable *pmctable;
char *pmtname;
{
  register int i;
  i = _getpmc(pmctable, pmtname);
  if (i == -1)
    return (0);
  _setsubtype(i, pmctable);
  return (-1);
}


x86 assembly (clang, -O0):
<GETPMC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <_getpmc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1159 <GETPMC+0x39>
movq   $0x0,-0x8(%rbp)
jmp    116f <GETPMC+0x4f>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <_setsubtype@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GETPMC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <_getpmc@plt>
cmp    $0xffffffff,%eax
je     1148 <GETPMC+0x28>
mov    %eax,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <_setsubtype@plt>
mov    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mctable = type opaque
define i64 @GETPMC(%struct.mctable* %0, i8* %1) {
%3 = alloca i64
%4 = alloca %struct.mctable*
%5 = alloca i8*
%6 = alloca i32
store %struct.mctable* %0, %struct.mctable** %4
store i8* %1, i8** %5
%7 = load %struct.mctable*, %struct.mctable** %4
%8 = load i8*, i8** %5
%9 = call i32 (%struct.mctable*, i8*, ...) bitcast (i32 (...)* @_getpmc to i32 (%struct.mctable*, i8*, ...)*)(%struct.mctable* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i64 0, i64* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load %struct.mctable*, %struct.mctable** %4
%16 = call i32 (i32, %struct.mctable*, ...) bitcast (i32 (...)* @_setsubtype to i32 (i32, %struct.mctable*, ...)*)(i32 %14, %struct.mctable* %15)
store i64 -1, i64* %3
br label %17
17: ; preds = %13, %12
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
%struct.mctable = type opaque
define i64 @GETPMC(%struct.mctable* %0, i8* %1) {
%3 = tail call i32 (%struct.mctable*, i8*, ...) bitcast (i32 (...)* @_getpmc to i32 (%struct.mctable*, i8*, ...)*)(%struct.mctable* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i32, %struct.mctable*, ...) bitcast (i32 (...)* @_setsubtype to i32 (i32, %struct.mctable*, ...)*)(i32 %3, %struct.mctable* %0)
br label %7
7: ; preds = %2, %5
%8 = phi i64 [ -1, %5 ], [ 0, %2 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *no_or_number(int number) {
  if (number == 0)
    return "No more";
  else {
    char btr[2];
    char *bt = btr;
    sprintf(bt, "%d", number);
    return bt;
  }
}


x86 assembly (clang, -O0):
<no_or_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <no_or_number+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <no_or_number+0x48>
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_or_number>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
je     1131 <no_or_number+0x21>
mov    %edi,%edx
lea    0xe(%rsp),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1138 <no_or_number+0x28>
lea    0xec8(%rip),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"No more\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @no_or_number(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i8*
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %3
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %5
store i8* %14, i8** %2
br label %15
15: ; preds = %9, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"No more\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @no_or_number(i32 %0) {
%2 = alloca [2 x i8]
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ getch();
void nmstermio_get_char(void) { getch(); }


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

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

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

LLVM IR (-O2):
define void @nmstermio_get_char() {
%1 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int character) {
  return (islower(character) ? (character - 'a' + 'A') : character);
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 %8, 65
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void seed_rng() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<seed_rng>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_rng>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @seed_rng() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @seed_rng() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void TrimAfterColdResetWakeupFromShutDownWakeupFromPowerDown(void) {}


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

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

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

LLVM IR (-O2):
define void @TrimAfterColdResetWakeupFromShutDownWakeupFromPowerDown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_down_nicely();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cleanup_buffers(int UNUSED_signum __attribute__((__unused__))) {
  close_down_nicely();
  exit(0);
}


x86 assembly (clang, -O0):
<cleanup_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <close_down_nicely@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cleanup_buffers>:
push   %rax
xor    %eax,%eax
call   1030 <close_down_nicely@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @cleanup_buffers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @close_down_nicely()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @cleanup_buffers(i32 %0) {
%2 = tail call i32 (...) @close_down_nicely()
%3 = tail call i32 @exit(i32 0)
unreachable
}
const char *Cyc_Core_get_exn_name(void *x) { return *(char **)x; }


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

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

LLVM IR (-O0):
define i8* @Cyc_Core_get_exn_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @Cyc_Core_get_exn_name(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  volatile uint32_t *ptr = (volatile uint32_t *)0xa0000000;
  *ptr = 0x11223344;
  printf("------- or1k_main -----\n");
  printf("--> %x\n", *ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa0000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x11223344,(%rax)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa0000000,%ebx
movl   $0x11223344,(%rbx)
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"------- or1k_main -----\0A\00"
@.str.1 = [8 x i8] c"--> %x\0A\00"
define void @main() {
%1 = alloca i32*
store i32* inttoptr (i64 2684354560 to i32*), i32** %1
%2 = load i32*, i32** %1
store volatile i32 287454020, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %1
%5 = load volatile i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"--> %x\0A\00"
@str = [24 x i8] c"------- or1k_main -----\00"
define void @main() {
store volatile i32 287454020, i32* inttoptr (i64 2684354560 to i32*)
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2684354560 to i32*)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void htmlImage(char *fileName, int width, int height) {
  printf("<P ALIGN=\"CENTER\"><IMG SRC=\"%s\" WIDTH=\"%d\" HEIGHT=\"%d\" "
         "ALIGN=\"BOTTOM\" BORDER=\"0\"></P>",
         fileName, width, height);
}


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

x86 assembly (clang, -O2):
<htmlImage>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"<P ALIGN=\22CENTER\22><IMG SRC=\22%s\22 WIDTH=\22%d\22 HEIGHT=\22%d\22 ALIGN=\22BOTTOM\22 BORDER=\220\22></P>\00"
define void @htmlImage(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"<P ALIGN=\22CENTER\22><IMG SRC=\22%s\22 WIDTH=\22%d\22 HEIGHT=\22%d\22 ALIGN=\22BOTTOM\22 BORDER=\220\22></P>\00"
define void @htmlImage(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ isLowerExtendedLetter(unsigned char);
scalar_t__ isLowerRegularLetter(unsigned char);
short int isLowerLetter(unsigned char chrsource) {
  if (isLowerRegularLetter(chrsource) || isLowerExtendedLetter(chrsource))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLowerLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1040 <isLowerRegularLetter@plt>
cmp    $0x0,%rax
jne    1154 <isLowerLetter+0x34>
movzbl -0x3(%rbp),%edi
call   1030 <isLowerExtendedLetter@plt>
cmp    $0x0,%rax
je     115f <isLowerLetter+0x3f>
movw   $0x1,-0x2(%rbp)
jmp    1165 <isLowerLetter+0x45>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLowerLetter>:
push   %rbx
mov    %edi,%ebx
call   1040 <isLowerRegularLetter@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isLowerLetter+0x16>
pop    %rbx
ret
movzbl %bl,%edi
call   1030 <isLowerExtendedLetter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @isLowerLetter(i8 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isLowerRegularLetter(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @isLowerExtendedLetter(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 1, i16* %2
br label %13
12: ; preds = %7
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isLowerLetter(i8 zeroext %0) {
%2 = tail call i64 @isLowerRegularLetter(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isLowerExtendedLetter(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ cudaDeviceSynchronize();
void optional_device_synchronize() { cudaDeviceSynchronize(); }


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

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

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

LLVM IR (-O2):
define void @optional_device_synchronize() {
%1 = tail call i32 (...) @cudaDeviceSynchronize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA5_DMA21_DriverIRQHandler();
__attribute__((weak)) void DMA5_DMA21_IRQHandler(void) {
  DMA5_DMA21_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA5_DMA21_IRQHandler() {
%1 = call i32 (...) @DMA5_DMA21_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA5_DMA21_IRQHandler() {
%1 = tail call i32 (...) @DMA5_DMA21_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void sigrt_act_handler(int signo, siginfo_t *info, void *context) {}


x86 assembly (clang, -O0):
<sigrt_act_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sigrt_act_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @sigrt_act_handler(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
int watchpoint_stop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @watchpoint_stop() {
ret i32 0
}
int test_imm_3Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x3c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Cint64_midword_reg>:
test   $0x3c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Cint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 60
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_3Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3932160
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int bar(float, double);
int foo(int a) { return bar(1.0f, 2.0) + a + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
call   1030 <bar@plt>
add    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
movss  0xee5(%rip),%xmm0
movsd  0xee5(%rip),%xmm1
call   1030 <bar@plt>
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @bar(float 1.000000e+00, double 2.000000e+00)
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @bar(float 1.000000e+00, double 2.000000e+00)
%3 = add i32 %0, 1
%4 = add i32 %3, %2
ret i32 %4
}
void *__dlsym(void *p, const char *s, void *ra) { return 0; }


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

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

LLVM IR (-O0):
define i8* @__dlsym(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 i8* null
}

LLVM IR (-O2):
define noalias i8* @__dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("\n\tUsage: hi [hostname]\n");
  printf("\t   -a: nothing to do.\n");
  printf("\t   -b: nothing to do.\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0A\09Usage: hi [hostname]\0A\00"
@.str.1 = [24 x i8] c"\09 -a: nothing to do.\0A\00"
@.str.2 = [24 x i8] c"\09 -b: nothing to do.\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"\0A\09Usage: hi [hostname]\00"
@str.4 = [23 x i8] c"\09 -a: nothing to do.\00"
@str.5 = [23 x i8] c"\09 -b: nothing to do.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void largeAdjustmentGT(unsigned a) {
  char *b = ((void *)0);
  if (a - 2 > (0x7fffffff * 2U + 1U) - 1)
    b = malloc(1);
  if (a == 1 || a == 0)
    free(b);
  else if (a > 1)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<largeAdjustmentGT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cmp    $0xfffffffe,%eax
jbe    1150 <largeAdjustmentGT+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1164 <largeAdjustmentGT+0x44>
cmpl   $0x0,-0x4(%rbp)
jne    1172 <largeAdjustmentGT+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    118a <largeAdjustmentGT+0x6a>
cmpl   $0x1,-0x4(%rbp)
jbe    1185 <largeAdjustmentGT+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    118a <largeAdjustmentGT+0x6a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largeAdjustmentGT>:
cmp    $0x1,%edi
jne    113c <largeAdjustmentGT+0x1c>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
add    $0x8,%rsp
jmp    1030 <free@plt>
xor    %edi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @largeAdjustmentGT(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = sub i32 %4, 2
%6 = icmp ugt i32 %5, -2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12, %9
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
br label %25
18: ; preds = %12
%19 = load i32, i32* %2
%20 = icmp ugt i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %15
ret void
}

LLVM IR (-O2):
define void @largeAdjustmentGT(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
scalar_t__ isgraph(char);
__attribute__((pure)) int isGraphChar(char chr) {
  return (isgraph(chr) || (chr & 0x80));
}


x86 assembly (clang, -O0):
<isGraphChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isgraph@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    114b <isGraphChar+0x3b>
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGraphChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
setne  %al
test   %bl,%bl
sets   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isGraphChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isgraph(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isGraphChar(i8 signext %0) {
%2 = tail call i64 @isgraph(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i8 %0, 0
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int abs(unsigned long);
int fuzzyMatch(unsigned long reference, unsigned long value,
               unsigned int threshold) {
  return (((abs(reference - value) * 1000 * 2) / (reference + value)) <
          threshold);
}


x86 assembly (clang, -O0):
<fuzzyMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
sub    -0x10(%rbp),%rdi
call   1030 <abs@plt>
imul   $0x3e8,%eax,%eax
shl    $0x1,%eax
cltq
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    -0x14(%rbp),%ecx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzzyMatch>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
sub    %rsi,%rdi
call   1030 <abs@plt>
imul   $0x7d0,%eax,%eax
movslq %eax,%rcx
add    %rbp,%rbx
mov    %rcx,%rdx
or     %rbx,%rdx
shr    $0x20,%rdx
je     1147 <fuzzyMatch+0x37>
mov    %rcx,%rax
xor    %edx,%edx
div    %rbx
jmp    114b <fuzzyMatch+0x3b>
xor    %edx,%edx
div    %ebx
mov    %r14d,%edx
xor    %ecx,%ecx
cmp    %rdx,%rax
setb   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fuzzyMatch(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub i64 %7, %8
%10 = call i32 @abs(i64 %9)
%11 = mul nsw i32 %10, 1000
%12 = mul nsw i32 %11, 2
%13 = sext i32 %12 to i64
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = add i64 %14, %15
%17 = udiv i64 %13, %16
%18 = load i32, i32* %6
%19 = zext i32 %18 to i64
%20 = icmp ult i64 %17, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @fuzzyMatch(i64 %0, i64 %1, i32 %2) {
%4 = sub i64 %0, %1
%5 = tail call i32 @abs(i64 %4)
%6 = mul i32 %5, 2000
%7 = sext i32 %6 to i64
%8 = add i64 %1, %0
%9 = udiv i64 %7, %8
%10 = zext i32 %2 to i64
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ PTR_DIFF(void *, int /*<<< orphan*/);
int set_message_bcc(char *, int /*<<< orphan*/);
int /*<<< orphan*/ smb_buf(char *);
int set_message_end(void *outbuf, void *end_ptr) {
  return set_message_bcc((char *)outbuf,
                         PTR_DIFF(end_ptr, smb_buf((char *)outbuf)));
}


x86 assembly (clang, -O0):
<set_message_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <smb_buf@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1050 <PTR_DIFF@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <set_message_bcc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_message_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <smb_buf@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <PTR_DIFF@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <set_message_bcc@plt>

LLVM IR (-O0):
define i32 @set_message_end(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 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @smb_buf(i8* %7)
%9 = call i32 @PTR_DIFF(i8* %6, i32 %8)
%10 = call i32 @set_message_bcc(i8* %5, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_message_end(i8* %0, i8* %1) {
%3 = tail call i32 @smb_buf(i8* %0)
%4 = tail call i32 @PTR_DIFF(i8* %1, i32 %3)
%5 = tail call i32 @set_message_bcc(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int link(const char *oldpath, const char *newpath) {
  int ret = (int)_syscall5(44, (void *)oldpath, (void *)newpath, ((void *)0),
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x2c,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1164 <link+0x54>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e8a(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <link+0x5a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2c,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     112f <link+0x1f>
pop    %rcx
ret
neg    %eax
mov    0x2ea8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @_syscall5(i32 44, i8* %7, i8* %8, i8* null, i8* null, i8* null)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = sub nsw i32 0, %14
store i32 %15, i32* @errno
store i32 -1, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = tail call i64 @_syscall5(i32 44, i8* %0, i8* %1, i8* null, i8* null, i8* null)
%4 = trunc i64 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ %4, %2 ]
ret i32 %9
}
int is_strictly_positive(int elem) { return (elem > 0); }


x86 assembly (clang, -O0):
<is_strictly_positive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_strictly_positive>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @is_strictly_positive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_strictly_positive(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *newstr;
  newstr = (char *)malloc(strlen(str) + 1);
  if (newstr)
    strcpy(newstr, str);
  return newstr;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ breakpoint();
int /*<<< orphan*/ set_debug_traps();
main() {
  set_debug_traps();
  breakpoint();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_debug_traps@plt>
mov    $0x0,%al
call   1030 <breakpoint@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @set_debug_traps()
%2 = tail call i32 (...) @breakpoint()
ret i32 0
}