xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t compress(uint64_t data, uint64_t n) { return data % n; }


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

x86 assembly (clang, -O2):
<compress>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compress(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ change();
int /*<<< orphan*/ daoxu();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("enter: runFrame test....\n");
  daoxu();
  printf("unchange\n");
  change();
  printf("changed\n");
  printf("leave: runFrame test....\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <daoxu@plt>
lea    0xecc(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <change@plt>
lea    0xec3(%rip),%rdi
call   1050 <printf@plt>
lea    0xec0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <daoxu@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <change@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"enter: runFrame test....\0A\00"
@.str.1 = [10 x i8] c"unchange\0A\00"
@.str.2 = [9 x i8] c"changed\0A\00"
@.str.3 = [26 x i8] c"leave: runFrame test....\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @daoxu()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @change()
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"enter: runFrame test....\00"
@str.4 = [9 x i8] c"unchange\00"
@str.5 = [8 x i8] c"changed\00"
@str.6 = [25 x i8] c"leave: runFrame test....\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @daoxu()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (...) @change()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Mem_PrintStats();
int /*<<< orphan*/ _Mem_CheckSentinelsGlobal(char *, int);
void MemStats_f(void) {
  _Mem_CheckSentinelsGlobal(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/"
      "qcommon/mem.c",
      633);
  Mem_PrintStats();
}


x86 assembly (clang, -O0):
<MemStats_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x279,%esi
call   1030 <_Mem_CheckSentinelsGlobal@plt>
mov    $0x0,%al
call   1040 <Mem_PrintStats@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemStats_f>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x279,%esi
call   1030 <_Mem_CheckSentinelsGlobal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Mem_PrintStats@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/qcommon/mem.c\00"
define void @MemStats_f() {
%1 = call i32 @_Mem_CheckSentinelsGlobal(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 633)
%2 = call i32 (...) @Mem_PrintStats()
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/qcommon/mem.c\00"
define void @MemStats_f() {
%1 = tail call i32 @_Mem_CheckSentinelsGlobal(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 633)
%2 = tail call i32 (...) @Mem_PrintStats()
ret void
}
int test_02(int a) { return a < 1 ? 1 : a; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    111e <test_02+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <test_02+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
test   %edi,%edi
mov    $0x1,%eax
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_02(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 1, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_02(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
ret i32 %3
}
void terminal_scroll() {}


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

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

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

LLVM IR (-O2):
define void @terminal_scroll() {
ret void
}
float nearbyintf(float x) {}


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @nearbyintf(float %0) {
ret float undef
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgrgid_r(gid_t gid, struct group *grp, char *buffer, size_t bufsize,
               struct group **result) {
  return 0;
}


x86 assembly (clang, -O0):
<getgrgid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @getgrgid_r(i32 %0, %struct.group* %1, i8* %2, i64 %3, %struct.group** %4) {
%6 = alloca i32
%7 = alloca %struct.group*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.group**
store i32 %0, i32* %6
store %struct.group* %1, %struct.group** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.group** %4, %struct.group*** %10
ret i32 0
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @getgrgid_r(i32 %0, %struct.group* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, %struct.group** nocapture readnone %4) {
ret i32 0
}
shmctl(shmid, cmd, buf) int shmid, cmd;
struct shmid_ds *buf;
{
  return (syscall(52, 1, shmid, cmd, buf));
}


x86 assembly (clang, -O0):
<shmctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x34,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmctl>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x34,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.shmid_ds = type opaque
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.shmid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.shmid_ds* %2, %struct.shmid_ds** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.shmid_ds*, %struct.shmid_ds** %6
%10 = call i32 (i32, i32, i32, i32, %struct.shmid_ds*, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, i32, %struct.shmid_ds*, ...)*)(i32 52, i32 1, i32 %7, i32 %8, %struct.shmid_ds* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.shmid_ds = type opaque
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = tail call i32 (i32, i32, i32, i32, %struct.shmid_ds*, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, i32, %struct.shmid_ds*, ...)*)(i32 52, i32 1, i32 %0, i32 %1, %struct.shmid_ds* %2)
ret i32 %4
}
/* Variables and functions */
int f(int, int, int, int, int, int, int, int, int, int);
main() { return f(1, 2, 3, 4, 5, 6, 7, 8, 9, -1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0xffffffff,0x18(%rsp)
ff
call   1030 <f@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0xffffffffffffffff
push   $0x9
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 -1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 -1)
ret i32 %1
}
int page_zone_id(struct rte_page *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rte_page = type opaque
define i32 @page_zone_id(%struct.rte_page* nocapture readnone %0) {
ret i32 0
}
int is_32bit_task(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @is_32bit_task() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_32bit_task() {
ret i32 1
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
uint64_t next_combination(int64_t x) {
  int64_t u = x & -x;
  int64_t v = u + x;
  if (v == 0)
    return 0;
  x = v + (((v ^ x) / u) >> 2);
  return x;
}


x86 assembly (clang, -O0):
<next_combination>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1133 <next_combination+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1156 <next_combination+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sar    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_combination>:
mov    %edi,%esi
neg    %esi
and    %edi,%esi
mov    %esi,%ecx
add    %edi,%ecx
je     1119 <next_combination+0x19>
xor    %ecx,%edi
mov    %edi,%eax
cltd
idiv   %esi
sar    $0x2,%eax
add    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @next_combination(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = add nsw i32 %3, %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = xor i32 %4, %0
%8 = sdiv i32 %7, %3
%9 = ashr i32 %8, 2
%10 = add nsw i32 %9, %4
br label %11
11: ; preds = %1, %6
%12 = phi i32 [ %10, %6 ], [ 0, %1 ]
ret i32 %12
}
unsigned char uc_uc_test(unsigned char data) {
  printf("Entered %s:\n", __FUNCTION__);
  printf("Data In: %d\n", (signed int)data);
  printf("Exited  %s:\n", __FUNCTION__);
  return data;
}


x86 assembly (clang, -O0):
<uc_uc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_uc_test>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%rdi
lea    0xee9(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.uc_uc_test = [11 x i8] c"uc_uc_test\00"
@.str.1 = [13 x i8] c"Data In: %d\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define zeroext i8 @uc_uc_test(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.uc_uc_test, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.uc_uc_test, i64 0, i64 0))
%8 = load i8, i8* %2
ret i8 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.uc_uc_test = [11 x i8] c"uc_uc_test\00"
@.str.1 = [13 x i8] c"Data In: %d\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define zeroext i8 @uc_uc_test(i8 returned zeroext %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.uc_uc_test, i64 0, i64 0))
%3 = zext i8 %0 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.uc_uc_test, i64 0, i64 0))
ret i8 %0
}
/* Variables and functions */
int exp(double const);
double boltzmann(const double x, const double x_0, const double k) {
  return 1. / (1. + exp(-k * (x - x_0)));
}


x86 assembly (clang, -O0):
<boltzmann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boltzmann>:
push   %rax
xorpd  0xee7(%rip),%xmm2
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xedb(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @boltzmann(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fneg double %7
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = fmul double %8, %11
%13 = call i32 @exp(double %12)
%14 = sitofp i32 %13 to double
%15 = fadd double 1.000000e+00, %14
%16 = fdiv double 1.000000e+00, %15
ret double %16
}

LLVM IR (-O2):
define double @boltzmann(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = fsub double %0, %1
%6 = fmul double %5, %4
%7 = tail call i32 @exp(double %6)
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ trap_Argv(int, char *, int);
const char *CG_Argv(int arg) {
  static char buffer[1024];
  trap_Argv(arg, buffer, sizeof(buffer));
  return buffer;
}


x86 assembly (clang, -O0):
<CG_Argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x400,%edx
call   1030 <trap_Argv@plt>
lea    0x2f0a(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Argv>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x400,%edx
call   1030 <trap_Argv@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@CG_Argv.buffer = internal global [1024 x i8] zeroinitializer
define i8* @CG_Argv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @trap_Argv(i32 %3, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @CG_Argv.buffer, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @CG_Argv.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@CG_Argv.buffer = internal global [1024 x i8] zeroinitializer
define i8* @CG_Argv(i32 %0) {
%2 = tail call i32 @trap_Argv(i32 %0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @CG_Argv.buffer, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @CG_Argv.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int A, B, X;
  scanf("%i", &A);
  scanf("%i", &B);
  X = A + B;
  printf("X = %d\n", X);
  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>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void cfence() { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @cfence() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ getVoidPtr();
void testCastVoidPtrToIntPtrThroughUIntTypedAssignment() {
  int *x;
  (*((int *)(&x))) = (int)(unsigned *)getVoidPtr();
  *x = 1;
}


x86 assembly (clang, -O0):
<testCastVoidPtrToIntPtrThroughUIntTypedAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getVoidPtr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCastVoidPtrToIntPtrThroughUIntTypedAssignment>:
push   %rax
xor    %eax,%eax
call   1030 <getVoidPtr@plt>
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testCastVoidPtrToIntPtrThroughUIntTypedAssignment() {
%1 = alloca i32*
%2 = call i64 (...) @getVoidPtr()
%3 = inttoptr i64 %2 to i32*
%4 = ptrtoint i32* %3 to i32
%5 = bitcast i32** %1 to i32*
store i32 %4, i32* %5
%6 = load i32*, i32** %1
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @testCastVoidPtrToIntPtrThroughUIntTypedAssignment() {
%1 = tail call i64 (...) @getVoidPtr()
%2 = and i64 %1, 4294967295
%3 = inttoptr i64 %2 to i32*
store i32 1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a;
  scanf("%lf", &a);
  printf("A=%.4f\n", a * a * 3.14159);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xebf(%rip),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fmul double %6, 3.141590e+00
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.141590e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
double jd2epj(dj)
double dj;
{ return (2000.0 + (dj - 2451545.0) / 365.25); }


x86 assembly (clang, -O0):
<jd2epj>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xefa(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @jd2epj(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x4142B42C80000000
%5 = fdiv double %4, 3.652500e+02
%6 = fadd double 2.000000e+03, %5
ret double %6
}

LLVM IR (-O2):
define double @jd2epj(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+02
%4 = fadd double %3, 2.000000e+03
ret double %4
}
int totalCoeffs_so3(int bw) { return ((4 * bw * bw * bw - bw) / 3); }


x86 assembly (clang, -O0):
<totalCoeffs_so3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalCoeffs_so3>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
shl    $0x2,%eax
sub    %edi,%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @totalCoeffs_so3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 4, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = sub nsw i32 %8, %9
%11 = sdiv i32 %10, 3
ret i32 %11
}

LLVM IR (-O2):
define i32 @totalCoeffs_so3(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = mul nsw i32 %2, %0
%4 = mul nsw i32 %3, %0
%5 = sub nsw i32 %4, %0
%6 = sdiv i32 %5, 3
ret i32 %6
}
/* Variables and functions */
int __syscall_chdir(char const *);
int chdir(const char *path) { return __syscall_chdir(path); }


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

x86 assembly (clang, -O2):
<chdir>:
jmp    1030 <__syscall_chdir@plt>

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

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = tail call i32 @__syscall_chdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ XWindowAttributes;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XWindowAttributes(void *_p) {
  if (_p == NULL)
    abort();
  free((XWindowAttributes *)_p);
}


x86 assembly (clang, -O0):
<free_XWindowAttributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XWindowAttributes+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XWindowAttributes>:
test   %rdi,%rdi
je     112a <free_XWindowAttributes+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XWindowAttributes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XWindowAttributes(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void nullFunctionPointerConstant() {
  void (*f)(void) = 0;
  f();
  clang_analyzer_warnIfReached();
}


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

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

LLVM IR (-O2):
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap1(int, int);
int main(int argc, char **argv) {
  int u;
  int t;
  u = 17;
  t = -96;
  printf("before swap1: u = %d , t = %d \n", u, t);
  swap1(u, t);
  printf("after  swap1: u = %d , t = %d \n", u, t);
  return EXIT_SUCCESS;
}


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)
movl   $0x11,-0x14(%rbp)
movl   $0xffffffa0,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <swap1@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffa0,%edx
call   1030 <printf@plt>
mov    $0x11,%edi
mov    $0xffffffa0,%esi
call   1040 <swap1@plt>
lea    0xed3(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffa0,%edx
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"before swap1: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap1: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 17, i32* %6
store i32 -96, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @swap1(i32 %11, i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [32 x i8] c"before swap1: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap1: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 17, i32 -96)
%4 = tail call i32 @swap1(i32 17, i32 -96)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 17, i32 -96)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ printVersion(char const *);
int /*<<< orphan*/ stderr;
void printUsage(const char *appName) {
  printVersion(appName);
  fprintf(
      stderr,
      "Usage: %s [-v|-h] [-p] [-b <filename>] <file list>\n"
      "    -v, --version    print version message\n"
      "    -h, --help       print usage message\n"
      "    -p               only emit function comments and prototypes\n"
      "    -b <filename>    provide a 'boilerplate' file for the file comment\n"
      "if <file list> is empty, process stdin to stdout.\n",
      appName);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printVersion@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
call   1040 <printVersion@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [321 x i8] c"Usage: %s [-v|-h] [-p] [-b <filename>] <file list>\0A -v, --version print version message\0A -h, --help print usage message\0A -p only emit function comments and prototypes\0A -b <filename> provide a 'boilerplate' file for the file comment\0Aif <file list> is empty, process stdin to stdout.\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printVersion(i8* %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [321 x i8] c"Usage: %s [-v|-h] [-p] [-b <filename>] <file list>\0A -v, --version print version message\0A -h, --help print usage message\0A -p only emit function comments and prototypes\0A -b <filename> provide a 'boilerplate' file for the file comment\0Aif <file list> is empty, process stdin to stdout.\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printVersion(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int SteamAPI_ISteamUser_GetPlayerSteamLevel(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamUser_GetPlayerSteamLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamUser_GetPlayerSteamLevel>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_GetPlayerSteamLevel = [40 x i8] c"SteamAPI_ISteamUser_GetPlayerSteamLevel\00"
define i32 @SteamAPI_ISteamUser_GetPlayerSteamLevel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamUser_GetPlayerSteamLevel, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_GetPlayerSteamLevel = [40 x i8] c"SteamAPI_ISteamUser_GetPlayerSteamLevel\00"
define i32 @SteamAPI_ISteamUser_GetPlayerSteamLevel(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamUser_GetPlayerSteamLevel, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__13__GeneralIO__makeInput();
void HplSensirionSht11P__SCK__makeInput(void) {
  Msp430GpioC__13__GeneralIO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @HplSensirionSht11P__SCK__makeInput() {
%1 = tail call i32 (...) @Msp430GpioC__13__GeneralIO__makeInput()
ret void
}
/* Variables and functions */
int isalpha(unsigned char);
int isword(unsigned char c) { return isalpha(c); }


x86 assembly (clang, -O0):
<isword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isword>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @isword(i8 zeroext %0) {
%2 = tail call i32 @isalpha(i8 zeroext %0)
ret i32 %2
}
/* Variables and functions */
size_t strlen(const char *s) {
  int i = 0;
  while (s[i] != 0)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, World!");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct smc_call {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ smc64_arg(struct smc_call const *, unsigned int);
uint32_t smc32_arg(const struct smc_call *smc, unsigned i) {
  return smc64_arg(smc, i);
}


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

x86 assembly (clang, -O2):
<smc32_arg>:
jmp    1030 <smc64_arg@plt>

LLVM IR (-O0):
%struct.smc_call = type { i32 }
define i32 @smc32_arg(%struct.smc_call* %0, i32 %1) {
%3 = alloca %struct.smc_call*
%4 = alloca i32
store %struct.smc_call* %0, %struct.smc_call** %3
store i32 %1, i32* %4
%5 = load %struct.smc_call*, %struct.smc_call** %3
%6 = load i32, i32* %4
%7 = call i32 @smc64_arg(%struct.smc_call* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.smc_call = type { i32 }
define i32 @smc32_arg(%struct.smc_call* %0, i32 %1) {
%3 = tail call i32 @smc64_arg(%struct.smc_call* %0, i32 %1)
ret i32 %3
}
__attribute__((vector_size(16))) int
bar(__attribute__((vector_size(16))) int a,
    __attribute__((vector_size(16))) int b) {
  return a + b;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
movdqa %xmm1,-0x20(%rbp)
movdqa -0x10(%rbp),%xmm0
paddd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
paddd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @bar(<4 x i32> %0, <4 x i32> %1) {
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
store <4 x i32> %0, <4 x i32>* %3
store <4 x i32> %1, <4 x i32>* %4
%5 = load <4 x i32>, <4 x i32>* %3
%6 = load <4 x i32>, <4 x i32>* %4
%7 = add <4 x i32> %5, %6
ret <4 x i32> %7
}

LLVM IR (-O2):
define <4 x i32> @bar(<4 x i32> %0, <4 x i32> %1) {
%3 = add <4 x i32> %1, %0
ret <4 x i32> %3
}
/* Variables and functions */
double curr_time();
int /*<<< orphan*/ printf(char *, char *, double);
void nowstr(char *s) { printf("%s %f\n", s, curr_time()); }


x86 assembly (clang, -O0):
<nowstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <curr_time@plt>
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowstr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <curr_time@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %f\0A\00"
define void @nowstr(i8* %0) {
%2 = tail call double (...) @curr_time()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, double %2)
ret void
}
int f_bge_rm1(float a1, float *a2) {
  return (__builtin_isgreaterequal(a1, *a2));
}


x86 assembly (clang, -O0):
<f_bge_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_rm1>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_bge_rm1(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp oge float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_bge_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ole float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned int _xbegin();
unsigned int test_xbegin(void) { return _xbegin(); }


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

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

LLVM IR (-O0):
define i32 @test_xbegin() {
%1 = call i32 (...) @_xbegin()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_xbegin() {
%1 = tail call i32 (...) @_xbegin()
ret i32 %1
}
unsigned invert(unsigned x, int p, int n) { return x ^ (~(~0U << n) << p); }


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = xor i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ExitLevel();
void EndGame_f(void) { ExitLevel(); }


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

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

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

LLVM IR (-O2):
define void @EndGame_f() {
%1 = tail call i32 (...) @ExitLevel()
ret void
}
/* Type definitions */
struct mem_event_domain {
  int dummy;
};
struct domain {
  int dummy;
};

/* Variables and functions */
int __mem_event_claim_slot(struct domain *, struct mem_event_domain *, int);
int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med) {
  return __mem_event_claim_slot(d, med, 1);
}


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

x86 assembly (clang, -O2):
<mem_event_claim_slot>:
mov    $0x1,%edx
jmp    1030 <__mem_event_claim_slot@plt>

LLVM IR (-O0):
%struct.domain = type { i32 }
%struct.mem_event_domain = type { i32 }
define i32 @mem_event_claim_slot(%struct.domain* %0, %struct.mem_event_domain* %1) {
%3 = alloca %struct.domain*
%4 = alloca %struct.mem_event_domain*
store %struct.domain* %0, %struct.domain** %3
store %struct.mem_event_domain* %1, %struct.mem_event_domain** %4
%5 = load %struct.domain*, %struct.domain** %3
%6 = load %struct.mem_event_domain*, %struct.mem_event_domain** %4
%7 = call i32 @__mem_event_claim_slot(%struct.domain* %5, %struct.mem_event_domain* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.domain = type { i32 }
%struct.mem_event_domain = type { i32 }
define i32 @mem_event_claim_slot(%struct.domain* %0, %struct.mem_event_domain* %1) {
%3 = tail call i32 @__mem_event_claim_slot(%struct.domain* %0, %struct.mem_event_domain* %1, i32 1)
ret i32 %3
}