xunge/DecIR huggingface dataset:
int addDigitsInner(int num) {
  int sum = 0;
  while (num != 0) {
    sum += num % 10;
    num /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<addDigitsInner>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <addDigitsInner+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <addDigitsInner+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigitsInner>:
xor    %eax,%eax
test   %edi,%edi
je     113b <addDigitsInner+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <addDigitsInner+0x10>
ret

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

LLVM IR (-O2):
define i32 @addDigitsInner(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ pidaux();
int main(int argc, char *argv[]) { pidaux(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @pidaux()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pool_debug_value(void) {
  printf("debug %d\n", 2);
  printf("debug %d\n", (2 + 1));
  printf("debug %d\n", 2);
}


x86 assembly (clang, -O0):
<pool_debug_value>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_debug_value>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"debug %d\0A\00"
define void @pool_debug_value() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage:  %s [ -adfseun ] [ -l {depth} ] [filenames ...]\n",
          prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: %s [ -adfseun ] [ -l {depth} ] [filenames ...]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: %s [ -adfseun ] [ -l {depth} ] [filenames ...]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ clearerr(int /*<<< orphan*/);
void my_clearerr(struct aFILE *fp) { clearerr(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_clearerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_clearerr>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <clearerr@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define void @my_clearerr(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @clearerr(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define void @my_clearerr(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @clearerr(i32 %2)
ret void
}
void handle_49(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_49(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Usage: \n  %s [-i <ip>] [-p <port>] [-l <port>] [-a] messages \n\n"
         "Options:\n"
         "  -i , --ip , tcp server ip(default:192.168.1.10)\n"
         "  -p,  --port, tcp server port(default:2000 \n"
         "  -l, --local, local port(default: 30000)\n"
         "  -a, --ascii, ascii message (default:hexadecimal digit)\n"
         "  -h, --help    Print this message\n"
         "messages format:\n"
         "   when have option -a, ascii message be sent\n"
         "   when no option -a, hexadecimal digit be sent\n"
         "       hexadecimal digit format:\n"
         "          header 9d9d (2bytes)\n"
         "          length      (1bytes)\n"
         "	  data        (user input)\n"
         "	  checksum     (1bytes)\n"
         "\n",
         name);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [562 x i8] c"Usage: \0A %s [-i <ip>] [-p <port>] [-l <port>] [-a] messages \0A\0AOptions:\0A -i , --ip , tcp server ip(default:192.168.1.10)\0A -p, --port, tcp server port(default:2000 \0A -l, --local, local port(default: 30000)\0A -a, --ascii, ascii message (default:hexadecimal digit)\0A -h, --help Print this message\0Amessages format:\0A when have option -a, ascii message be sent\0A when no option -a, hexadecimal digit be sent\0A hexadecimal digit format:\0A header 9d9d (2bytes)\0A length (1bytes)\0A\09 data (user input)\0A\09 checksum (1bytes)\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([562 x i8], [562 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [562 x i8] c"Usage: \0A %s [-i <ip>] [-p <port>] [-l <port>] [-a] messages \0A\0AOptions:\0A -i , --ip , tcp server ip(default:192.168.1.10)\0A -p, --port, tcp server port(default:2000 \0A -l, --local, local port(default: 30000)\0A -a, --ascii, ascii message (default:hexadecimal digit)\0A -h, --help Print this message\0Amessages format:\0A when have option -a, ascii message be sent\0A when no option -a, hexadecimal digit be sent\0A hexadecimal digit format:\0A header 9d9d (2bytes)\0A length (1bytes)\0A\09 data (user input)\0A\09 checksum (1bytes)\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([562 x i8], [562 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((no)) int myfunc2(void *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @myfunc2(i8* nocapture readnone %0) {
ret i32 0
}
void samplemenu(int menuID) {}


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

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

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

LLVM IR (-O2):
define void @samplemenu(i32 %0) {
ret void
}
void check_options_udp_rr(struct options *opts, struct callbacks *cb) {}


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

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

LLVM IR (-O0):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_udp_rr(%struct.options* %0, %struct.callbacks* %1) {
%3 = alloca %struct.options*
%4 = alloca %struct.callbacks*
store %struct.options* %0, %struct.options** %3
store %struct.callbacks* %1, %struct.callbacks** %4
ret void
}

LLVM IR (-O2):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_udp_rr(%struct.options* nocapture %0, %struct.callbacks* nocapture %1) {
ret void
}
unsigned int FLASH_GetSectors(unsigned int *startSector,
                              unsigned int *endSector) {
  *startSector = 13;
  *endSector = 13;
}


x86 assembly (clang, -O0):
<FLASH_GetSectors>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xd,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLASH_GetSectors>:
movl   $0xd,(%rdi)
movl   $0xd,(%rsi)
ret

LLVM IR (-O0):
define i32 @FLASH_GetSectors(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** %4
store i32 13, i32* %6
%7 = load i32*, i32** %5
store i32 13, i32* %7
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @FLASH_GetSectors(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 13, i32* %0
store i32 13, i32* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ do_nothing();
void handle(int sig) { do_nothing(); }


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

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

LLVM IR (-O0):
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @do_nothing()
ret void
}

LLVM IR (-O2):
define void @handle(i32 %0) {
%2 = tail call i32 (...) @do_nothing()
ret void
}
/* Variables and functions */
void test1() {
  int *s1 = NULL;
  *s1 = 42;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test1() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ combination(char *, int, int);
int main(void) {
  char array[] = {'a', 'b', 'c'};
  int len = (int)sizeof(array) / sizeof(char);
  combination(array, len, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x3,-0xc(%rbp)
lea    -0x7(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <combination@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x63,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <combination@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.array = [3 x i8] c"abc"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i8]* %2 to i8*
store i32 3, i32* %3
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @combination(i8* %5, i32 %6, i32 1)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [3 x i8] c"abc"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @combination(i8* %2, i32 3, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deinitGPUCounters();
void deinitDroidPwMgmt(void) { deinitGPUCounters(); }


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

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

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

LLVM IR (-O2):
define void @deinitDroidPwMgmt() {
%1 = tail call i32 (...) @deinitGPUCounters()
ret void
}
int compare(const void *a, const void *b) {
  int va = *(int *)a;
  int vb = *(int *)b;
  if (va > vb)
    return 1;
  else if (va < vb)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <compare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <compare+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ isupper(unsigned char);
unsigned char tolower(unsigned char c) {
  if (isupper(c)) {
    c -= 'A' - 'a';
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
movzbl -0x1(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isupper(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %8, -32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = tail call i64 @isupper(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage() {
  fputs("./mlock <n_megs>\n", stderr);
  fputs("./mlock 64\n", stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xee3(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"./mlock <n_megs>\0A\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"./mlock 64\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"./mlock <n_megs>\0A\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"./mlock 64\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int pfd() { syscall(34, 0, 0, 0); }


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

x86 assembly (clang, -O2):
<pfd>:
mov    $0x22,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @pfd() {
%1 = tail call i32 @syscall(i32 34, i32 0, i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/, int,
                           int /*<<< orphan*/);
char *Eth_Comms_Version(char *param) {
  static char version[64];
  sprintf(version, "VERSION,Smokin'Pi v%u.%03u.%03u", 0, 3, 0);
  return version;
}


x86 assembly (clang, -O0):
<Eth_Comms_Version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f1d(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %r8d,%r8d
mov    $0x3,%ecx
mov    %r8d,%edx
call   1030 <sprintf@plt>
lea    0x2eff(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Eth_Comms_Version>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@Eth_Comms_Version.version = internal global [64 x i8] zeroinitializer
@.str = [32 x i8] c"VERSION,Smokin'Pi v%u.%03u.%03u\00"
define i8* @Eth_Comms_Version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @Eth_Comms_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @Eth_Comms_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@Eth_Comms_Version.version = internal global [64 x i8] zeroinitializer
@.str = [32 x i8] c"VERSION,Smokin'Pi v%u.%03u.%03u\00"
define i8* @Eth_Comms_Version(i8* nocapture readnone %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @Eth_Comms_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @Eth_Comms_Version.version, i64 0, i64 0)
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA6_get(void) { return U_WMRCORENONE_get("U_WMRA6"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA6\00"
define i32 @U_WMRA6_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA6\00"
define i32 @U_WMRA6_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int registerCharacterSet(const char *charset) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @registerCharacterSet(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
double exp(double);
long double y(long double x) {
  return ((1.0 / 4.0) * x - (3.0 / 16.0) + (19.0 / 16.0) * exp(4.0 * x));
}


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xed9(%rip)
fmul   %st(1),%st
flds   0xed5(%rip)
faddp  %st,%st(1)
fstpt  -0x2c(%rbp)
flds   0xece(%rip)
fmulp  %st,%st(1)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
fldt   -0x2c(%rbp)
movsd  0xebc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
faddp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fmuls  0xee0(%rip)
fadds  0xede(%rip)
fstpt  0x1c(%rsp)
fmuls  0xed8(%rip)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <exp@plt>
mulsd  0xec9(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
fldt   0x1c(%rsp)
faddl  0x8(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @y(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK3FFD8000000000000000, x86_fp80 %3, x86_fp80 0xKBFFCC000000000000000)
%5 = load x86_fp80, x86_fp80* %2
%6 = fmul x86_fp80 0xK40018000000000000000, %5
%7 = fptrunc x86_fp80 %6 to double
%8 = call double @exp(double %7)
%9 = fmul double 1.187500e+00, %8
%10 = fpext double %9 to x86_fp80
%11 = fadd x86_fp80 %4, %10
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @y(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 0xK3FFD8000000000000000, x86_fp80 0xKBFFCC000000000000000)
%3 = fmul x86_fp80 %0, 0xK40018000000000000000
%4 = fptrunc x86_fp80 %3 to double
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 1.187500e+00
%7 = fpext double %6 to x86_fp80
%8 = fadd x86_fp80 %2, %7
ret x86_fp80 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SETSIZE;
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int event_check(int fd) {
  fd_set rfds;
  FD_ZERO(&rfds);
  FD_SET(fd, &rfds);
  return select(FD_SETSIZE, &rfds, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<event_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_check>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FD_SETSIZE = global i32 0
define i32 @event_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %3)
%7 = load i32, i32* @FD_SETSIZE
%8 = call i32 @select(i32 %7, i32* %3, i32* null, i32* null, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@FD_SETSIZE = global i32 0
define i32 @event_check(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 %0, i32* %2)
%6 = load i32, i32* @FD_SETSIZE
%7 = call i32 @select(i32 %6, i32* %2, i32* null, i32* null, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int i;
  if (i - 1) {
    assert(i == 2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     1138 <main+0x28>
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = sub nsw i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int spi_flash_get_chip_size(void) { return (1024 * 1024 * 1024); }


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

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

LLVM IR (-O0):
define i32 @spi_flash_get_chip_size() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @spi_flash_get_chip_size() {
ret i32 1073741824
}
void PrintPNSimpleCompareFunction3(void *theEnv, const char *logicalName,
                                   void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintPNSimpleCompareFunction3(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_mult_vecNf(float *, float const *, float const *, int);
void vec3f_mult_vec3f(float m[9], const float A[3], const float B[3]) {
  vecNf_mult_vecNf(m, A, B, 3);
}


x86 assembly (clang, -O0):
<vec3f_mult_vec3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3,%ecx
call   1030 <vecNf_mult_vecNf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3f_mult_vec3f>:
mov    $0x3,%ecx
jmp    1030 <vecNf_mult_vecNf@plt>

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

LLVM IR (-O2):
define void @vec3f_mult_vec3f(float* %0, float* %1, float* %2) {
%4 = tail call i32 @vecNf_mult_vecNf(float* %0, float* %1, float* %2, i32 3)
ret void
}
/* Variables and functions */
int ipc_connect(int *, char *, int /*<<< orphan*/);
int uip_connect(int *fd) {
  return ipc_connect(fd, "ISCSID_UIP_ABSTRACT_NAMESPACE", 0);
}


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

x86 assembly (clang, -O2):
<uip_connect>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ipc_connect@plt>

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

LLVM IR (-O2):
@.str = [30 x i8] c"ISCSID_UIP_ABSTRACT_NAMESPACE\00"
define i32 @uip_connect(i32* %0) {
%2 = tail call i32 @ipc_connect(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}
void AddParameter(unsigned long *ParameterList, unsigned long *Parameter) {}


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

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

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

LLVM IR (-O2):
define void @AddParameter(i64* nocapture %0, i64* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawFlashDamage();
int /*<<< orphan*/ CG_DrawFlashFade();
int /*<<< orphan*/ CG_DrawFlashFire();
int /*<<< orphan*/ CG_DrawFlashLightning();
void CG_DrawFlashBlend(void) {
  CG_DrawFlashLightning();
  CG_DrawFlashFire();
  CG_DrawFlashDamage();
  CG_DrawFlashFade();
}


x86 assembly (clang, -O0):
<CG_DrawFlashBlend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CG_DrawFlashLightning@plt>
mov    $0x0,%al
call   1060 <CG_DrawFlashFire@plt>
mov    $0x0,%al
call   1050 <CG_DrawFlashDamage@plt>
mov    $0x0,%al
call   1040 <CG_DrawFlashFade@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawFlashBlend>:
push   %rax
xor    %eax,%eax
call   1030 <CG_DrawFlashLightning@plt>
xor    %eax,%eax
call   1060 <CG_DrawFlashFire@plt>
xor    %eax,%eax
call   1050 <CG_DrawFlashDamage@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CG_DrawFlashFade@plt>

LLVM IR (-O0):
define void @CG_DrawFlashBlend() {
%1 = call i32 (...) @CG_DrawFlashLightning()
%2 = call i32 (...) @CG_DrawFlashFire()
%3 = call i32 (...) @CG_DrawFlashDamage()
%4 = call i32 (...) @CG_DrawFlashFade()
ret void
}

LLVM IR (-O2):
define void @CG_DrawFlashBlend() {
%1 = tail call i32 (...) @CG_DrawFlashLightning()
%2 = tail call i32 (...) @CG_DrawFlashFire()
%3 = tail call i32 (...) @CG_DrawFlashDamage()
%4 = tail call i32 (...) @CG_DrawFlashFade()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink9() {
  int c = 0;
  while (c != 4) {
    blinkdash();
    c++;
  }
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     115e <blink9+0x2e>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <blink9+0xf>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xe93(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink9>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xea4(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink9() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 4
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdash()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (...) @blinkdot()
%11 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink9() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 (...) @blinkdot()
%6 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void httpParser_Init() {}


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

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

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

LLVM IR (-O2):
define void @httpParser_Init() {
ret void
}
int test_imm_A3int16_mem(short *val) {
  return ((*val) & (0xA3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A3int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A3int16_mem>:
testb  $0xa3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A3int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 163
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test(double);
int testf(float);
int testl(long double);
int main() {
  if (testf(3.40282346638528859811704183484516925e+38F) < 1)
    abort();
  if (test(((double)1.79769313486231570814527423731704357e+308L)) < 1)
    abort();
  if (testl(1.18973149535723176502126385303097021e+4932L) < 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xea9(%rip),%xmm0
call   1040 <testf@plt>
cmp    $0x1,%eax
jge    116c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xe94(%rip),%xmm0
call   1060 <test@plt>
cmp    $0x1,%eax
jge    1189 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
mov    %rsp,%rax
fldt   0xe7e(%rip)
fstpt  (%rax)
call   1050 <testl@plt>
cmp    $0x1,%eax
jge    11a9 <main+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movss  0xeb4(%rip),%xmm0
call   1040 <testf@plt>
test   %eax,%eax
jle    117f <main+0x3f>
movsd  0xeab(%rip),%xmm0
call   1060 <test@plt>
test   %eax,%eax
jle    117f <main+0x3f>
fldt   0xea4(%rip)
fstpt  (%rsp)
call   1050 <testl@plt>
test   %eax,%eax
jle    117f <main+0x3f>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testf(float 0x47EFFFFFE0000000)
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @test(double 0x7FEFFFFFFFFFFFFF)
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @testl(x86_fp80 0xK7FFEFFFFFFFFFFFFFFFF)
%13 = icmp slt i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testf(float 0x47EFFFFFE0000000)
%2 = icmp slt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @test(double 0x7FEFFFFFFFFFFFFF)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @testl(x86_fp80 0xK7FFEFFFFFFFFFFFFFFFF)
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}
double k_to_c(double kelvin) { return kelvin - 273.15; }


x86 assembly (clang, -O0):
<k_to_c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @k_to_c(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 2.731500e+02
ret double %4
}

LLVM IR (-O2):
define double @k_to_c(double %0) {
%2 = fadd double %0, -2.731500e+02
ret double %2
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=600 REPO_URL=heads/master REVISION=-62b44da "
         "CHANGED_REVISION=62b44da CHANGE_DATE=2014-10-17 09:47:06 +0530 "
         "BUILD_DATE=Fri Oct 17 11:58:49 IST 2014 BUILD=release "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [400 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/master REVISION=-62b44da CHANGED_REVISION=62b44da CHANGE_DATE=2014-10-17 09:47:06 +0530 BUILD_DATE=Fri Oct 17 11:58:49 IST 2014 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [400 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/master REVISION=-62b44da CHANGED_REVISION=62b44da CHANGE_DATE=2014-10-17 09:47:06 +0530 BUILD_DATE=Fri Oct 17 11:58:49 IST 2014 BUILD=release TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int loopy();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = loopy();
  printf("%d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <loopy@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @loopy()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
struct expression const *expr_generic();
const struct expression *expr_list(const struct expression *expr_list,
                                   const struct expression *expr) {
  return expr_generic();
}


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

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

LLVM IR (-O0):
%struct.expression = type { i32 }
define %struct.expression* @expr_list(%struct.expression* %0, %struct.expression* %1) {
%3 = alloca %struct.expression*
%4 = alloca %struct.expression*
store %struct.expression* %0, %struct.expression** %3
store %struct.expression* %1, %struct.expression** %4
%5 = call %struct.expression* (...) @expr_generic()
ret %struct.expression* %5
}

LLVM IR (-O2):
%struct.expression = type { i32 }
define %struct.expression* @expr_list(%struct.expression* nocapture readnone %0, %struct.expression* nocapture readnone %1) {
%3 = tail call %struct.expression* (...) @expr_generic()
ret %struct.expression* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (int i = 0; i <= 10; i++)
    printf("*");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 42)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @putchar(i32 42)
%11 = tail call i32 @putchar(i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ M_Menu_StartServer_f();
void StartNetworkServerFunc(void *unused) { M_Menu_StartServer_f(); }


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

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

LLVM IR (-O0):
define void @StartNetworkServerFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @M_Menu_StartServer_f()
ret void
}

LLVM IR (-O2):
define void @StartNetworkServerFunc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @M_Menu_StartServer_f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count(int);
void op_dcount() { count(1); }


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

x86 assembly (clang, -O2):
<op_dcount>:
mov    $0x1,%edi
jmp    1030 <count@plt>

LLVM IR (-O0):
define void @op_dcount() {
%1 = call i32 @count(i32 1)
ret void
}

LLVM IR (-O2):
define void @op_dcount() {
%1 = tail call i32 @count(i32 1)
ret void
}