xunge/DecIR huggingface dataset:
char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
                 unsigned long int n, int category) {
  return (char *)((n == 1) ? msgid1 : msgid2);
}


x86 assembly (clang, -O0):
<dcngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    1130 <dcngettext+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1138 <dcngettext+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcngettext>:
mov    %rsi,%rax
cmp    $0x1,%rcx
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i8* @dcngettext(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i64, i64* %9
%12 = icmp eq i64 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = load i8*, i8** %7
br label %17
15: ; preds = %5
%16 = load i8*, i8** %8
br label %17
17: ; preds = %15, %13
%18 = phi i8* [ %14, %13 ], [ %16, %15 ]
ret i8* %18
}

LLVM IR (-O2):
define i8* @dcngettext(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2, i64 %3, i32 %4) {
%6 = icmp eq i64 %3, 1
%7 = select i1 %6, i8* %1, i8* %2
ret i8* %7
}
void cmp_drv_platform_deinit(struct CmpDrvPlatform *drv) { (void)drv; }


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

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

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

LLVM IR (-O2):
%struct.CmpDrvPlatform = type opaque
define void @cmp_drv_platform_deinit(%struct.CmpDrvPlatform* nocapture %0) {
ret void
}
void test_strcmp() {}


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

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

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

LLVM IR (-O2):
define void @test_strcmp() {
ret void
}
/* Variables and functions */
long atol(char *);
char *strchr(char *, char);
int parse_keyval(char *s, long *val) {
  char *p;
  p = strchr(s, '=');
  if (!p)
    return -1;
  *val = atol(p + 1);
  return p - s;
}


x86 assembly (clang, -O0):
<parse_keyval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <parse_keyval+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <parse_keyval+0x5e>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atol@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_keyval>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1151 <parse_keyval+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <atol@plt>
mov    %rax,(%r15)
sub    %r14d,%ebx
jmp    1156 <parse_keyval+0x36>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @parse_keyval(i8* %0, i64* nocapture writeonly %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i64 @atol(i8* %6)
store i64 %7, i64* %1
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %2, %5
%13 = phi i32 [ %11, %5 ], [ -1, %2 ]
ret i32 %13
}
int _gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return _gcd(b, a % b);
}


x86 assembly (clang, -O0):
<_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <_gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <_gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void TELL_PARENT(pid_t pid) { kill(pid, SIGUSR2); }


