xunge/DecIR huggingface dataset:
int test_imm_2Cint32_reg(int val) { return ((val) & (0x2C << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_2Cint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cint32_reg>:
test   $0x2c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Cint32_reg(i32 %0) {
%2 = and i32 %0, 44
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x8a() {
  Assert_real((isalpha(138) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              695, ("isalpha should be 0 for 0x8a"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x8a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8a,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2b7,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x8a\00"
define void @t_isalpha_0x8a() {
%1 = call i64 @isalpha(i32 138)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x8a\00"
define void @t_isalpha_0x8a() {
%1 = tail call i64 @isalpha(i32 138)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ purge_file(char *);
int main(int argc, char **argv) {
  int i;
  if (argc < 2)
    return 1;
  for (i = 1; i < argc; ++i)
    purge_file(argv[i]);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x65>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <purge_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1149 <main+0x39>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <purge_file@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %26
10: ; preds = %2
store i32 1, i32* %6
br label %11
11: ; preds = %22, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @purge_file(i8* %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %11
25: ; preds = %11
store i32 0, i32* %3
br label %26
26: ; preds = %25, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @purge_file(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %14
}
void glIsBuffer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glIsBuffer() {
ret void
}
unsigned int disabled_uint(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @disabled_uint() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ httpdate_snprint(char *, int, int /*<<< orphan*/);
int printf(char *, char *);
int header_last_modified(time_t mtime) {
  char buf[30];
  httpdate_snprint(buf, 30, mtime);
  return printf("Last-Modified: %s\n", buf);
}


x86 assembly (clang, -O0):
<header_last_modified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x1e,%esi
call   1040 <httpdate_snprint@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_last_modified>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1040 <httpdate_snprint@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Last-Modified: %s\0A\00"
define i32 @header_last_modified(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @httpdate_snprint(i8* %4, i32 30, i32 %5)
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [19 x i8] c"Last-Modified: %s\0A\00"
define i32 @header_last_modified(i32 %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @httpdate_snprint(i8* %3, i32 30, i32 %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int main(int argc, char **argv) {
  initialize();
  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 <initialize@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initialize@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 (...) @initialize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initialize()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ b;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun(char b[100]) {
  printf("##[sjin] in fun sizeof(b):\t%d \n", sizeof(b));
}


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

x86 assembly (clang, -O2):
<fun>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"##[sjin] in fun sizeof(b):\09%d \0A\00"
define void @fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"##[sjin] in fun sizeof(b):\09%d \0A\00"
define void @fun(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int encode_int64_internal(unsigned char *, unsigned long long);
int /*<<< orphan*/ evbuffer_add(struct evbuffer *, unsigned char *, int);
void evtag_encode_int64(struct evbuffer *evbuf, unsigned long long number) {
  unsigned char data[9];
  int len = encode_int64_internal(data, number);
  evbuffer_add(evbuf, data, len);
}


x86 assembly (clang, -O0):
<evtag_encode_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x19(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <encode_int64_internal@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x19(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1040 <evbuffer_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evtag_encode_int64>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xf(%rsp),%r14
mov    %r14,%rdi
call   1030 <encode_int64_internal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <evbuffer_add@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define void @evtag_encode_int64(%struct.evbuffer* %0, i64 %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i64
%5 = alloca [9 x i8]
%6 = alloca i32
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i64 %1, i64* %4
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = call i32 @encode_int64_internal(i8* %7, i64 %8)
store i32 %9, i32* %6
%10 = load %struct.evbuffer*, %struct.evbuffer** %3
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %6
%13 = call i32 @evbuffer_add(%struct.evbuffer* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define void @evtag_encode_int64(%struct.evbuffer* %0, i64 %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = call i32 @encode_int64_internal(i8* %4, i64 %1)
%6 = call i32 @evbuffer_add(%struct.evbuffer* %0, i8* %4, i32 %5)
ret void
}
/* Variables and functions */
unsigned int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnDPORT(unsigned sock) {
  unsigned res = w5100_readSn_byte(sock, 0x0010);
  res = (res << 8) + w5100_readSn_byte(sock, 0x0010 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x11,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x10,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
mov    $0x11,%esi
call   1030 <w5100_readSn_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @w5100_readSnDPORT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @w5100_readSn_byte(i32 %4, i32 16)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %2
%9 = call i32 @w5100_readSn_byte(i32 %8, i32 17)
%10 = add i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @w5100_readSnDPORT(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 16)
%3 = shl i32 %2, 8
%4 = tail call i32 @w5100_readSn_byte(i32 %0, i32 17)
%5 = add i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ free(char const **);
char **prepare_perf_cmd(char const **);
int execv_perf_cmd(const char **argv) {
  const char **nargv = prepare_perf_cmd(argv);
  execvp("perf", (char **)nargv);
  free(nargv);
  return -1;
}


x86 assembly (clang, -O0):
<execv_perf_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <prepare_perf_cmd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <execvp@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execv_perf_cmd>:
push   %rbx
call   1040 <prepare_perf_cmd@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1050 <execvp@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"perf\00"
define i32 @execv_perf_cmd(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i8** @prepare_perf_cmd(i8** %4)
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = call i32 @execvp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6)
%8 = load i8**, i8*** %3
%9 = call i32 @free(i8** %8)
ret i32 -1
}

LLVM IR (-O2):
@.str = [5 x i8] c"perf\00"
define i32 @execv_perf_cmd(i8** %0) {
%2 = tail call i8** @prepare_perf_cmd(i8** %0)
%3 = tail call i32 @execvp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2)
%4 = tail call i32 @free(i8** %2)
ret i32 -1
}
void set_audio_driver_from_str(const char *tmp) {
  (void)tmp;
  return;
}


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

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

LLVM IR (-O0):
define void @set_audio_driver_from_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @set_audio_driver_from_str(i8* nocapture %0) {
ret void
}
int test_imm_D7uint16_reg(unsigned short val) {
  return ((val) & (0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D7uint16_reg>:
test   $0xd7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 215
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void main(void) { int x; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ drawlogin();
int /*<<< orphan*/ init();
int main() {
  init();
  drawlogin();
  destroy();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @drawlogin()
%3 = tail call i32 (...) @destroy()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
void delay(unsigned secs) {
  unsigned i;
  for (i = 0; i < secs; i++) {
    mdelay(1000);
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1146 <delay+0x36>
mov    $0x3e8,%edi
call   1030 <mdelay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
test   %edi,%edi
je     112f <delay+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <mdelay@plt>
add    $0xffffffff,%ebx
jne    1120 <delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @mdelay(i32 1000)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @mdelay(i32 1000)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int stdio_close(void *this) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stdio_close(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_packs_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_packs_epi32(__m128i A, __m128i B) {
  return _mm_packs_epi32(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_packs_epi32>:
jmp    1030 <_mm_packs_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_packs_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_packs_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
unsigned long gfx_get_cpu_register_base(void) {
  return gfx_pci_config_read(0x80000918);
}


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

x86 assembly (clang, -O2):
<gfx_get_cpu_register_base>:
mov    $0x80000918,%edi
jmp    1030 <gfx_pci_config_read@plt>

LLVM IR (-O0):
define i64 @gfx_get_cpu_register_base() {
%1 = call i64 @gfx_pci_config_read(i32 -2147481320)
ret i64 %1
}

LLVM IR (-O2):
define i64 @gfx_get_cpu_register_base() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147481320)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
int /*<<< orphan*/ RDP_E(char *);
void uc0_rdphalf_1() {
  RDP_E("uc0:rdphalf_1 - IGNORED\n");
  RDP("uc0:rdphalf_1 - IGNORED\n");
}


x86 assembly (clang, -O0):
<uc0_rdphalf_1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <RDP_E@plt>
lea    0xec9(%rip),%rdi
call   1040 <RDP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc0_rdphalf_1>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <RDP_E@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <RDP@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"uc0:rdphalf_1 - IGNORED\0A\00"
define void @uc0_rdphalf_1() {
%1 = call i32 @RDP_E(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @RDP(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"uc0:rdphalf_1 - IGNORED\0A\00"
define void @uc0_rdphalf_1() {
%1 = tail call i32 @RDP_E(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @RDP(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
float ffiTestFloats7(float f1, float f2, float f3, float f4, float f5, float f6,
                     float f7) {
  ;
  return (float)(f1 + f2 + f3 + f4 + f5 + f6 + f7);
}


x86 assembly (clang, -O0):
<ffiTestFloats7>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffiTestFloats7>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
addss  %xmm3,%xmm0
addss  %xmm4,%xmm0
addss  %xmm5,%xmm0
addss  %xmm6,%xmm0
ret

LLVM IR (-O0):
define float @ffiTestFloats7(float %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store float %6, float* %14
%15 = load float, float* %8
%16 = load float, float* %9
%17 = fadd float %15, %16
%18 = load float, float* %10
%19 = fadd float %17, %18
%20 = load float, float* %11
%21 = fadd float %19, %20
%22 = load float, float* %12
%23 = fadd float %21, %22
%24 = load float, float* %13
%25 = fadd float %23, %24
%26 = load float, float* %14
%27 = fadd float %25, %26
ret float %27
}

LLVM IR (-O2):
define float @ffiTestFloats7(float %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = fadd float %0, %1
%9 = fadd float %8, %2
%10 = fadd float %9, %3
%11 = fadd float %10, %4
%12 = fadd float %11, %5
%13 = fadd float %12, %6
ret float %13
}
void foo2(void) {}


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

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

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

LLVM IR (-O2):
define void @foo2() {
ret void
}
void _EmptyMethod(unsigned char bEnable) {
  ;
  ;
}


x86 assembly (clang, -O0):
<_EmptyMethod>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_EmptyMethod(i8 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void emergency(int signo) {
  int i;
  char message[100];
  for (i = 0; i < 4; i++) {
  }
  signal(signo, emergency);
}


x86 assembly (clang, -O0):
<emergency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    113f <emergency+0x2f>
jmp    1131 <emergency+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <emergency+0x12>
mov    -0x4(%rbp),%edi
mov    0x2e97(%rip),%rsi
call   1030 <signal@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emergency>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <signal@plt>

LLVM IR (-O0):
define void @emergency(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %5
12: ; preds = %5
%13 = load i32, i32* %2
%14 = call i32 @signal(i32 %13, void (i32)* @emergency)
ret void
}

LLVM IR (-O2):
define void @emergency(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @emergency)
ret void
}
int iscntrl(int c) { return (unsigned)c < 0x20 || c == 0x7f; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ callMe2();
void callMe() { callMe2(); }


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

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

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

LLVM IR (-O2):
define void @callMe() {
%1 = tail call i32 (...) @callMe2()
ret void
}
int g(int n) {
  if ((unsigned)n == (1u << 31))
    return -1;
  else
    return -n;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jne    1120 <g+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1128 <g+0x28>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%ecx
neg    %ecx
cmp    $0x80000000,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -2147483648
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 -1, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  do {
    scanf("%d", &num);
    printf("0x%04x\n", num);
  } while (num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xec7(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"0x%04x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ llib_snb_to_long(char const *, long *, char **, int);
__attribute__((unused)) long atol(const char *s) {
  long n;
  llib_snb_to_long(s, &n, (char **)(void *)0, 10);
  return n;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0xa,%ecx
call   1030 <llib_snb_to_long@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
mov    $0xa,%ecx
call   1030 <llib_snb_to_long@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @llib_snb_to_long(i8* %4, i64* %3, i8** null, i32 10)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @atol(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @llib_snb_to_long(i8* %0, i64* %2, i8** null, i32 10)
%5 = load i64, i64* %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char);
void main() {
  char b;
  b = 1 || 2 || 3 || 4;
  print("b");
  printid(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <print@plt>
movsbl -0x1(%rbp),%edi
call   1040 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <printid@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"b\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i8 signext 1)
ret void
}
/* Type definitions */
struct mg_tls_opts {
  int dummy;
};
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_error(struct mg_connection *, char *);
int mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
  (void)opts;
  mg_error(c, "TLS is not enabled");
  return 0;
}


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

x86 assembly (clang, -O2):
<mg_tls_init>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <mg_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
%struct.mg_tls_opts = type { i32 }
@.str = [19 x i8] c"TLS is not enabled\00"
define i32 @mg_tls_init(%struct.mg_connection* %0, %struct.mg_tls_opts* %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca %struct.mg_tls_opts*
store %struct.mg_connection* %0, %struct.mg_connection** %3
store %struct.mg_tls_opts* %1, %struct.mg_tls_opts** %4
%5 = load %struct.mg_tls_opts*, %struct.mg_tls_opts** %4
%6 = load %struct.mg_connection*, %struct.mg_connection** %3
%7 = call i32 @mg_error(%struct.mg_connection* %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
%struct.mg_tls_opts = type { i32 }
@.str = [19 x i8] c"TLS is not enabled\00"
define i32 @mg_tls_init(%struct.mg_connection* %0, %struct.mg_tls_opts* nocapture readnone %1) {
%3 = tail call i32 @mg_error(%struct.mg_connection* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gtk_selection_data_set_uris() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_set_uris() {
ret void
}
void LobbyTests(void) {}


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

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

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

LLVM IR (-O2):
define void @LobbyTests() {
ret void
}
double f4_sum_pre_int_int_int_int_int_int_long(int v0, int v1, int v2, int v3,
                                               int v4, int v5, long v) {
  return (double)v0 + (double)v1 + (double)v2 + (double)v3 + (double)v4 +
         (double)v5 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_int_int_int_int_long>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdq 0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_int_int_int_int_long>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
cvtsi2sd %r8d,%xmm2
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %r9d,%xmm1
addsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_int_int_int_int_long(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i64 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i64 %6, i64* %14
%15 = load i32, i32* %8
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %9
%18 = sitofp i32 %17 to double
%19 = fadd double %16, %18
%20 = load i32, i32* %10
%21 = sitofp i32 %20 to double
%22 = fadd double %19, %21
%23 = load i32, i32* %11
%24 = sitofp i32 %23 to double
%25 = fadd double %22, %24
%26 = load i32, i32* %12
%27 = sitofp i32 %26 to double
%28 = fadd double %25, %27
%29 = load i32, i32* %13
%30 = sitofp i32 %29 to double
%31 = fadd double %28, %30
%32 = load i64, i64* %14
%33 = sitofp i64 %32 to double
%34 = fadd double %31, %33
ret double %34
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_int_int_int_int_long(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i64 %6) {
%8 = sitofp i32 %0 to double
%9 = sitofp i32 %1 to double
%10 = fadd double %8, %9
%11 = sitofp i32 %2 to double
%12 = fadd double %10, %11
%13 = sitofp i32 %3 to double
%14 = fadd double %12, %13
%15 = sitofp i32 %4 to double
%16 = fadd double %14, %15
%17 = sitofp i32 %5 to double
%18 = fadd double %16, %17
%19 = sitofp i64 %6 to double
%20 = fadd double %18, %19
ret double %20
}
double VT(double VT) {
  double q6, a;
  if (VT > 15) {
    return 9;
  }
  a = (VT + 0.1815) * (VT + 0.1815);
  q6 = 1 / (0.0003869 * a + 0.01081);
  return q6;
}


x86 assembly (clang, -O0):
<VT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <VT+0x32>
movsd  0xf00(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118d <VT+0x8d>
movsd  0xee6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<VT>:
ucomisd 0xf00(%rip),%xmm0
jbe    1113 <VT+0x13>
movsd  0xeee(%rip),%xmm0
ret
addsd  0xef5(%rip),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xef1(%rip),%xmm0
addsd  0xef1(%rip),%xmm0
movsd  0xef1(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @VT(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.500000e+01
br i1 %7, label %8, label %9
8: ; preds = %1
store double 9.000000e+00, double* %2
br label %19
9: ; preds = %1
%10 = load double, double* %3
%11 = fadd double %10, 1.815000e-01
%12 = load double, double* %3
%13 = fadd double %12, 1.815000e-01
%14 = fmul double %11, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double 3.869000e-04, double %15, double 1.081000e-02)
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %4
%18 = load double, double* %4
store double %18, double* %2
br label %19
19: ; preds = %9, %8
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @VT(double %0) {
%2 = fcmp ogt double %0, 1.500000e+01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fadd double %0, 1.815000e-01
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 3.869000e-04, double 1.081000e-02)
%7 = fdiv double 1.000000e+00, %6
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 9.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
double ln(double);
double logn(double n, double b) { return ln(n) / ln(b); }


x86 assembly (clang, -O0):
<logn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <ln@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logn>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <ln@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <ln@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @logn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @ln(double %5)
%7 = load double, double* %4
%8 = call double @ln(double %7)
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @logn(double %0, double %1) {
%3 = tail call double @ln(double %0)
%4 = tail call double @ln(double %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ left_motor_forward(int);
int /*<<< orphan*/ right_motor_forward(int);
void push_hard() {
  left_motor_forward(90);
  right_motor_forward(90);
}


x86 assembly (clang, -O0):
<push_hard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
call   1030 <left_motor_forward@plt>
mov    $0x5a,%edi
call   1040 <right_motor_forward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_hard>:
push   %rax
mov    $0x5a,%edi
call   1030 <left_motor_forward@plt>
mov    $0x5a,%edi
pop    %rax
jmp    1040 <right_motor_forward@plt>

LLVM IR (-O0):
define void @push_hard() {
%1 = call i32 @left_motor_forward(i32 90)
%2 = call i32 @right_motor_forward(i32 90)
ret void
}

LLVM IR (-O2):
define void @push_hard() {
%1 = tail call i32 @left_motor_forward(i32 90)
%2 = tail call i32 @right_motor_forward(i32 90)
ret void
}
int fibonaci(int i) {
  if (i == 0) {
    return 0;
  } else if (i == 1) {
    return 1;
  } else {
    return fibonaci(i - 1) + fibonaci(i - 2);
  }
}


x86 assembly (clang, -O0):
<fibonaci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonaci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonaci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonaci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonaci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonaci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonaci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonaci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonaci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonaci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonaci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonaci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonaci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void swap(int v[], int i, int j) {
  int temp = v[i];
  v[i] = v[j];
  v[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}