xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t __stdio_write(void const *, size_t, size_t, int /*<<< orphan*/ *);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return __stdio_write(ptr, size, nmemb, stream);
}


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

x86 assembly (clang, -O2):
<fwrite>:
jmp    1030 <__stdio_write@plt>

LLVM IR (-O0):
define i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @__stdio_write(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i64 @__stdio_write(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void Usage() { puts("Usage: cdzsys2sms (infile) [outfile]"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: cdzsys2sms (infile) [outfile]\00"
define void @Usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: cdzsys2sms (infile) [outfile]\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(void *, int, size_t, int /*<<< orphan*/ *);
int readf(FILE *f, void *buf, size_t n) { return fread(buf, 1, n, f) != 1; }


x86 assembly (clang, -O0):
<readf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readf>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readf(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32*, i32** %4
%10 = call i32 @fread(i8* %7, i32 1, i64 %8, i32* %9)
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @readf(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float __nv_fsub_rn(float, float);
float __fsub_rn(float __a, float __b) { return __nv_fsub_rn(__a, __b); }


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

x86 assembly (clang, -O2):
<__fsub_rn>:
jmp    1030 <__nv_fsub_rn@plt>

LLVM IR (-O0):
define float @__fsub_rn(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 = call float @__nv_fsub_rn(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fsub_rn(float %0, float %1) {
%3 = tail call float @__nv_fsub_rn(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ String;
typedef int /*<<< orphan*/ Display;
typedef scalar_t__ Cardinal;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ XInternAtoms(int /*<<< orphan*/ *, char **, int,
                                int /*<<< orphan*/, int /*<<< orphan*/ *);
void XmuInternStrings(Display *d, register String *names,
                      register Cardinal count, register Atom *atoms) {
  (void)XInternAtoms(d, (char **)names, (int)count, FALSE, atoms);
}


x86 assembly (clang, -O0):
<XmuInternStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%r8
call   1030 <XInternAtoms@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmuInternStrings>:
mov    %rcx,%r8
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <XInternAtoms@plt>

LLVM IR (-O0):
@FALSE = global i32 0
define void @XmuInternStrings(i32* %0, i32* %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = bitcast i32* %10 to i8**
%12 = load i64, i64* %7
%13 = trunc i64 %12 to i32
%14 = load i32, i32* @FALSE
%15 = load i32*, i32** %8
%16 = call i32 @XInternAtoms(i32* %9, i8** %11, i32 %13, i32 %14, i32* %15)
ret void
}

LLVM IR (-O2):
@FALSE = global i32 0
define void @XmuInternStrings(i32* %0, i32* %1, i64 %2, i32* %3) {
%5 = bitcast i32* %1 to i8**
%6 = trunc i64 %2 to i32
%7 = load i32, i32* @FALSE
%8 = tail call i32 @XInternAtoms(i32* %0, i8** %5, i32 %6, i32 %7, i32* %3)
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
short round(double f) {
  long x = (long)floor(f + 0.5);
  return x == (short)x ? (short)x : (short)((x >> 31) ^ 0x7FFF);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movswq %cx,%rcx
cmp    %rcx,%rax
jne    1155 <round+0x45>
mov    -0x10(%rbp),%rax
cwtl
mov    %eax,-0x14(%rbp)
jmp    1167 <round+0x57>
mov    -0x10(%rbp),%rax
sar    $0x1f,%rax
xor    $0x7fff,%rax
cwtl
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
push   %rax
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
movswq %ax,%rcx
mov    %rax,%rdx
shr    $0x1f,%rdx
xor    $0x7fff,%edx
cmp    %rax,%rcx
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @round(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = call i64 @floor(double %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i16
%10 = sext i16 %9 to i64
%11 = icmp eq i64 %7, %10
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i64, i64* %3
%14 = trunc i64 %13 to i16
%15 = sext i16 %14 to i32
br label %22
16: ; preds = %1
%17 = load i64, i64* %3
%18 = ashr i64 %17, 31
%19 = xor i64 %18, 32767
%20 = trunc i64 %19 to i16
%21 = sext i16 %20 to i32
br label %22
22: ; preds = %16, %12
%23 = phi i32 [ %15, %12 ], [ %21, %16 ]
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call i64 @floor(double %2)
%4 = add i64 %3, 32768
%5 = icmp ult i64 %4, 65536
%6 = trunc i64 %3 to i16
%7 = lshr i64 %3, 31
%8 = trunc i64 %7 to i16
%9 = xor i16 %8, 32767
%10 = select i1 %5, i16 %6, i16 %9
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x49() {
  Assert_real((isbdigit(73) == 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_isbdigit.c",
              370, ("isbdigit should be 0 for I"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x49>:
push   %rax
mov    $0x49,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x172,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for I\00"
define void @t_isbdigit_0x49() {
%1 = call i64 @isbdigit(i32 73)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for I\00"
define void @t_isbdigit_0x49() {
%1 = tail call i64 @isbdigit(i32 73)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
INSTRUCTION(lf_cust1) {}


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

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

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

LLVM IR (-O2):
define i32 @INSTRUCTION(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
async_read_no_copy() {
  printf("Your system does not support async I/O\n");
  exit(172);
}


x86 assembly (clang, -O0):
<async_read_no_copy>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xac,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [40 x i8] c"Your system does not support async I/O\0A\00"
define i32 @async_read_no_copy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 172)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Your system does not support async I/O\00"
define i32 @async_read_no_copy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 172)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int _doscan(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int vscanf(const char *fmt, va_list ap) { return (_doscan(stdin, fmt, ap)); }


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <_doscan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_doscan@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @_doscan(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @_doscan(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
int test_bit(int nr, const volatile unsigned long *p) {
  return (p[nr >> 5] >> (nr & 31)) & 1UL;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rax
and    $0x1f,%cl
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load volatile i64, i64* %9
%11 = load i32, i32* %3
%12 = and i32 %11, 31
%13 = zext i32 %12 to i64
%14 = lshr i64 %10, %13
%15 = and i64 %14, 1
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = ashr i32 %0, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load volatile i64, i64* %5
%7 = and i32 %0, 31
%8 = zext i32 %7 to i64
%9 = lshr i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
void mem_blk_set_uint16_null(void *ext, unsigned long addr,
                             unsigned short val) {}


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

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

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

LLVM IR (-O2):
define void @mem_blk_set_uint16_null(i8* nocapture %0, i64 %1, i16 zeroext %2) {
ret void
}
void xxx(int argc) {
  int x;
#pragma omp distribute simd
  for (int i = 0; i < 10; ++i)
    argc = x;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112c <xxx+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <xxx+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xxx(i32 %0) {
ret void
}
int alt2num(int a) {
  if (a >= 0xE0)
    a -= 0x30;
  return (a & 31);
}


x86 assembly (clang, -O0):
<alt2num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xe0,-0x4(%rbp)
jl     111d <alt2num+0x1d>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt2num>:
lea    0x10(%rdi),%eax
cmp    $0xe0,%edi
cmovl  %edi,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @alt2num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 224
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 48
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @alt2num(i32 %0) {
%2 = icmp sgt i32 %0, 223
%3 = add i32 %0, 16
%4 = select i1 %2, i32 %3, i32 %0
%5 = and i32 %4, 31
ret i32 %5
}
void handle_swi(void) { return; }


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

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

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

LLVM IR (-O2):
define void @handle_swi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sig_creation_time4(char *);
extern void signature_creation_time(int len) {
  printf("\t");
  sig_creation_time4("Time");
}


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

x86 assembly (clang, -O2):
<signature_creation_time>:
push   %rax
mov    $0x9,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <sig_creation_time4@plt>

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"Time\00"
define void @signature_creation_time(i32 %0) {
%2 = tail call i32 @putchar(i32 9)
%3 = tail call i32 @sig_creation_time4(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int eai_to_libesmtp(int code) {
  switch (code) {
  case 2:
    return 12;
  case 4:
    return 11;
  case 6:
    return 13;
  case 1:
    return 9;
  case 7:
    return 10;
  case 5:
    return 14;
  case 3:
    return 15;
  case 8:
    return 16;
  case 9:
    return 17;
  case 10:
    return 18;
  default:
    return 7;
  }
}


x86 assembly (clang, -O0):
<eai_to_libesmtp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11a8 <eai_to_libesmtp+0xa8>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xc,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0xb,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0xd,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0x9,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0xa,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0xe,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0xf,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0x10,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0x11,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0x12,-0x4(%rbp)
jmp    11af <eai_to_libesmtp+0xaf>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eai_to_libesmtp>:
add    $0xffffffff,%edi
mov    $0x7,%eax
cmp    $0x9,%edi
ja     111a <eai_to_libesmtp+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.eai_to_libesmtp = [10 x i32] [i32 9, i32 12, i32 15, i32 11, i32 14, i32 13, i32 10, i32 16, i32 17, i32 18]
define i32 @eai_to_libesmtp(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.eai_to_libesmtp, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 7, %1 ]
ret i32 %9
}
/* Variables and functions */
void retro_cheat_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @retro_cheat_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MakeScale(float, float, float);
void M34MakeScale(float s) { MakeScale(s, s, s); }


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

x86 assembly (clang, -O2):
<M34MakeScale>:
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
jmp    1030 <MakeScale@plt>

LLVM IR (-O0):
define void @M34MakeScale(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call i32 @MakeScale(float %3, float %4, float %5)
ret void
}

LLVM IR (-O2):
define void @M34MakeScale(float %0) {
%2 = tail call i32 @MakeScale(float %0, float %0, float %0)
ret void
}
void pcp_print_net_eip_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_eip_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
int GetSystemTimerBase() { return 0x20003000; }


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

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

LLVM IR (-O0):
define i32 @GetSystemTimerBase() {
ret i32 536883200
}

LLVM IR (-O2):
define i32 @GetSystemTimerBase() {
ret i32 536883200
}
void g_list_foreach() {}


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

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

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

LLVM IR (-O2):
define void @g_list_foreach() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, World!!!");
  puts("Goodbye, World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, World!!!\00"
@.str.1 = [16 x i8] c"Goodbye, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api2(int, int, unsigned int);
void timer_start(int tid, unsigned int timeout_ms) {
  api2(102, tid, timeout_ms);
}


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

x86 assembly (clang, -O2):
<timer_start>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x66,%edi
jmp    1030 <api2@plt>

LLVM IR (-O0):
define void @timer_start(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 @api2(i32 102, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @timer_start(i32 %0, i32 %1) {
%3 = tail call i32 @api2(i32 102, i32 %0, i32 %1)
ret void
}
float gsl_coerce_float(const float x) {
  volatile float y;
  y = x;
  return y;
}


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

x86 assembly (clang, -O2):
<gsl_coerce_float>:
movss  %xmm0,-0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define float @gsl_coerce_float(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store volatile float %0, float* %2
%4 = load volatile float, float* %2
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf(""
         "Usage: manage_stty_lock [lock|unlock] [tty]\n"
         "Requires root.\n"
         "\n"
         "To lock a terminal, use `lock` as the first argument.  To unlock "
         "one, use\n"
         "`unlock` as the first argument.  The second argument can be utilized "
         "to specify\n"
         "which terminal to lock/unlock; if it is left unset, the current "
         "terminal is\n"
         "utilized.\n"
         "\n"
         "Example, locking /dev/pts/1:\n"
         "\n"
         "	manage_stty_lock lock /dev/pts/1\n"
         "\n"
         "Example, unlocking the current terminal:\n"
         "\n	Example: manage_stty_lock unlock\n");
}


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

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

LLVM IR (-O0):
@.str = [443 x i8] c"Usage: manage_stty_lock [lock|unlock] [tty]\0ARequires root.\0A\0ATo lock a terminal, use `lock` as the first argument. To unlock one, use\0A`unlock` as the first argument. The second argument can be utilized to specify\0Awhich terminal to lock/unlock; if it is left unset, the current terminal is\0Autilized.\0A\0AExample, locking /dev/pts/1:\0A\0A\09manage_stty_lock lock /dev/pts/1\0A\0AExample, unlocking the current terminal:\0A\0A\09Example: manage_stty_lock unlock\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([443 x i8], [443 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [442 x i8] c"Usage: manage_stty_lock [lock|unlock] [tty]\0ARequires root.\0A\0ATo lock a terminal, use `lock` as the first argument. To unlock one, use\0A`unlock` as the first argument. The second argument can be utilized to specify\0Awhich terminal to lock/unlock; if it is left unset, the current terminal is\0Autilized.\0A\0AExample, locking /dev/pts/1:\0A\0A\09manage_stty_lock lock /dev/pts/1\0A\0AExample, unlocking the current terminal:\0A\0A\09Example: manage_stty_lock unlock\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([442 x i8], [442 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
struct stat {
  int /*<<< orphan*/ st_blocks;
};

/* Variables and functions */
int stat(char *, struct stat *);
uint32_t blocksCount(char *filename) {
  struct stat fileStat;
  if (stat(filename, &fileStat) == -1) {
    return -1;
  }
  return (uint32_t)fileStat.st_blocks;
}


x86 assembly (clang, -O0):
<blocksCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <blocksCount+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <blocksCount+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blocksCount>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <blocksCount+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @blocksCount(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @blocksCount(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void en(void) {}


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

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

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

LLVM IR (-O2):
define void @en() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int *, int);
void getientropy(int *entropy) {
  int urandom_fd;
  urandom_fd = open("/dev/urandom", O_RDONLY);
  read(urandom_fd, entropy, 4);
  return;
}


x86 assembly (clang, -O0):
<getientropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getientropy>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <read@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @getientropy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @read(i32 %6, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @getientropy(i32* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @read(i32 %3, i32* %0, i32 4)
ret void
}
unsigned long ADCTimerValueGet(unsigned long ulBase) {
  return ((*((volatile unsigned long *)(ulBase + 0x00000070))));
}


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

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

LLVM IR (-O0):
define i64 @ADCTimerValueGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 112
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @ADCTimerValueGet(i64 %0) {
%2 = add i64 %0, 112
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ hello_from_fortran_();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello world!");
  hello_from_fortran_();
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @hello_from_fortran_()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @hello_from_fortran_()
ret i32 0
}
/* Variables and functions */
int linemode_set(int, int);
int set(int bit) { return linemode_set(bit, 1); }


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

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

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

LLVM IR (-O2):
define i32 @set(i32 %0) {
%2 = tail call i32 @linemode_set(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int *get_randomized(const char *text, unsigned *count, int *sum) {
  *count = 0;
  *sum = 0;
  return NULL;
}


x86 assembly (clang, -O0):
<get_randomized>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randomized>:
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @get_randomized(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
store i32 0, i32* %7
%8 = load i32*, i32** %6
store i32 0, i32* %8
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @get_randomized(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %1
store i32 0, i32* %2
ret i32* null
}
sign_ext(int v, int bits) {
  if (bits < 32) {
    v &= (1 << bits) - 1;
    if (v & (1 << (bits - 1)))
      v -= (1 << bits);
  }
  return v;
}


x86 assembly (clang, -O0):
<sign_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    115d <sign_ext+0x5d>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1158 <sign_ext+0x58>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <sign_ext+0x5d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_ext>:
mov    %edi,%eax
cmp    $0x1f,%esi
jg     1129 <sign_ext+0x29>
mov    $0x1,%edx
mov    %esi,%ecx
shl    %cl,%edx
lea    -0x1(%rdx),%ecx
and    %eax,%ecx
add    $0xff,%sil
movzbl %sil,%eax
xor    %esi,%esi
bt     %eax,%ecx
cmovb  %edx,%esi
sub    %esi,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_ext(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 32
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = shl nuw i32 1, %1
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %0
%8 = add nsw i32 %1, -1
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %7, %9
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 0, i32 %5
%13 = sub nsw i32 %7, %12
br label %14
14: ; preds = %4, %2
%15 = phi i32 [ %0, %2 ], [ %13, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void integer2c(int i) { printf("%d\n", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @integer2c(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, scalar_t__, int /*<<< orphan*/);
int seek_set(int fd, off_t pos) {
  return ((fd == -1) || (lseek(fd, (off_t)pos, SEEK_SET) == -1)) ? 0 : 1;
}


x86 assembly (clang, -O0):
<seek_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     114c <seek_set+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_set>:
cmp    $0xffffffff,%edi
je     1133 <seek_set+0x23>
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @seek_set(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i64, i64* %4
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @lseek(i32 %8, i64 %9, i32 %10)
%12 = icmp eq i32 %11, -1
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ true, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @seek_set(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i64 %1, i32 %5)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_utimes(struct tcb *, int /*<<< orphan*/, int /*<<< orphan*/);
int sys_utimes(struct tcb *tcp) { return decode_utimes(tcp, 0, 0); }


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

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

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_utimes(%struct.tcb* %0) {
%2 = tail call i32 @decode_utimes(%struct.tcb* %0, i32 0, i32 0)
ret i32 %2
}
int f(void) {
  int r = 0;
  r |= acc_on_device();
  r |= acc_on_device(1, 2);
  r |= acc_on_device(3.14);
  r |= acc_on_device("hello");
  return r;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <acc_on_device@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <acc_on_device@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xeb5(%rip),%xmm0
mov    $0x1,%al
call   1030 <acc_on_device@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <acc_on_device@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <acc_on_device@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <acc_on_device@plt>
mov    %eax,%ebp
or     %ebx,%ebp
movsd  0xec7(%rip),%xmm0
mov    $0x1,%al
call   1030 <acc_on_device@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <acc_on_device@plt>
or     %ebp,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @f() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @acc_on_device()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @acc_on_device to i32 (i32, i32, ...)*)(i32 1, i32 2)
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = call i32 (double, ...) bitcast (i32 (...)* @acc_on_device to i32 (double, ...)*)(double 3.140000e+00)
%9 = load i32, i32* %1
%10 = or i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @acc_on_device to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @f() {
%1 = tail call i32 (...) @acc_on_device()
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @acc_on_device to i32 (i32, i32, ...)*)(i32 1, i32 2)
%3 = or i32 %2, %1
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @acc_on_device to i32 (double, ...)*)(double 3.140000e+00)
%5 = or i32 %3, %4
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @acc_on_device to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int blender_block_read_finish(void *, unsigned long);
int FS460_image_get_finish_read(void *p_image_data, unsigned long length) {
  return blender_block_read_finish(p_image_data, length);
}


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

x86 assembly (clang, -O2):
<FS460_image_get_finish_read>:
jmp    1030 <blender_block_read_finish@plt>

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

LLVM IR (-O2):
define i32 @FS460_image_get_finish_read(i8* %0, i64 %1) {
%3 = tail call i32 @blender_block_read_finish(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void *t_fun3(void *arg) {
  foo();
  return (void *)11;
}


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

x86 assembly (clang, -O2):
<t_fun3>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    $0xb,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @t_fun3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @foo()
ret i8* inttoptr (i64 11 to i8*)
}

LLVM IR (-O2):
define i8* @t_fun3(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @foo()
ret i8* inttoptr (i64 11 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ recADDIU();
void recADDI() { recADDIU(); }


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

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

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

LLVM IR (-O2):
define void @recADDI() {
%1 = tail call i32 (...) @recADDIU()
ret void
}