x86 assembly (clang, -O0):
<TELL_PARENT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TELL_PARENT>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR2 = global i32 0
define void @TELL_PARENT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR2
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
define void @TELL_PARENT(i32 %0) {
%2 = load i32, i32* @SIGUSR2
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_field_arguments(int, char **);
int /*<<< orphan*/ parse_program_arguments(int, char **);
void parse_arguments(int argc, char *argv[]) {
  parse_program_arguments(argc, argv);
  parse_field_arguments(argc, argv);
}


x86 assembly (clang, -O0):
<parse_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_program_arguments@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_field_arguments@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_arguments>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <parse_program_arguments@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <parse_field_arguments@plt>

LLVM IR (-O0):
define void @parse_arguments(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @parse_program_arguments(i32 %5, i8** %6)
%8 = load i32, i32* %3
%9 = load i8**, i8*** %4
%10 = call i32 @parse_field_arguments(i32 %8, i8** %9)
ret void
}

LLVM IR (-O2):
define void @parse_arguments(i32 %0, i8** %1) {
%3 = tail call i32 @parse_program_arguments(i32 %0, i8** %1)
%4 = tail call i32 @parse_field_arguments(i32 %0, i8** %1)
ret void
}
long hex4CharToLong(unsigned char b0, unsigned char b1, unsigned char b2,
                    unsigned char b3) {
  return (b0 << 12) + (b1 << 8) + (b2 << 4) + b3;
}


x86 assembly (clang, -O0):
<hex4CharToLong>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0xc,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x3(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movzbl -0x4(%rbp),%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex4CharToLong>:
mov    %edi,%eax
shl    $0xc,%rax
mov    %esi,%esi
shl    $0x8,%rsi
add    %rax,%rsi
mov    %edx,%edx
shl    $0x4,%rdx
add    %rsi,%rdx
mov    %ecx,%eax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @hex4CharToLong(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 12
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %11, %14
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 4
%19 = add nsw i32 %15, %18
%20 = load i8, i8* %8
%21 = zext i8 %20 to i32
%22 = add nsw i32 %19, %21
%23 = sext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @hex4CharToLong(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i64
%6 = shl nuw nsw i64 %5, 12
%7 = zext i8 %1 to i64
%8 = shl nuw nsw i64 %7, 8
%9 = add nuw nsw i64 %8, %6
%10 = zext i8 %2 to i64
%11 = shl nuw nsw i64 %10, 4
%12 = add nuw nsw i64 %9, %11
%13 = zext i8 %3 to i64
%14 = add nuw nsw i64 %12, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage goes here\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Usage goes here\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Usage goes here\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long long getticks(void) {
  unsigned hi, lo;
  __asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
  return ((unsigned long long)lo) | (((unsigned long long)hi) << 32);
}


x86 assembly (clang, -O0):
<getticks>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getticks>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @getticks() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %1
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @getticks() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
const char *trio_strerror(int errorcode) { return "Unknown"; }


x86 assembly (clang, -O0):
<trio_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Unknown\00"
define i8* @trio_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
define i8* @trio_strerror(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getusec(void) {
  struct timeval tv;
  uint64_t usec;
  gettimeofday(&tv, NULL);
  usec = ((uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec);
  return usec;
}


x86 assembly (clang, -O0):
<getusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @getusec() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @getusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
int do_223() { return 223; }


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

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

LLVM IR (-O0):
define i32 @do_223() {
ret i32 223
}

LLVM IR (-O2):
define i32 @do_223() {
ret i32 223
}
double dfn_rd() { return 6; }


x86 assembly (clang, -O0):
<dfn_rd>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @dfn_rd() {
ret double 6.000000e+00
}

LLVM IR (-O2):
define double @dfn_rd() {
ret double 6.000000e+00
}
/* Variables and functions */
unsigned char *hmac_whirlpool(unsigned char *, unsigned char const *, size_t,
                              unsigned char const *, size_t);
unsigned char *mac_hmac_whirlpool(unsigned char *out, const unsigned char *key,
                                  size_t key_len, const unsigned char *msg,
                                  size_t msg_len) {
  return hmac_whirlpool(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_whirlpool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_whirlpool@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_whirlpool>:
jmp    1030 <hmac_whirlpool@plt>

LLVM IR (-O0):
define i8* @mac_hmac_whirlpool(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_whirlpool(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_whirlpool(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_whirlpool(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
int strlen(char const *);
char *strstr(char *, char const *);
char *StrNext(char *pBuffer, const char *S) {
  if (!pBuffer)
    return NULL;
  char *p = strstr(pBuffer, S);
  return (p) ? p : (p + strlen(S));
}


x86 assembly (clang, -O0):
<StrNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <StrNext+0x28>
movq   $0x0,-0x8(%rbp)
jmp    119a <StrNext+0x7a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1171 <StrNext+0x51>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1192 <StrNext+0x72>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrNext>:
push   %rbx
test   %rdi,%rdi
je     1135 <StrNext+0x15>
mov    %rsi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     1139 <StrNext+0x19>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @StrNext(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @strlen(i8* %1)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* null, i64 %9
br label %11
11: ; preds = %7, %4, %2
%12 = phi i8* [ null, %2 ], [ %10, %7 ], [ %5, %4 ]
ret i8* %12
}
double powerfact(double x, long n) {
  if (n > 0)
    return (powerfact(x, n - 1) * x) / n;
  else if (n == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<powerfact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    1157 <powerfact+0x47>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <powerfact@plt>
mulsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <powerfact+0x6c>
cmpq   $0x0,-0x18(%rbp)
jne    1174 <powerfact+0x64>
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <powerfact+0x6c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerfact>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
jle    113d <powerfact+0x2d>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
movsd  %xmm0,0x8(%rsp)
call   1030 <powerfact@plt>
mulsd  0x8(%rsp),%xmm0
cvtsi2sd %rbx,%xmm1
divsd  %xmm1,%xmm0
jmp    114d <powerfact+0x3d>
je     1145 <powerfact+0x35>
xorpd  %xmm0,%xmm0
jmp    114d <powerfact+0x3d>
movsd  0xeb3(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @powerfact(double %0, i64 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i64
store double %0, double* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load double, double* %4
%10 = load i64, i64* %5
%11 = sub nsw i64 %10, 1
%12 = call double @powerfact(double %9, i64 %11)
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = load i64, i64* %5
%16 = sitofp i64 %15 to double
%17 = fdiv double %14, %16
store double %17, double* %3
br label %23
18: ; preds = %2
%19 = load i64, i64* %5
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
store double 1.000000e+00, double* %3
br label %23
22: ; preds = %18
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %21, %8
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @powerfact(double %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %6, label %12
4: ; preds = %12, %6
%5 = phi double [ %11, %6 ], [ %14, %12 ]
ret double %5
6: ; preds = %2
%7 = add nsw i64 %1, -1
%8 = tail call double @powerfact(double %0, i64 %7)
%9 = fmul double %8, %0
%10 = sitofp i64 %1 to double
%11 = fdiv double %9, %10
br label %4
12: ; preds = %2
%13 = icmp eq i64 %1, 0
%14 = select i1 %13, double 1.000000e+00, double 0.000000e+00
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *foo(char *, char *);
int main(void) {
  char buf[6];
  if (foo(buf, &buf[2]) != &buf[3])
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xa(%rbp),%rsi
add    $0x2,%rsi
call   1040 <foo@plt>
lea    -0xa(%rbp),%rcx
add    $0x3,%rcx
cmp    %rcx,%rax
je     1158 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
lea    0x2(%rsp),%rdi
call   1040 <foo@plt>
lea    0x5(%rsp),%rcx
cmp    %rcx,%rax
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
%5 = call i8* @foo(i8* %3, i8* %4)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
%4 = call i8* @foo(i8* %2, i8* %3)
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
%6 = icmp eq i8* %4, %5
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CameraDesiredHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void CameraDesiredUpdated() { UAVObjUpdated(CameraDesiredHandle()); }


x86 assembly (clang, -O0):
<CameraDesiredUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CameraDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CameraDesiredUpdated() {
%1 = call i32 (...) @CameraDesiredHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CameraDesiredUpdated() {
%1 = tail call i32 (...) @CameraDesiredHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int *ptr = NULL;
  printf("Address: %p", ptr);
  printf("Value: %d", *ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Address: %p\00"
@.str.1 = [10 x i8] c"Value: %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Address: %p\00"
@.str.1 = [10 x i8] c"Value: %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ main_loop();
int main(int argc, char **argv) {
  main_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @main_loop()
ret i32 0
}
int add(a, b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ system(char *);
int win() {
  puts("B-baka! It's not like I like you or anything!");
  system("/bin/sh");
}


x86 assembly (clang, -O0):
<win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1040 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"B-baka! It's not like I like you or anything!\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @win() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [46 x i8] c"B-baka! It's not like I like you or anything!\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @win() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a[2] = {0, 1};
  foo(a);
  test_assert(a[1] == 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <foo@plt>
cmpl   $0x8,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x100000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %edi,%edi
cmpl   $0x8,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 0, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 8
%9 = zext i1 %8 to i32
%10 = call i32 @test_assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [2 x i32]*
%3 = bitcast i64* %1 to i8*
store i64 4294967296, i64* %1
%4 = bitcast i64* %1 to i32*
%5 = call i32 @foo(i32* %4)
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 8
%9 = zext i1 %8 to i32
%10 = call i32 @test_assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_double(double);
int /*<<< orphan*/ test_float(float);
int main() {
  test_float(0.0e0f);
  test_float(1.0e30f);
  test_double(0.0e0);
  test_double(1.0e30);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
call   1030 <test_float@plt>
movss  0xec9(%rip),%xmm0
call   1030 <test_float@plt>
xorps  %xmm0,%xmm0
call   1040 <test_double@plt>
movsd  0xeac(%rip),%xmm0
call   1040 <test_double@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
call   1030 <test_float@plt>
movss  0xecf(%rip),%xmm0
call   1030 <test_float@plt>
xorps  %xmm0,%xmm0
call   1040 <test_double@plt>
movsd  0xec2(%rip),%xmm0
call   1040 <test_double@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_float(float 0.000000e+00)
%3 = call i32 @test_float(float 0x46293E5940000000)
%4 = call i32 @test_double(double 0.000000e+00)
%5 = call i32 @test_double(double 1.000000e+30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_float(float 0.000000e+00)
%2 = tail call i32 @test_float(float 0x46293E5940000000)
%3 = tail call i32 @test_double(double 0.000000e+00)
%4 = tail call i32 @test_double(double 1.000000e+30)
ret i32 0
}
/* Variables and functions */
int fnv1_hash(void **, int);
int hash_character(void *key) { return fnv1_hash(&key, sizeof(char)); }


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

x86 assembly (clang, -O2):
<hash_character>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <fnv1_hash@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_character(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fnv1_hash(i8** %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @hash_character(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fnv1_hash(i8** %2, i32 1)
ret i32 %3
}
/* Variables and functions */
char *gettext(char const *);
char *_(const char *__msgid) { return gettext(__msgid); }


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

x86 assembly (clang, -O2):
<_>:
jmp    1030 <gettext@plt>

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

LLVM IR (-O2):
define i8* @_(i8* %0) {
%2 = tail call i8* @gettext(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ neko_alloc_string(char *);
int /*<<< orphan*/ neko_val_throw(int /*<<< orphan*/);
void handle_signal(int signal) {
  neko_val_throw(neko_alloc_string("Segmentation fault"));
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <neko_alloc_string@plt>
mov    %eax,%edi
call   1040 <neko_val_throw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <neko_alloc_string@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <neko_val_throw@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Segmentation fault\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @neko_alloc_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @neko_val_throw(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Segmentation fault\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 @neko_alloc_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @neko_val_throw(i32 %2)
ret void
}
void outc(x) {
  wrn(x);
  wrc(' ');
}


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

x86 assembly (clang, -O2):
<outc>:
push   %rax
xor    %eax,%eax
call   1040 <wrn@plt>
mov    $0x20,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <wrc@plt>

LLVM IR (-O0):
define void @outc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @wrn to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
ret void
}

LLVM IR (-O2):
define void @outc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrn to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @wrc to i32 (i32, ...)*)(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void banner_dash(void) {
  printf("                =======================================\n");
}


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

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

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

LLVM IR (-O2):
@str = [56 x i8] c" =======================================\00"
define void @banner_dash() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(void *value) {
  int *intPtr = (int *)value;
  printf("%d", *intPtr);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void XRayShutdown(struct XRayTraceCapture *capture) {}


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

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

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

LLVM IR (-O2):
%struct.XRayTraceCapture = type opaque
define void @XRayShutdown(%struct.XRayTraceCapture* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int sum_array(int **, int);
main() {
  int values[5][2] = {{2, 4}, {16, 27}, {14, 11}, {34, 19}, {6, 9}};
  int sum = 0;
  sum = sum_array(values, 5);
  printf("The sum of the array is %d", sum);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sum_array@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <sum_array@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.values = [5 x [2 x i32]] [[2 x i32] [i32 2, i32 4], [2 x i32] [i32 16, i32 27], [2 x i32] [i32 14, i32 11], [2 x i32] [i32 34, i32 19], [2 x i32] [i32 6, i32 9]]
@.str = [27 x i8] c"The sum of the array is %d\00"
define i32 @main() {
%1 = alloca [5 x [2 x i32]]
%2 = alloca i32
%3 = bitcast [5 x [2 x i32]]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %1, i64 0, i64 0
%5 = bitcast [2 x i32]* %4 to i32**
%6 = call i32 @sum_array(i32** %5, i32 5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [5 x [2 x i32]] [[2 x i32] [i32 2, i32 4], [2 x i32] [i32 16, i32 27], [2 x i32] [i32 14, i32 11], [2 x i32] [i32 34, i32 19], [2 x i32] [i32 6, i32 9]]
@.str = [27 x i8] c"The sum of the array is %d\00"
define i32 @main() {
%1 = alloca [5 x [2 x i32]]
%2 = bitcast [5 x [2 x i32]]* %1 to i8*
%3 = bitcast [5 x [2 x i32]]* %1 to i32**
%4 = call i32 @sum_array(i32** %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
void ARGBToRGB24Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fail();
int main(void) {
  int a;
  int x;
  {
    if (a > 0) {
      x = 2;
    } else {
      x = 3;
    }
    if (x == 2) {
      { __fail(); }
    } else {
    }
    return (a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1135 <main+0x25>
movl   $0x2,-0xc(%rbp)
jmp    113c <main+0x2c>
movl   $0x3,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1152 <main+0x42>
mov    $0x0,%al
call   1030 <__fail@plt>
jmp    1157 <main+0x47>
jmp    1157 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void yyerror(char *msg) { printf("SDD error: %s \n", msg); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"SDD error: %s \0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"SDD error: %s \0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ parse_statment();
int parse_prgrm() {
  while (parse_statment())
    ;
}


x86 assembly (clang, -O0):
<parse_prgrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <parse_statment@plt>
cmp    $0x0,%rax
je     112e <parse_prgrm+0x1e>
jmp    1118 <parse_prgrm+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_prgrm>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <parse_statment@plt>
test   %rax,%rax
jne    1120 <parse_prgrm+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parse_prgrm() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @parse_statment()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @parse_prgrm() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @parse_statment()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ insertionSort(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char string[100];
  printf("Type away!: ");
  gets(string);
  insertionSort(string);
  printf("%s", string);
  return;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <insertionSort@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Type away!: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @insertionSort(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Type away!: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @insertionSort(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findandjump(int, char *);
void xlcontinue(void) { findandjump(0x0020, "not in a break loop"); }


x86 assembly (clang, -O0):
<xlcontinue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
lea    0xee0(%rip),%rsi
call   1030 <findandjump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlcontinue>:
lea    0xee9(%rip),%rsi
mov    $0x20,%edi
jmp    1030 <findandjump@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcontinue() {
%1 = call i32 @findandjump(i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcontinue() {
%1 = tail call i32 @findandjump(i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}