xunge/DecIR huggingface dataset:
int main(int argc, char *argv[]) {
  int n;
  n = 25;
  int *k = &n;
  printf("n = %d\n", n);
  printf("k = %d\n", k);
  printf("*k = %d\n", *k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x19,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x19,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0x19,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"n = %d\0A\00"
@.str.1 = [8 x i8] c"k = %d\0A\00"
@.str.2 = [9 x i8] c"*k = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 25, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 25)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
int fun221() { return 221; }


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

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

LLVM IR (-O0):
define i32 @fun221() {
ret i32 221
}

LLVM IR (-O2):
define i32 @fun221() {
ret i32 221
}
void abcd1efghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcd1efghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
double log(int);
int unif_dist();
double pk_dist() { return log(1 / unif_dist()); }


x86 assembly (clang, -O0):
<pk_dist>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <unif_dist@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <log@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pk_dist>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unif_dist@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @pk_dist() {
%1 = call i32 (...) @unif_dist()
%2 = sdiv i32 1, %1
%3 = call double @log(i32 %2)
ret double %3
}

LLVM IR (-O2):
define double @pk_dist() {
%1 = tail call i32 (...) @unif_dist()
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
%5 = tail call double @log(i32 %4)
ret double %5
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int16_t complementBit_fun_int16_t(int16_t x, uint32_t i) { return x ^ 1 << i; }


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

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

LLVM IR (-O0):
define i32 @complementBit_fun_int16_t(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @complementBit_fun_int16_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int /*<<< orphan*/ stderr;
void dummy_dwell(void *user, float f) {
  fprintf(stderr, "GCodeParser: dwell(%.1f)\n", f);
}


x86 assembly (clang, -O0):
<dummy_dwell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
movss  -0xc(%rbp),%xmm0
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_dwell>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"GCodeParser: dwell(%.1f)\0A\00"
define void @dummy_dwell(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i32, i32* @stderr
%6 = load float, float* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"GCodeParser: dwell(%.1f)\0A\00"
define void @dummy_dwell(i8* nocapture readnone %0, float %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_term_handler(int signal) {
  exit(EXIT_SUCCESS);
  (void)signal;
}


x86 assembly (clang, -O0):
<signal_term_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<signal_term_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @signal_term_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @signal_term_handler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _irc_queue_insert(int, char *, char *, char *);
int irc_topic(char *chan, char *topic) {
  _irc_queue_insert(5, "TOPIC %s :%s", chan, topic);
  return 0;
}


x86 assembly (clang, -O0):
<irc_topic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x5,%edi
lea    0xecc(%rip),%rsi
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_topic>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    $0x5,%edi
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"TOPIC %s :%s\00"
define i32 @irc_topic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"TOPIC %s :%s\00"
define i32 @irc_topic(i8* %0, i8* %1) {
%3 = tail call i32 @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
unsigned long expression(unsigned long v) {
  unsigned long ret;
  __asm__("" : "=r"(ret) : "0"(0));
  return ret + v;
}


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

x86 assembly (clang, -O2):
<expression>:
xor    %eax,%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @expression(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = add i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @expression(i64 %0) {
%2 = tail call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
%3 = add i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0, pot = 0;
  do {
    pot = i * 2;
    printf("%i \n", pot);
    i++;
  } while (i <= 2010);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7da,-0x8(%rbp)
jle    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    $0xfb6,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%i \0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = shl nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 2011
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
char *gu_str_advance(char const *, int);
size_t strtoul(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t gu_str_table_get_n_rows(const char *str) {
  str = gu_str_advance(str, 2);
  return strtoul(str, NULL, 0);
}


x86 assembly (clang, -O0):
<gu_str_table_get_n_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <gu_str_advance@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_str_table_get_n_rows>:
push   %rax
mov    $0x2,%esi
call   1030 <gu_str_advance@plt>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <strtoul@plt>

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

LLVM IR (-O2):
define i64 @gu_str_table_get_n_rows(i8* %0) {
%2 = tail call i8* @gu_str_advance(i8* %0, i32 2)
%3 = tail call i64 @strtoul(i8* nocapture %2, i32* null, i32 0)
ret i64 %3
}
void stop_time(void) { (*(volatile unsigned char *)0x0029) &= 0xFD; }


x86 assembly (clang, -O0):
<stop_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xfd,%eax
mov    %al,%cl
mov    $0x29,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_time>:
andb   $0xfd,0x29
fd
ret

LLVM IR (-O0):
define void @stop_time() {
%1 = load volatile i8, i8* inttoptr (i64 41 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, 253
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 41 to i8*)
ret void
}

LLVM IR (-O2):
define void @stop_time() {
%1 = load volatile i8, i8* inttoptr (i64 41 to i8*)
%2 = and i8 %1, -3
store volatile i8 %2, i8* inttoptr (i64 41 to i8*)
ret void
}
searchElement() {}


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

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

LLVM IR (-O0):
define i32 @searchElement() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @searchElement() {
ret i32 undef
}
int Arith_min(int x, int y) { return x > y ? y : x; }


x86 assembly (clang, -O0):
<Arith_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <Arith_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Arith_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arith_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Arith_min(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Arith_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int test_imm_8Cuint16_mem(unsigned short *val) {
  return ((*val) & (-0x8C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Cuint16_mem>:
movzwl (%rdi),%eax
test   $0xff74,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -140
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mywrite(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main() {
  char *mystr = "Welcome to baby OS!\n";
  mywrite(1, mystr, strlen(mystr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <mywrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <mywrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Welcome to baby OS!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @mywrite(i32 1, i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Welcome to baby OS!\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @mywrite(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct evloop {
  int dummy;
};
struct ev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _stop_ev(struct evloop *, struct ev *);
void evio_stop(struct evloop *loop, struct ev *ev) { _stop_ev(loop, ev); }


x86 assembly (clang, -O0):
<evio_stop>:
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 <_stop_ev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evio_stop>:
jmp    1030 <_stop_ev@plt>

LLVM IR (-O0):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define void @evio_stop(%struct.evloop* %0, %struct.ev* %1) {
%3 = alloca %struct.evloop*
%4 = alloca %struct.ev*
store %struct.evloop* %0, %struct.evloop** %3
store %struct.ev* %1, %struct.ev** %4
%5 = load %struct.evloop*, %struct.evloop** %3
%6 = load %struct.ev*, %struct.ev** %4
%7 = call i32 @_stop_ev(%struct.evloop* %5, %struct.ev* %6)
ret void
}

LLVM IR (-O2):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define void @evio_stop(%struct.evloop* %0, %struct.ev* %1) {
%3 = tail call i32 @_stop_ev(%struct.evloop* %0, %struct.ev* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_PW5_PIN() { clear_io_bit(0x40, 5); }


x86 assembly (clang, -O0):
<TOSH_CLR_PW5_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x5,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_PW5_PIN>:
mov    $0x40,%edi
mov    $0x5,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_PW5_PIN() {
%1 = call i32 @clear_io_bit(i32 64, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_PW5_PIN() {
%1 = tail call i32 @clear_io_bit(i32 64, i32 5)
ret void
}
void test_unsigned() {
  unsigned char a;
  unsigned short b;
  unsigned int c;
  unsigned long d;
  unsigned long long e;
  unsigned short int f;
  unsigned long int g;
  unsigned long long int h;
}


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

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

LLVM IR (-O0):
define void @test_unsigned() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
%8 = alloca i64
ret void
}

LLVM IR (-O2):
define void @test_unsigned() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0;
  if (i = 0) {
    printf("i=%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    113c <main+0x2c>
jmp    114b <main+0x3b>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isnan(double);
int isinf_d(double x) { return !isnan(x) && isnan(x - x); }


x86 assembly (clang, -O0):
<isinf_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1152 <isinf_d+0x42>
movsd  -0x8(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf_d>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1127 <isinf_d+0x17>
pop    %rcx
ret
movsd  (%rsp),%xmm0
subsd  %xmm0,%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isinf_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isnan(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = call i64 @isnan(double %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isinf_d(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub double %0, %0
%6 = tail call i64 @isnan(double %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
void *debug_malloc(int, char const *, int, char *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *debug_calloc(int n, int s, const char *fn, int lno, char *tstamp) {
  void *p = debug_malloc(n * s, fn, lno, tstamp);
  if (p)
    memset(p, 0, n * s);
  return p;
}


x86 assembly (clang, -O0):
<debug_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <debug_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <debug_calloc+0x51>
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8,%rcx
call   1040 <debug_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114c <debug_calloc+0x2c>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @debug_calloc(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = call i8* @debug_malloc(i32 %14, i8* %15, i32 %16, i8* %17)
store i8* %18, i8** %11
%19 = load i8*, i8** %11
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %5
%22 = load i8*, i8** %11
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
%26 = call i32 @memset(i8* %22, i32 0, i32 %25)
br label %27
27: ; preds = %21, %5
%28 = load i8*, i8** %11
ret i8* %28
}

LLVM IR (-O2):
define i8* @debug_calloc(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = mul nsw i32 %1, %0
%7 = tail call i8* @debug_malloc(i32 %6, i8* %2, i32 %3, i8* %4)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @memset(i8* %7, i32 0, i32 %6)
br label %11
11: ; preds = %9, %5
ret i8* %7
}
void test_four(int x, int y) {
#pragma omp simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
char *objname(int);
char *rstrdup(char *);
char *getname(int inum) {
  if (inum == 0)
    return rstrdup("* 0 *");
  return objname(inum);
}


x86 assembly (clang, -O0):
<getname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114a <getname+0x2a>
lea    0xec4(%rip),%rdi
call   1040 <rstrdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1156 <getname+0x36>
mov    -0xc(%rbp),%edi
call   1030 <objname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getname>:
test   %edi,%edi
je     1129 <getname+0x9>
jmp    1030 <objname@plt>
lea    0xed0(%rip),%rdi
jmp    1040 <rstrdup@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"* 0 *\00"
define i8* @getname(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i8* @rstrdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i8* @objname(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ %4, %3 ], [ %6, %5 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
long long signed_poly(long long, int);
unsigned long long unsigned_poly(unsigned long long, int);
int main(void) {
  if (signed_poly(2LL, -3) != -4LL)
    abort();
  if (unsigned_poly(2ULL, 3) != 8ULL)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0xfffffffd,%esi
call   1050 <signed_poly@plt>
cmp    $0xfffffffffffffffc,%rax
je     116f <main+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <unsigned_poly@plt>
cmp    $0x8,%rax
je     118f <main+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xfffffffd,%esi
call   1050 <signed_poly@plt>
cmp    $0xfffffffffffffffc,%rax
jne    1172 <main+0x32>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <unsigned_poly@plt>
cmp    $0x8,%rax
jne    1172 <main+0x32>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @signed_poly(i64 2, i32 -3)
%3 = icmp ne i64 %2, -4
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i64 @unsigned_poly(i64 2, i32 3)
%8 = icmp ne i64 %7, 8
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @signed_poly(i64 2, i32 -3)
%2 = icmp eq i64 %1, -4
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i64 @unsigned_poly(i64 2, i32 3)
%7 = icmp eq i64 %6, 8
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ init_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system_call_test();
int /*<<< orphan*/ system_call_wrapper_test();
int main(void) {
  if (init_test() != 0) {
    printf("FAILURE init_test");
    return -1;
  }
  system_call_test();
  system_call_wrapper_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init_test@plt>
cmp    $0x0,%rax
je     1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <main+0x4d>
mov    $0x0,%al
call   1040 <system_call_test@plt>
mov    $0x0,%al
call   1050 <system_call_wrapper_test@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <init_test@plt>
test   %rax,%rax
je     1162 <main+0x22>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
jmp    1170 <main+0x30>
xor    %eax,%eax
call   1040 <system_call_test@plt>
xor    %eax,%eax
call   1050 <system_call_wrapper_test@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"FAILURE init_test\00"
define i32 @main() {
%1 = tail call i64 (...) @init_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 (...) @system_call_test()
%7 = tail call i32 (...) @system_call_wrapper_test()
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ globale();
int main(void) {
  globale();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @globale()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_Ofilm(int, int);
void AfDrvSw_OFILM(unsigned char UcDrvSw_OFILM) {
  if (UcDrvSw_OFILM == 0x01) {
    RegWriteA_Ofilm(0x0081, 0x20);
    RegWriteA_Ofilm(0x00A0, 0x80);
  } else {
    RegWriteA_Ofilm(0x00A0, 0x00);
  }
}


x86 assembly (clang, -O0):
<AfDrvSw_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <AfDrvSw_OFILM+0x3e>
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_Ofilm@plt>
mov    $0xa0,%edi
mov    $0x80,%esi
call   1030 <RegWriteA_Ofilm@plt>
jmp    115a <AfDrvSw_OFILM+0x4a>
mov    $0xa0,%edi
xor    %esi,%esi
call   1030 <RegWriteA_Ofilm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfDrvSw_OFILM>:
xor    %esi,%esi
cmp    $0x1,%dil
jne    1131 <AfDrvSw_OFILM+0x21>
push   %rax
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_Ofilm@plt>
mov    $0x80,%esi
add    $0x8,%rsp
mov    $0xa0,%edi
jmp    1030 <RegWriteA_Ofilm@plt>

LLVM IR (-O0):
define void @AfDrvSw_OFILM(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @RegWriteA_Ofilm(i32 129, i32 32)
%8 = call i32 @RegWriteA_Ofilm(i32 160, i32 128)
br label %11
9: ; preds = %1
%10 = call i32 @RegWriteA_Ofilm(i32 160, i32 0)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @AfDrvSw_OFILM(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @RegWriteA_Ofilm(i32 129, i32 32)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 128, %3 ], [ 0, %1 ]
%7 = tail call i32 @RegWriteA_Ofilm(i32 160, i32 %6)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exists(char *path) {
  struct stat st;
  return (0 == stat(path, &st));
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 0, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double log(double);
double ln(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<ln>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @ln(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ UARTIntHandler();
void UART_ISR(void) { UARTIntHandler(); }


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

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

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

LLVM IR (-O2):
define void @UART_ISR() {
%1 = tail call i32 (...) @UARTIntHandler()
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_emit_signal(void *bus, const char *path, const char *interface,
                   const char *member, const char *types, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_emit_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_emit_signal>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_emit_signal(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, ...) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_emit_signal(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, ...) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
unsigned int count_char(const char *astring, const char achar) {
  unsigned int i = 0, j = 0;
  while (astring[i] != '\0') {
    if (astring[i] == achar)
      j++;
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115e <count_char+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1150 <count_char+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <count_char+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%r8b
xor    %eax,%eax
test   %r8b,%r8b
je     1129 <count_char+0x29>
mov    $0x1,%ecx
nop
xor    %edx,%edx
cmp    %sil,%r8b
sete   %dl
add    %edx,%eax
mov    %ecx,%edx
movzbl (%rdi,%rdx,1),%r8d
add    $0x1,%ecx
test   %r8b,%r8b
jne    1110 <count_char+0x10>
ret

LLVM IR (-O0):
define i32 @count_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %28, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %28
25: ; preds = %15
%26 = load i32, i32* %6
%27 = add i32 %26, 1
store i32 %27, i32* %6
br label %28
28: ; preds = %25, %15
%29 = load i32, i32* %5
%30 = add i32 %29, 1
store i32 %30, i32* %5
br label %7
31: ; preds = %7
%32 = load i32, i32* %6
ret i32 %32
}

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add i32 %7, %10
%12 = add i32 %8, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x26() {
  Assert_real((isgraph(38)),
              "/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_isgraph.c",
              195, ("isgraph should be 1 for &"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x26>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xc3,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x26>:
push   %rax
mov    $0x26,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xc3,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for &\00"
define void @t_isgraph_0x26() {
%1 = call i32 @isgraph(i32 38)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for &\00"
define void @t_isgraph_0x26() {
%1 = tail call i32 @isgraph(i32 38)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int HASH(const char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}


x86 assembly (clang, -O0):
<HASH>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <HASH+0x43>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <HASH+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HASH>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <HASH+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HASH+0x10>
movzbl %al,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HASH(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_setcchar(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_setcchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_setcchar+0x2a>
jmp    1170 <cmd_setcchar+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_setcchar>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_setcchar+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_setcchar(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int test_imm_1Euint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Euint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x1e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Euint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 128849018880
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}