xunge/DecIR huggingface dataset:
/* Type definitions */
struct passwd {
  char *pw_dir;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void get_user_tagfile(char *user, char *tagfile) {
  struct passwd *pw;
  pw = getpwnam(user);
  sprintf(tagfile, "%s/%s", pw->pw_dir, ".authtag");
}


x86 assembly (clang, -O0):
<get_user_tagfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb1(%rip),%rsi
lea    0xeb0(%rip),%rcx
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_tagfile>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getpwnam@plt>
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
lea    0xecc(%rip),%rcx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [9 x i8] c".authtag\00"
define void @get_user_tagfile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.passwd*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call %struct.passwd* @getpwnam(i8* %6)
store %struct.passwd* %7, %struct.passwd** %5
%8 = load i8*, i8** %4
%9 = load %struct.passwd*, %struct.passwd** %5
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [9 x i8] c".authtag\00"
define void @get_user_tagfile(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = tail call %struct.passwd* @getpwnam(i8* %0)
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %3, i64 0, i32 0
%5 = load i8*, i8** %4
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void XtParent() {}


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

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

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

LLVM IR (-O2):
define void @XtParent() {
ret void
}
void foo_2_1_1_2_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_1_1_2_1() {
ret void
}
int privsep_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @privsep_enabled() {
ret i32 0
}
/* Variables and functions */
unsigned long long __t1mskc_u64(unsigned long long);
unsigned long long test__t1mskc_u64(unsigned long long a) {
  return __t1mskc_u64(a);
}


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

x86 assembly (clang, -O2):
<test__t1mskc_u64>:
jmp    1030 <__t1mskc_u64@plt>

LLVM IR (-O0):
define i64 @test__t1mskc_u64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @__t1mskc_u64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test__t1mskc_u64(i64 %0) {
%2 = tail call i64 @__t1mskc_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
unsigned long long _andn_u64(unsigned long, unsigned long);
unsigned long long test_andn_u64(unsigned long __X, unsigned long __Y) {
  return _andn_u64(__X, __Y);
}


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

x86 assembly (clang, -O2):
<test_andn_u64>:
jmp    1030 <_andn_u64@plt>

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

LLVM IR (-O2):
define i64 @test_andn_u64(i64 %0, i64 %1) {
%3 = tail call i64 @_andn_u64(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hellow World\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 = [14 x i8] c"Hellow World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hellow World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ acl_save();
int /*<<< orphan*/ dump_channels();
int /*<<< orphan*/ save_bans();
int /*<<< orphan*/ userdb_dump();
void dump_state(void) {
  userdb_dump();
  save_bans();
  dump_channels();
  acl_save();
}


x86 assembly (clang, -O0):
<dump_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <userdb_dump@plt>
mov    $0x0,%al
call   1030 <save_bans@plt>
mov    $0x0,%al
call   1050 <dump_channels@plt>
mov    $0x0,%al
call   1060 <acl_save@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_state>:
push   %rax
xor    %eax,%eax
call   1040 <userdb_dump@plt>
xor    %eax,%eax
call   1030 <save_bans@plt>
xor    %eax,%eax
call   1050 <dump_channels@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <acl_save@plt>

LLVM IR (-O0):
define void @dump_state() {
%1 = call i32 (...) @userdb_dump()
%2 = call i32 (...) @save_bans()
%3 = call i32 (...) @dump_channels()
%4 = call i32 (...) @acl_save()
ret void
}

LLVM IR (-O2):
define void @dump_state() {
%1 = tail call i32 (...) @userdb_dump()
%2 = tail call i32 (...) @save_bans()
%3 = tail call i32 (...) @dump_channels()
%4 = tail call i32 (...) @acl_save()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
void deleteWindow(WINDOW *window) {
  curs_set(1);
  clear();
  endwin();
}


x86 assembly (clang, -O0):
<deleteWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1040 <clear@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteWindow>:
push   %rax
mov    $0x1,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
call   1040 <clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @deleteWindow(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @curs_set(i32 1)
%4 = call i32 (...) @clear()
%5 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @deleteWindow(i32* nocapture readnone %0) {
%2 = tail call i32 @curs_set(i32 1)
%3 = tail call i32 (...) @clear()
%4 = tail call i32 (...) @endwin()
ret void
}
void test_111(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 12; }


x86 assembly (clang, -O0):
<test_111>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0xc,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_111>:
movzwl 0x2(%rdi),%eax
shr    $0xc,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_111(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 12
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_111(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 12
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
double centimetresToMillimetres(double centimetres) {
  return centimetres * 10.0;
}


x86 assembly (clang, -O0):
<centimetresToMillimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<centimetresToMillimetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @centimetresToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @centimetresToMillimetres(double %0) {
%2 = fmul double %0, 1.000000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114b <Key+0x2b>
jmp    1144 <Key+0x24>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     112d <Key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %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 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
%12 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_cpp_va_args(void) {
  test("foo, bar, baz", "#define p(...) foo, __VA_ARGS__\n"
                        "p(bar, baz)");
}


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

x86 assembly (clang, -O2):
<TEST_cpp_va_args>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"foo, bar, baz\00"
@.str.1 = [44 x i8] c"#define p(...) foo, __VA_ARGS__\0Ap(bar, baz)\00"
define void @TEST_cpp_va_args() {
%1 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"foo, bar, baz\00"
@.str.1 = [44 x i8] c"#define p(...) foo, __VA_ARGS__\0Ap(bar, baz)\00"
define void @TEST_cpp_va_args() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_value(int, int);
void unlock_sem(int sem) { set_value(sem, 1); }


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

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

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

LLVM IR (-O2):
define void @unlock_sem(i32 %0) {
%2 = tail call i32 @set_value(i32 %0, i32 1)
ret void
}
void NV12ToRGB24Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_AVX2() {
ret void
}
/* Type definitions */
typedef int uint32_t;
struct _WsbmFenceObject {
  int dummy;
};

/* Variables and functions */
int wsbmFenceSignaledType(struct _WsbmFenceObject *, int, int *);
int wsbmFenceSignaled(struct _WsbmFenceObject *fence, uint32_t flush_type) {
  uint32_t signaled_types;
  int ret = wsbmFenceSignaledType(fence, flush_type, &signaled_types);
  if (ret)
    return 0;
  return ((signaled_types & flush_type) == flush_type);
}


x86 assembly (clang, -O0):
<wsbmFenceSignaled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1030 <wsbmFenceSignaledType@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1148 <wsbmFenceSignaled+0x38>
movl   $0x0,-0x4(%rbp)
jmp    115c <wsbmFenceSignaled+0x4c>
mov    -0x18(%rbp),%eax
and    -0x14(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsbmFenceSignaled>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <wsbmFenceSignaledType@plt>
mov    0xc(%rsp),%edx
not    %edx
and    %ebx,%edx
xor    %ecx,%ecx
or     %eax,%edx
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._WsbmFenceObject = type { i32 }
define i32 @wsbmFenceSignaled(%struct._WsbmFenceObject* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct._WsbmFenceObject*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct._WsbmFenceObject* %0, %struct._WsbmFenceObject** %4
store i32 %1, i32* %5
%8 = load %struct._WsbmFenceObject*, %struct._WsbmFenceObject** %4
%9 = load i32, i32* %5
%10 = call i32 @wsbmFenceSignaledType(%struct._WsbmFenceObject* %8, i32 %9, i32* %6)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = and i32 %15, %16
%18 = load i32, i32* %5
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct._WsbmFenceObject = type { i32 }
define i32 @wsbmFenceSignaled(%struct._WsbmFenceObject* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @wsbmFenceSignaledType(%struct._WsbmFenceObject* %0, i32 %1, i32* %3)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %3
%8 = and i32 %7, %1
%9 = icmp eq i32 %8, %1
%10 = select i1 %6, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
char alphabetCheck(char in) {
  char fact1 = (in >= 'a') && (in <= 'z');
  char fact2 = (in >= 'A') && (in <= 'Z');
  return (char)(fact1 || fact2);
}


x86 assembly (clang, -O0):
<alphabetCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x4(%rbp)
jl     1129 <alphabetCheck+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x5(%rbp)
jl     1153 <alphabetCheck+0x53>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
jne    117d <alphabetCheck+0x7d>
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabetCheck>:
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define signext i8 @alphabetCheck(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ false, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br label %23
23: ; preds = %19, %12
%24 = phi i1 [ false, %12 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %23
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br label %34
34: ; preds = %30, %23
%35 = phi i1 [ true, %23 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
%37 = trunc i32 %36 to i8
ret i8 %37
}

LLVM IR (-O2):
define signext i8 @alphabetCheck(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
char *make_scalar(char *, char *);
char *upper(char *field) { return make_scalar("UPPER", field); }


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

x86 assembly (clang, -O2):
<upper>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <make_scalar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"UPPER\00"
define i8* @upper(i8* %0) {
%2 = tail call i8* @make_scalar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
double double_nextup(double);
double double_nextdown(double x) { return -double_nextup(-x); }


x86 assembly (clang, -O0):
<double_nextdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <double_nextup@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_nextdown>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <double_nextup@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @double_nextdown(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @double_nextup(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @double_nextdown(double %0) {
%2 = fneg double %0
%3 = tail call double @double_nextup(double %2)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
float __ocml_sin_f32(float);
float sinf(float x) { return __ocml_sin_f32(x); }


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

x86 assembly (clang, -O2):
<sinf>:
jmp    1030 <__ocml_sin_f32@plt>

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float @__ocml_sin_f32(float %0)
ret float %2
}
adr0adr1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*((unsigned short *)10000000)) <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzwl (%rax),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1143 <adr0adr1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <adr0adr1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1>:
movzwl 0x989680,%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = zext i16 %16 to i32
%18 = load i16, i16* inttoptr (i64 11111111 to i16*)
%19 = zext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = load i16, i16* inttoptr (i64 11111111 to i16*)
%9 = icmp ule i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t cpu_read_cr0() {
  uint64_t ret = 0;
  __asm__ __volatile__("movq %%"
                       "cr0"
                       ", %0"
                       : "=r"(ret));
  return (ret);
}


x86 assembly (clang, -O0):
<cpu_read_cr0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    %cr0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_read_cr0>:
mov    %cr0,%rax
ret

LLVM IR (-O0):
define i8* @cpu_read_cr0() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* asm sideeffect "movq %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @cpu_read_cr0() {
%1 = tail call i8* asm sideeffect "movq %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  if (number % 2 == 0) {
    printf("The number is even.\n");
  } else {
    printf("The number is odd.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xed8(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [21 x i8] c"The number is even.\0A\00"
@.str.2 = [20 x i8] c"The number is odd.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"The number is odd.\00"
@str.3 = [20 x i8] c"The number is even.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
int thread_db_attach(struct gdbserv *serv, struct gdbserv_target *target) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.gdbserv = type opaque
%struct.gdbserv_target = type opaque
define i32 @thread_db_attach(%struct.gdbserv* %0, %struct.gdbserv_target* %1) {
%3 = alloca %struct.gdbserv*
%4 = alloca %struct.gdbserv_target*
store %struct.gdbserv* %0, %struct.gdbserv** %3
store %struct.gdbserv_target* %1, %struct.gdbserv_target** %4
ret i32 0
}

LLVM IR (-O2):
%struct.gdbserv = type opaque
%struct.gdbserv_target = type opaque
define i32 @thread_db_attach(%struct.gdbserv* nocapture readnone %0, %struct.gdbserv_target* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __sighandler_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ SIG_ERR;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__sighandler_t signal(int sig, __sighandler_t handler) {
  __set_errno(ENOSYS);
  return SIG_ERR;
}


x86 assembly (clang, -O0):
<signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@SIG_ERR = global i32 0
define i32 @signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
%7 = load i32, i32* @SIG_ERR
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@SIG_ERR = global i32 0
define i32 @signal(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
%5 = load i32, i32* @SIG_ERR
ret i32 %5
}
unsigned int PtrTo32(void *ptr) { return ((unsigned int)ptr); }


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

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

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

LLVM IR (-O2):
define i32 @PtrTo32(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ basicIntake(int);
int /*<<< orphan*/ wait1Msec(int);
void timedIntake(int power, int time) {
  basicIntake(power);
  wait1Msec(time);
  basicIntake(0);
}


x86 assembly (clang, -O0):
<timedIntake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <basicIntake@plt>
mov    -0x8(%rbp),%edi
call   1030 <wait1Msec@plt>
xor    %edi,%edi
call   1040 <basicIntake@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timedIntake>:
push   %rbx
mov    %esi,%ebx
call   1040 <basicIntake@plt>
mov    %ebx,%edi
call   1030 <wait1Msec@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <basicIntake@plt>

LLVM IR (-O0):
define void @timedIntake(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @basicIntake(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @wait1Msec(i32 %7)
%9 = call i32 @basicIntake(i32 0)
ret void
}

LLVM IR (-O2):
define void @timedIntake(i32 %0, i32 %1) {
%3 = tail call i32 @basicIntake(i32 %0)
%4 = tail call i32 @wait1Msec(i32 %1)
%5 = tail call i32 @basicIntake(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmove_cp_4a4t_b_bc();
int main() {
  gmove_cp_4a4t_b_bc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_cp_4a4t_b_bc()
ret i32 0
}
/* Variables and functions */
int __syscall_rename(char const *, char const *);
int rename(const char *oldpath, const char *newpath) {
  return __syscall_rename(oldpath, newpath);
}


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

x86 assembly (clang, -O2):
<rename>:
jmp    1030 <__syscall_rename@plt>

LLVM IR (-O0):
define i32 @rename(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 = call i32 @__syscall_rename(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i32 @__syscall_rename(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ KeyboardFunc(int, int /*<<< orphan*/, int /*<<< orphan*/);
void MenuFunc(int value) { KeyboardFunc(value, 0, 0); }


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

x86 assembly (clang, -O2):
<MenuFunc>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <KeyboardFunc@plt>

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

LLVM IR (-O2):
define void @MenuFunc(i32 %0) {
%2 = tail call i32 @KeyboardFunc(i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int age, days;
  age = 25;
  days = 365 * age;
  printf("You've past about %d days since you born!\n", days);
  return 0;
}


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

LLVM IR (-O0):
@.str = [43 x i8] c"You've past about %d days since you born!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 25, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 365, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"You've past about %d days since you born!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 9125)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ rcmdfn(int, int, char **);
int main(int argc, char **argv) { exit(rcmdfn(1, argc, argv)); }


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    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <rcmdfn@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <rcmdfn@plt>
mov    %eax,%edi
call   1040 <exit@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @rcmdfn(i32 1, i32 %6, i8** %7)
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @rcmdfn(i32 1, i32 %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ trap(char *);
void trap_irq(void) { trap("IRQ"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"IRQ\00"
define void @trap_irq() {
%1 = call i32 @trap(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"IRQ\00"
define void @trap_irq() {
%1 = tail call i32 @trap(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
short C_ISNAN(double);
int main() {
  short x = C_ISNAN(0.0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call signext i16 @C_ISNAN(double 0.000000e+00)
store i16 %3, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i16 @C_ISNAN(double 0.000000e+00)
ret i32 0
}
unsigned long int unsignedlongint_ignoring_signedshort(unsigned long int x,
                                                       signed short y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_signedshort(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Type definitions */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mtp3_start(struct ss7 *);
int ss7_start(struct ss7 *ss7) {
  mtp3_start(ss7);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.ss7 = type { i32 }
define i32 @ss7_start(%struct.ss7* %0) {
%2 = tail call i32 @mtp3_start(%struct.ss7* %0)
ret i32 0
}
void test(int a, int b) { printf("%d, %d\n", &a, &b); }


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
ret void
}
int ld_ble_cr2(long double a1) { return !(__builtin_islessequal(100, a1)); }


x86 assembly (clang, -O0):
<ld_ble_cr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_cr2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ld_ble_cr2(x86_fp80 %0) {
%2 = fcmp ult x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int listen(int, int);
bool makeListenSocket(int socket) {
  int err = listen(socket, 1);
  return !err;
}


x86 assembly (clang, -O0):
<makeListenSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <listen@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeListenSocket>:
push   %rax
mov    $0x1,%esi
call   1030 <listen@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @makeListenSocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @listen(i32 %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @makeListenSocket(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *buf) {
  void *real_buf = NULL;
  if (buf != NULL)
    real_buf = (char *)buf - sizeof(size_t);
  free(real_buf);
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <mem_free+0x2b>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_free>:
lea    -0x8(%rdi),%rax
test   %rdi,%rdi
cmovne %rax,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mem_free(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = getelementptr inbounds i8, i8* %0, i64 -8
%4 = select i1 %2, i8* null, i8* %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m118refreshNT();
int /*<<< orphan*/ mmc3setParams8000(int /*<<< orphan*/, int /*<<< orphan*/);
void m118setParams8000(uint16_t addr, uint8_t val) {
  mmc3setParams8000(addr, val);
  m118refreshNT();
}


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

x86 assembly (clang, -O2):
push   %rax
call   1040 <mmc3setParams8000@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <m118refreshNT@plt>

LLVM IR (-O0):
define void @m118setParams8000(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @mmc3setParams8000(i32 %5, i32 %6)
%8 = call i32 (...) @m118refreshNT()
ret void
}

LLVM IR (-O2):
define void @m118setParams8000(i32 %0, i32 %1) {
%3 = tail call i32 @mmc3setParams8000(i32 %0, i32 %1)
%4 = tail call i32 (...) @m118refreshNT()
ret void
}
void gdk_pango_renderer_set_override_color() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pango_renderer_set_override_color() {
ret void
}
/* Variables and functions */
int MAP_32BIT;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
void *ljmm_mmap(int /*<<< orphan*/ *, size_t, int, int, int,
                int /*<<< orphan*/);
void *mmap_wrap(size_t len) {
  return ljmm_mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_32BIT | MAP_PRIVATE,
                   -1, 0);
}


x86 assembly (clang, -O0):
<mmap_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ea0(%rip),%rax
or     (%rax),%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%ecx
mov    0x2e86(%rip),%rax
or     (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <ljmm_mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap_wrap>:
mov    0x2ed9(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ecf(%rip),%rax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
jmp    1030 <ljmm_mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_32BIT = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @mmap_wrap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @PROT_READ
%5 = load i32, i32* @PROT_WRITE
%6 = or i32 %4, %5
%7 = load i32, i32* @MAP_32BIT
%8 = load i32, i32* @MAP_PRIVATE
%9 = or i32 %7, %8
%10 = call i8* @ljmm_mmap(i32* null, i64 %3, i32 %6, i32 %9, i32 -1, i32 0)
ret i8* %10
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_32BIT = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @mmap_wrap(i64 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_32BIT
%6 = load i32, i32* @MAP_PRIVATE
%7 = or i32 %6, %5
%8 = tail call i8* @ljmm_mmap(i32* null, i64 %0, i32 %4, i32 %7, i32 -1, i32 0)
ret i8* %8
}
double to_power(unsigned base, unsigned exp) {
  double v;
  v = 1;
  while (exp--) {
    v *= base;
  }
  return v;
}


x86 assembly (clang, -O0):
<to_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1142 <to_power+0x42>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1117 <to_power+0x17>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_power>:
test   %esi,%esi
je     1166 <to_power+0x66>
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
lea    -0x1(%rsi),%eax
mov    %esi,%ecx
and    $0x7,%ecx
je     116f <to_power+0x6f>
xor    %edx,%edx
movsd  0xee1(%rip),%xmm0
nop
mulsd  %xmm1,%xmm0
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <to_power+0x20>
sub    %edx,%esi
cmp    $0x7,%eax
jb     1165 <to_power+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0xfffffff8,%esi
jne    1140 <to_power+0x40>
ret
movsd  0xe92(%rip),%xmm0
ret
movsd  0xe89(%rip),%xmm0
cmp    $0x7,%eax
jae    1140 <to_power+0x40>
jmp    1165 <to_power+0x65>

LLVM IR (-O0):
define double @to_power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = uitofp i32 %11 to double
%13 = load double, double* %5
%14 = fmul double %13, %12
store double %14, double* %5
br label %6
15: ; preds = %6
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @to_power(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %35, label %4
4: ; preds = %2
%5 = uitofp i32 %0 to double
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp eq i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %4, %9
%10 = phi double [ %14, %9 ], [ 1.000000e+00, %4 ]
%11 = phi i32 [ %13, %9 ], [ %1, %4 ]
%12 = phi i32 [ %15, %9 ], [ 0, %4 ]
%13 = add i32 %11, -1
%14 = fmul double %10, %5
%15 = add i32 %12, 1
%16 = icmp eq i32 %15, %7
br i1 %16, label %17, label %9
17: ; preds = %9, %4
%18 = phi double [ undef, %4 ], [ %14, %9 ]
%19 = phi double [ 1.000000e+00, %4 ], [ %14, %9 ]
%20 = phi i32 [ %1, %4 ], [ %13, %9 ]
%21 = icmp ult i32 %6, 7
br i1 %21, label %35, label %22
22: ; preds = %17, %22
%23 = phi double [ %33, %22 ], [ %19, %17 ]
%24 = phi i32 [ %32, %22 ], [ %20, %17 ]
%25 = fmul double %23, %5
%26 = fmul double %25, %5
%27 = fmul double %26, %5
%28 = fmul double %27, %5
%29 = fmul double %28, %5
%30 = fmul double %29, %5
%31 = fmul double %30, %5
%32 = add i32 %24, -8
%33 = fmul double %31, %5
%34 = icmp eq i32 %32, 0
br i1 %34, label %35, label %22
35: ; preds = %17, %22, %2
%36 = phi double [ 1.000000e+00, %2 ], [ %18, %17 ], [ %33, %22 ]
ret double %36
}