xunge/DecIR huggingface dataset:
/* Type definitions */
struct tm {
  int tm_wday;
  int tm_yday;
};

/* Variables and functions */
int getFirstWeekDayOfYear(const struct tm *tm) {
  int wday = (tm->tm_wday - tm->tm_yday) % 7;
  return wday < 0 ? wday + 7 : wday;
}


x86 assembly (clang, -O0):
<getFirstWeekDayOfYear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1138 <getFirstWeekDayOfYear+0x38>
mov    -0xc(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <getFirstWeekDayOfYear+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirstWeekDayOfYear>:
mov    (%rdi),%eax
sub    0x4(%rdi),%eax
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x2,%edx
add    %eax,%edx
lea    0x0(,%rdx,8),%eax
sub    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x7,%eax
add    %edx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define i32 @getFirstWeekDayOfYear(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = load %struct.tm*, %struct.tm** %2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sub nsw i32 %6, %9
%11 = srem i32 %10, 7
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 7
br label %19
17: ; preds = %1
%18 = load i32, i32* %3
br label %19
19: ; preds = %17, %14
%20 = phi i32 [ %16, %14 ], [ %18, %17 ]
ret i32 %20
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i32 @getFirstWeekDayOfYear(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = sub nsw i32 %3, %5
%7 = srem i32 %6, 7
%8 = icmp slt i32 %7, 0
%9 = add nsw i32 %7, 7
%10 = select i1 %8, i32 %9, i32 %7
ret i32 %10
}
int my_proc_info(int i) { return i++; }


x86 assembly (clang, -O0):
<my_proc_info>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_proc_info>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_proc_info(i32 returned %0) {
ret i32 %0
}
void Rename_IntegritySetObjectsModifiedFromModOp(int _op) { ; }


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

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

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

LLVM IR (-O2):
define void @Rename_IntegritySetObjectsModifiedFromModOp(i32 %0) {
ret void
}
/* Variables and functions */
void *compare_ptrdiff_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_ptrdiff_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_ptrdiff_context() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x92() {
  Assert_real((iscntrl(146) == 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_iscntrl.c",
              735, ("iscntrl should be 0 for 0x92"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x92\00"
define void @t_iscntrl_0x92() {
%1 = tail call i64 @iscntrl(i32 146)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int space(int n) {
  if (n < 2)
    return 0;
  else
    return n + space(n / 2) + space(n - (n / 2));
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <space+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1172 <space+0x62>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <space@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    %eax,%edi
call   1030 <space@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     113a <space+0x2a>
mov    %edi,%ebx
xor    %ebp,%ebp
nop
mov    %ebx,%r14d
shr    %r14d
mov    %r14d,%edi
call   1030 <space@plt>
add    %ebx,%ebp
sub    %r14d,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
jg     1120 <space+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @space(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = tail call i32 @space(i32 %6)
%8 = sub nsw i32 %4, %6
%9 = add i32 %4, %5
%10 = add i32 %9, %7
%11 = icmp slt i32 %8, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
void module_param_sysfs_remove(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @module_param_sysfs_remove(%struct.module* nocapture %0) {
ret void
}
long double foo(long double x) {
#pragma omp target map(tofrom : x)
  x *= 2.0;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fadd   %st,%st(0)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x8(%rsp)
fadd   %st,%st(0)
ret

LLVM IR (-O0):
define x86_fp80 @foo(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 %3, 0xK40008000000000000000
store x86_fp80 %4, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, 0xK40008000000000000000
ret x86_fp80 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_two_decimals() {
  char *str = "1234.01";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 10000000);
}


x86 assembly (clang, -O0):
<test_two_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_two_decimals+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x989680,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_two_decimals>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1234.01\00"
define void @test_two_decimals() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 10000000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"1234.01\00"
define void @test_two_decimals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ SO_SNDTIMEO;
int /*<<< orphan*/ setTimeout(int, int /*<<< orphan*/, int /*<<< orphan*/);
void setWriteTimeout(int sock, time_t timeout) {
  setTimeout(sock, timeout, SO_SNDTIMEO);
}


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

x86 assembly (clang, -O2):
<setWriteTimeout>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setTimeout@plt>

LLVM IR (-O0):
@SO_SNDTIMEO = global i32 0
define void @setWriteTimeout(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 = load i32, i32* @SO_SNDTIMEO
%8 = call i32 @setTimeout(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SO_SNDTIMEO = global i32 0
define void @setWriteTimeout(i32 %0, i32 %1) {
%3 = load i32, i32* @SO_SNDTIMEO
%4 = tail call i32 @setTimeout(i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int DDSLittleLong(int src) { return src; }


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

x86 assembly (clang, -O2):
<DDSLittleLong>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @DDSLittleLong(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct _file_stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fs_write_chars(struct _file_stream *, char *,
                                  int /*<<< orphan*/, int);
int /*<<< orphan*/ fs_write_vint(struct _file_stream *, int);
int strlen(char *);
void fs_write_string(struct _file_stream *s, char *_data) {
  int length = strlen(_data);
  fs_write_vint(s, length);
  fs_write_chars(s, _data, 0, length);
}


x86 assembly (clang, -O0):
<fs_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <fs_write_vint@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
call   1050 <fs_write_chars@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_write_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <fs_write_vint@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fs_write_chars@plt>

LLVM IR (-O0):
%struct._file_stream = type { i32 }
define void @fs_write_string(%struct._file_stream* %0, i8* %1) {
%3 = alloca %struct._file_stream*
%4 = alloca i8*
%5 = alloca i32
store %struct._file_stream* %0, %struct._file_stream** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load %struct._file_stream*, %struct._file_stream** %3
%9 = load i32, i32* %5
%10 = call i32 @fs_write_vint(%struct._file_stream* %8, i32 %9)
%11 = load %struct._file_stream*, %struct._file_stream** %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @fs_write_chars(%struct._file_stream* %11, i8* %12, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
%struct._file_stream = type { i32 }
define void @fs_write_string(%struct._file_stream* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fs_write_vint(%struct._file_stream* %0, i32 %3)
%5 = tail call i32 @fs_write_chars(%struct._file_stream* %0, i8* %1, i32 0, i32 %3)
ret void
}
/* Variables and functions */
char *BGBCC_SHXA_ParseTokenBasic(char *, char *);
char *bgbcc_rstrdup(char *);
char *BGBCC_SHXA_ParseToken(char *cs, char **rstr) {
  char tb[256];
  cs = BGBCC_SHXA_ParseTokenBasic(cs, tb);
  *rstr = bgbcc_rstrdup(tb);
  return (cs);
}


x86 assembly (clang, -O0):
<BGBCC_SHXA_ParseToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <BGBCC_SHXA_ParseTokenBasic@plt>
mov    %rax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <bgbcc_rstrdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBCC_SHXA_ParseToken>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r15
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <BGBCC_SHXA_ParseTokenBasic@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <bgbcc_rstrdup@plt>
mov    %rax,(%r15)
mov    %rbx,%rax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @BGBCC_SHXA_ParseToken(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i8* @BGBCC_SHXA_ParseTokenBasic(i8* %6, i8* %7)
store i8* %8, i8** %3
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = call i8* @bgbcc_rstrdup(i8* %9)
%11 = load i8**, i8*** %4
store i8* %10, i8** %11
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @BGBCC_SHXA_ParseToken(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i8* @BGBCC_SHXA_ParseTokenBasic(i8* %0, i8* %4)
%6 = call i8* @bgbcc_rstrdup(i8* %4)
store i8* %6, i8** %1
ret i8* %5
}
unsigned int g(unsigned int a) { return (a >> 7) >> 25; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
shr    $0x19,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void exit_msg(char *message, int exit_value) {
  printf("%s", message);
  printf(", exiting...\n");
  exit(exit_value);
}


x86 assembly (clang, -O0):
<exit_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_msg>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c", exiting...\0A\00"
define void @exit_msg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [13 x i8] c", exiting...\00"
define void @exit_msg(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int f207(int *);
int f208(int *p) { return f207(p); }


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

x86 assembly (clang, -O2):
<f208>:
jmp    1030 <f207@plt>

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

LLVM IR (-O2):
define i32 @f208(i32* %0) {
%2 = tail call i32 @f207(i32* %0)
ret i32 %2
}
/* Variables and functions */
int core6_safe(char const *);
int U_EMRPOLYBEZIERTO16_safe(const char *record) {
  return (core6_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYBEZIERTO16_safe>:
jmp    1030 <core6_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYBEZIERTO16_safe(i8* %0) {
%2 = tail call i32 @core6_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int no;
  printf("请输入一个正整数");
  scanf("%d", &no);
  while (no-- > 0) {
    putchar('*');
  }
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    117e <main+0x4e>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    115b <main+0x2b>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xchg   %ax,%ax
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    116b <main+0x3b>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\AD\A3\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @putchar(i8 signext 42)
br label %5
11: ; preds = %5
%12 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\AD\A3\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %13
8: ; preds = %0, %8
%9 = call i32 @putchar(i8 signext 42)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp sgt i32 %10, 0
br i1 %12, label %8, label %13
13: ; preds = %8, %0
%14 = call i32 @putchar(i8 signext 10)
ret i32 0
}
int f(int s, int c) {
  int a2, a3, x1, x2, x3, x;
  x1 = c + s;
  a2 = 5 * s;
  x2 = c + a2;
  a3 = 5 * c;
  x3 = s + a3;
  x = x1 + x2 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
add    %esi,%edi
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %3
%15 = mul nsw i32 5, %14
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
store i32 %18, i32* %8
%19 = load i32, i32* %4
%20 = mul nsw i32 5, %19
store i32 %20, i32* %6
%21 = load i32, i32* %3
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %9
%28 = add nsw i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %10
ret i32 %29
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = mul i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GetStringDone(int /*<<< orphan*/);
void GStrCancel() { GetStringDone(0); }


x86 assembly (clang, -O0):
<GStrCancel>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <GetStringDone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GStrCancel>:
xor    %edi,%edi
jmp    1030 <GetStringDone@plt>

LLVM IR (-O0):
define void @GStrCancel() {
%1 = call i32 @GetStringDone(i32 0)
ret void
}

LLVM IR (-O2):
define void @GStrCancel() {
%1 = tail call i32 @GetStringDone(i32 0)
ret void
}
int hwconfig_simulation_p(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwconfig_simulation_p() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xb5() {
  Assert_real((isupper(181) == 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_isupper.c",
              910, ("isupper should be 0 for 0xb5"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb5\00"
define void @t_isupper_0xb5() {
%1 = tail call i64 @isupper(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int FACOM_run(int);
int FACOM_start(void) { return FACOM_run(1); }


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

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

LLVM IR (-O0):
define i32 @FACOM_start() {
%1 = call i32 @FACOM_run(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @FACOM_start() {
%1 = tail call i32 @FACOM_run(i32 1)
ret i32 %1
}
/* Type definitions */
struct fb_var_screeninfo {
  int xres;
};

/* Variables and functions */
void put_pixel(int x, int y, void *fbp, struct fb_var_screeninfo *vinfo,
               char c) {
  unsigned long offset = x + y * vinfo->xres;
  *((char *)fbp + offset * sizeof(char)) = c;
}


x86 assembly (clang, -O0):
<put_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x0,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_pixel>:
imul   (%rcx),%esi
add    %edi,%esi
movslq %esi,%rax
mov    %r8b,(%rdx,%rax,1)
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32 }
define void @put_pixel(i32 %0, i32 %1, i8* %2, %struct.fb_var_screeninfo* %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.fb_var_screeninfo*
%10 = alloca i8
%11 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.fb_var_screeninfo* %3, %struct.fb_var_screeninfo** %9
store i8 %4, i8* %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %9
%15 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = mul nsw i32 %13, %16
%18 = add nsw i32 %12, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %11
%20 = load i8, i8* %10
%21 = load i8*, i8** %8
%22 = load i64, i64* %11
%23 = mul i64 %22, 1
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
ret void
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32 }
define void @put_pixel(i32 %0, i32 %1, i8* nocapture writeonly %2, %struct.fb_var_screeninfo* nocapture %3, i8 signext %4) {
%6 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %1
%9 = add nsw i32 %8, %0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %2, i64 %10
store i8 %4, i8* %11
ret void
}
/* Type definitions */
struct coprthr_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _printcl(char *, int, char *, char *);
void *task(struct coprthr_device *dev, void *argp) {
  do {
    if ("<4>"
        "cmdcall_x86_64:task: unsupported"[1] <= '0')
      _printcl("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/browndeer/coprthr/refs/heads/"
               "parallellocalypse/src/libcoprthr/arch/x86_64/devcmds_x86_64.c",
               199, "clmesg",
               "<4>"
               "cmdcall_x86_64:task: unsupported");
  } while (0);
  return (0);
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1111 <task+0x11>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.coprthr_device = type { i32 }
define i8* @task(%struct.coprthr_device* %0, i8* %1) {
%3 = alloca %struct.coprthr_device*
%4 = alloca i8*
store %struct.coprthr_device* %0, %struct.coprthr_device** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
%struct.coprthr_device = type { i32 }
define noalias i8* @task(%struct.coprthr_device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ declareStruct();
void test() { declareStruct(); }


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @declareStruct()
ret void
}
int main(void) {
  unsigned char *b = "b2";
  signed char *w = "w3";
  return b[1] + w[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"b2\00"
@.str.1 = [3 x i8] c"w3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 101
}
/* Variables and functions */
int copro_mc6809nc_read(unsigned int);
unsigned int get_memw(unsigned int addr) {
  return (copro_mc6809nc_read(addr) << 8) + copro_mc6809nc_read(addr + 1);
}


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

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

LLVM IR (-O0):
define i32 @get_memw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @copro_mc6809nc_read(i32 %3)
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = add i32 %6, 1
%8 = call i32 @copro_mc6809nc_read(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_memw(i32 %0) {
%2 = tail call i32 @copro_mc6809nc_read(i32 %0)
%3 = shl i32 %2, 8
%4 = add i32 %0, 1
%5 = tail call i32 @copro_mc6809nc_read(i32 %4)
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void trap_me() { printf("In trap me function\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"In trap me function\00"
define void @trap_me() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long fread(void *, size_t, int, int /*<<< orphan*/ *);
long read_from_file_pointer(void *fp, void *mem, size_t s) {
  long i = fread(mem, s, 1, (FILE *)fp);
  if (i == 0)
    return -1;
  return i;
}


x86 assembly (clang, -O0):
<read_from_file_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1156 <read_from_file_pointer+0x46>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    115e <read_from_file_pointer+0x4e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_file_pointer>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%rax
sbb    %rcx,%rcx
or     %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @read_from_file_pointer(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i64 @fread(i8* %1, i64 %2, i32 1, i32* %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 -1, i64 %5
ret i64 %7
}
/* Variables and functions */
float clampf(float, double, double);
float smoothstepf(float x0, float x1, float x) {
  float t = clampf((x - x0) / (x1 - x0), 0.0, 1.0);
  return t * t * (3 - 2 * t);
}


x86 assembly (clang, -O0):
<smoothstepf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
movsd  0xebe(%rip),%xmm2
call   1030 <clampf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
addss  %xmm2,%xmm2
movss  0xe91(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoothstepf>:
push   %rax
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
subss  %xmm0,%xmm1
divss  %xmm1,%xmm3
movsd  0xed8(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm3,%xmm0
call   1030 <clampf@plt>
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm0,%xmm0
movss  0xec2(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @smoothstepf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = fdiv float %10, %13
%15 = call float @clampf(float %14, double 0.000000e+00, double 1.000000e+00)
store float %15, float* %7
%16 = load float, float* %7
%17 = load float, float* %7
%18 = fmul float %16, %17
%19 = load float, float* %7
%20 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %19, float 3.000000e+00)
%21 = fmul float %18, %20
ret float %21
}

LLVM IR (-O2):
define float @smoothstepf(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = tail call float @clampf(float %6, double 0.000000e+00, double 1.000000e+00)
%8 = fmul float %7, %7
%9 = tail call float @llvm.fmuladd.f32(float %7, float -2.000000e+00, float 3.000000e+00)
%10 = fmul float %8, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ chalk_exit();
int /*<<< orphan*/ printf(char *, char *);
void print_version(void) {
  printf("%s\n", "Chalk VM version : 0.0.1 (Pre-Alpha)");
  chalk_exit();
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <chalk_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <chalk_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [37 x i8] c"Chalk VM version : 0.0.1 (Pre-Alpha)\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @chalk_exit()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [37 x i8] c"Chalk VM version : 0.0.1 (Pre-Alpha)\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @chalk_exit()
ret void
}
/* Variables and functions */
char *GetExt(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
extern void ChangeExt(char *dist, char *org, char *ext) {
  char *p;
  strcpy(dist, org);
  p = GetExt(dist);
  if (*p != '.') {
    p = dist + strlen(dist);
  }
  strcpy(p, ext);
}


x86 assembly (clang, -O0):
<ChangeExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <GetExt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     118f <ChangeExt+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChangeExt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <GetExt@plt>
cmpb   $0x2e,(%rax)
je     1159 <ChangeExt+0x29>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %rbx,%rax
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @ChangeExt(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i8* @GetExt(i8* %0)
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 46
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i32 @strlen(i8* %0)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
br label %12
12: ; preds = %8, %3
%13 = phi i8* [ %11, %8 ], [ %5, %3 ]
%14 = tail call i32 @strcpy(i8* %13, i8* %2)
ret void
}
int do_982() { return 982; }


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

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

LLVM IR (-O0):
define i32 @do_982() {
ret i32 982
}

LLVM IR (-O2):
define i32 @do_982() {
ret i32 982
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mp2vpicx_get_structure(const uint8_t *p_mp2vpicx) {
  return (p_mp2vpicx[6] & 0x3);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_structure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_structure>:
mov    0x18(%rdi),%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_structure(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_structure(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 3
ret i32 %4
}
/* Variables and functions */
char *dou2pre(double);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double a = 72.1;
  scanf("%lf", &a);
  char *ai;
  ai = dou2pre(a);
  printf("%s\n", ai);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <dou2pre@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x4052066666666666,%rax
06 52 40
mov    %rax,(%rsp)
lea    0xeba(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <dou2pre@plt>
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 7.210000e+01, double* %1
%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 = call i8* @dou2pre(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}