xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", 10 + 20);
  NULL;
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
/* Variables and functions */
char *base64encode(const void *b64_encode_this, int encode_this_many_bytes) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @base64encode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @base64encode(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
int test_imm_4Aint8_reg(signed char val) {
  return ((val) & (0x4A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Aint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Aint8_reg(i8 signext %0) {
%2 = and i8 %0, 74
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTSemFastMutexRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemFastMutexRelease() {
ret void
}
void gtk_tree_store_insert_before() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_store_insert_before() {
ret void
}
/* Variables and functions */
int prussdrv_exec_program_at(int, char const *, int /*<<< orphan*/);
int prussdrv_exec_program(int prunum, const char *filename) {
  return prussdrv_exec_program_at(prunum, filename, 0);
}


x86 assembly (clang, -O0):
<prussdrv_exec_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <prussdrv_exec_program_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prussdrv_exec_program>:
xor    %edx,%edx
jmp    1030 <prussdrv_exec_program_at@plt>

LLVM IR (-O0):
define i32 @prussdrv_exec_program(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 = load i8*, i8** %4
%7 = call i32 @prussdrv_exec_program_at(i32 %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @prussdrv_exec_program(i32 %0, i8* %1) {
%3 = tail call i32 @prussdrv_exec_program_at(i32 %0, i8* %1, i32 0)
ret i32 %3
}
int updateBits(unsigned int n, unsigned int m, int i, int j) {
  unsigned int nx;
  for (int x = 31; x >= 0; x--) {
    if (x > j || x < i) {
      nx = (n & (1 << x));
    } else {
      nx = (m & (1 << (x - i)));
    }
  }
  return nx;
}


x86 assembly (clang, -O0):
<updateBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x1f,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     117c <updateBits+0x7c>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1139 <updateBits+0x39>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <updateBits+0x52>
mov    -0x4(%rbp),%eax
mov    -0x18(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <updateBits+0x69>
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <updateBits+0x6e>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <updateBits+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateBits>:
test   %ecx,%ecx
sets   %r8b
test   %edx,%edx
setg   %al
xor    %ecx,%ecx
or     %r8b,%al
cmove  %edx,%ecx
cmove  %esi,%edi
neg    %cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @updateBits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 31, i32* %10
br label %11
11: ; preds = %35, %4
%12 = load i32, i32* %10
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %38
14: ; preds = %11
%15 = load i32, i32* %10
%16 = load i32, i32* %8
%17 = icmp sgt i32 %15, %16
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i32, i32* %10
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18, %14
%23 = load i32, i32* %5
%24 = load i32, i32* %10
%25 = shl i32 1, %24
%26 = and i32 %23, %25
store i32 %26, i32* %9
br label %34
27: ; preds = %18
%28 = load i32, i32* %6
%29 = load i32, i32* %10
%30 = load i32, i32* %7
%31 = sub nsw i32 %29, %30
%32 = shl i32 1, %31
%33 = and i32 %28, %32
store i32 %33, i32* %9
br label %34
34: ; preds = %27, %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %10
%37 = add nsw i32 %36, -1
store i32 %37, i32* %10
br label %11
38: ; preds = %11
%39 = load i32, i32* %9
ret i32 %39
}

LLVM IR (-O2):
define i32 @updateBits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 0
%6 = icmp sgt i32 %2, 0
%7 = or i1 %5, %6
%8 = select i1 %7, i32 0, i32 %2
%9 = sub nsw i32 0, %8
%10 = shl nuw i32 1, %9
%11 = select i1 %7, i32 %0, i32 %1
%12 = and i32 %10, %11
ret i32 %12
}
int value_convert(int x) {
  int y;
  asm("mov %[result], %[value];" : [result] "=r"(y) : [value] "r"(x) :);
  return y;
}


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

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

LLVM IR (-O0):
define i32 @value_convert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "mov $0, $1;", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @value_convert(i32 %0) {
%2 = tail call i32 asm "mov $0, $1;", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SOL_TCP;
int /*<<< orphan*/ perror(char *);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int, void *, int);
void set_socket_option(int s, int option, int value) {
  int option_value = 0;
  if (value)
    option_value = 1;
  if (setsockopt(s, SOL_TCP, option, (void *)&option_value, sizeof(int)) < 0)
    perror("setsockopt");
}


x86 assembly (clang, -O0):
<set_socket_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <set_socket_option+0x29>
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    117d <set_socket_option+0x5d>
lea    0xe88(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_option>:
push   %rax
mov    %esi,%eax
xor    %ecx,%ecx
test   %edx,%edx
setne  %cl
mov    %ecx,0x4(%rsp)
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
lea    0x4(%rsp),%rcx
mov    %eax,%edx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
js     1150 <set_socket_option+0x30>
pop    %rax
ret
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_TCP = global i32 0
@.str = [11 x i8] c"setsockopt\00"
define void @set_socket_option(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %7
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %4
%13 = load i32, i32* @SOL_TCP
%14 = load i32, i32* %5
%15 = bitcast i32* %7 to i8*
%16 = call i64 @setsockopt(i32 %12, i32 %13, i32 %14, i8* %15, i32 4)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
@SOL_TCP = global i32 0
@.str = [11 x i8] c"setsockopt\00"
define void @set_socket_option(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp ne i32 %2, 0
%7 = zext i1 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* @SOL_TCP
%9 = call i64 @setsockopt(i32 %0, i32 %8, i32 %1, i8* %5, i32 4)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
ret void
}
int baz2(const char *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz2(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int genrand64_int64();
double genrand64_real1(void) {
  return (genrand64_int64() >> 11) * (1.0 / 9007199254740991.0);
}


x86 assembly (clang, -O0):
<genrand64_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand64_real1>:
push   %rax
xor    %eax,%eax
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand64_real1() {
%1 = call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000001
ret double %4
}

LLVM IR (-O2):
define double @genrand64_real1() {
%1 = tail call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000001
ret double %4
}
int set_swapi(p, l)
int *p;
int l;
{
  union {
    int l;
    unsigned char c[4];
  } u;
  unsigned char temp;
  u.l = l;
  temp = u.c[0];
  u.c[0] = u.c[3];
  u.c[3] = temp;
  temp = u.c[1];
  u.c[1] = u.c[2];
  u.c[2] = temp;
  *p = u.l;
  return (0);
}


x86 assembly (clang, -O0):
<set_swapi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_swapi>:
bswap  %esi
mov    %esi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @set_swapi(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %union.anon
%6 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = bitcast %union.anon* %5 to i32*
store i32 %7, i32* %8
%9 = bitcast %union.anon* %5 to [4 x i8]*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
store i8 %11, i8* %6
%12 = bitcast %union.anon* %5 to [4 x i8]*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 3
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %5 to [4 x i8]*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 0
store i8 %14, i8* %16
%17 = load i8, i8* %6
%18 = bitcast %union.anon* %5 to [4 x i8]*
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 3
store i8 %17, i8* %19
%20 = bitcast %union.anon* %5 to [4 x i8]*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %20, i64 0, i64 1
%22 = load i8, i8* %21
store i8 %22, i8* %6
%23 = bitcast %union.anon* %5 to [4 x i8]*
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 2
%25 = load i8, i8* %24
%26 = bitcast %union.anon* %5 to [4 x i8]*
%27 = getelementptr inbounds [4 x i8], [4 x i8]* %26, i64 0, i64 1
store i8 %25, i8* %27
%28 = load i8, i8* %6
%29 = bitcast %union.anon* %5 to [4 x i8]*
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %29, i64 0, i64 2
store i8 %28, i8* %30
%31 = bitcast %union.anon* %5 to i32*
%32 = load i32, i32* %31
%33 = load i32*, i32** %3
store i32 %32, i32* %33
ret i32 0
}

LLVM IR (-O2):
define i32 @set_swapi(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @llvm.bswap.i32(i32 %1)
store i32 %3, i32* %0
ret i32 0
}
/* Variables and functions */
void *bmend(void *);
void *sringstart(void *shm) { return bmend(shm); }


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

x86 assembly (clang, -O2):
<sringstart>:
jmp    1030 <bmend@plt>

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

LLVM IR (-O2):
define i8* @sringstart(i8* %0) {
%2 = tail call i8* @bmend(i8* %0)
ret i8* %2
}
void page_cache_release(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @page_cache_release(%struct.page* nocapture %0) {
ret void
}
int add_digits(int num) {
  if (num == 0)
    return 0;
  int v = num % 9;
  return (v == 0) ? 9 : v;
}


x86 assembly (clang, -O0):
<add_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <add_digits+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    114e <add_digits+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <add_digits+0x42>
mov    $0x9,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <add_digits+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_digits>:
test   %edi,%edi
je     1129 <add_digits+0x29>
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @add_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = srem i32 %0, 9
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 9, i32 %4
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int isBitSet(unsigned char c, int i) { return (c & (1 << i)) ? 1 : 0; }


x86 assembly (clang, -O0):
<isBitSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBitSet>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isBitSet(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @isBitSet(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  if (sizeof(int) > -1)
    printf("True");
  else
    printf("False");
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"False\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"False\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void UART0_RX_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART0_RX_intr() {
ret void
}
/* Type definitions */
struct buddy {
  int dummy;
};

/* Variables and functions */
unsigned int buddy_order_start(struct buddy *, unsigned int);
unsigned int buddy_node_to_index(struct buddy *b, unsigned int node,
                                 unsigned int order) {
  unsigned int start = buddy_order_start(b, order);
  return (node - start) << order;
}


x86 assembly (clang, -O0):
<buddy_node_to_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <buddy_order_start@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buddy_node_to_index>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edx,%esi
call   1030 <buddy_order_start@plt>
sub    %eax,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.buddy = type { i32 }
define i32 @buddy_node_to_index(%struct.buddy* %0, i32 %1, i32 %2) {
%4 = alloca %struct.buddy*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.buddy* %0, %struct.buddy** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.buddy*, %struct.buddy** %4
%9 = load i32, i32* %6
%10 = call i32 @buddy_order_start(%struct.buddy* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub i32 %11, %12
%14 = load i32, i32* %6
%15 = shl i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
%struct.buddy = type { i32 }
define i32 @buddy_node_to_index(%struct.buddy* %0, i32 %1, i32 %2) {
%4 = tail call i32 @buddy_order_start(%struct.buddy* %0, i32 %2)
%5 = sub i32 %1, %4
%6 = shl i32 %5, %2
ret i32 %6
}
/* Variables and functions */
char *XX_httplib_skip_quoted(char **, char const *, char const *,
                             int /*<<< orphan*/);
char *XX_httplib_skip(char **buf, const char *delimiters) {
  return XX_httplib_skip_quoted(buf, delimiters, delimiters, 0);
}


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

x86 assembly (clang, -O2):
<XX_httplib_skip>:
mov    %rsi,%rdx
xor    %ecx,%ecx
jmp    1030 <XX_httplib_skip_quoted@plt>

LLVM IR (-O0):
define i8* @XX_httplib_skip(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 = load i8*, i8** %4
%8 = call i8* @XX_httplib_skip_quoted(i8** %5, i8* %6, i8* %7, i32 0)
ret i8* %8
}

LLVM IR (-O2):
define i8* @XX_httplib_skip(i8** %0, i8* %1) {
%3 = tail call i8* @XX_httplib_skip_quoted(i8** %0, i8* %1, i8* %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void pa_init_i18n(void) { empty_log("pa_init_i18n: nothing to do\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"pa_init_i18n: nothing to do\0A\00"
define void @pa_init_i18n() {
%1 = call i32 @empty_log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"pa_init_i18n: nothing to do\0A\00"
define void @pa_init_i18n() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  float f = 4.5;
  int i = (union {
            float f;
            int dv;
          }){f}
              .dv;
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca %union.anon
store i32 0, i32* %1
store float 4.500000e+00, float* %2
%5 = bitcast %union.anon* %4 to float*
%6 = load float, float* %2
store float %6, float* %5
%7 = bitcast %union.anon* %4 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1083179008)
ret i32 0
}
void gtk_tree_model_flags_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_flags_get_type() {
ret void
}
int cal2(float a) {
  float b = 1.2;
  float c = 2.2;
  if ((a + b) != c)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cal2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1142 <cal2+0x42>
jp     1142 <cal2+0x42>
jmp    114e <cal2+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <cal2+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal2>:
addss  0xef8(%rip),%xmm0
cmpeqss 0xef3(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cal2(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float 0x3FF3333340000000, float* %4
store float 0x40019999A0000000, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = load float, float* %5
%10 = fcmp une float %8, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @cal2(float %0) {
%2 = fadd float %0, 0x3FF3333340000000
%3 = fcmp oeq float %2, 0x40019999A0000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *delete_ele_of_b_from_a(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char str_a[30] = "They are students.";
  char str_b[10] = "aeiou";
  char *str_c = delete_ele_of_b_from_a(str_a, str_b);
  puts(str_c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x3a(%rbp)
mov    0xeb0(%rip),%ax
mov    %ax,-0x32(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1040 <delete_ele_of_b_from_a@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x756f696561,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <delete_ele_of_b_from_a@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.str_a = [30 x i8] c"They are students.\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str_b = [10 x i8] c"aeiou\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [10 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [30 x i8]* %2 to i8*
%6 = bitcast [10 x i8]* %3 to i8*
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i8* @delete_ele_of_b_from_a(i8* %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @puts(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str_a = [30 x i8] c"They are students.\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str_b = [10 x i8] c"aeiou\00\00\00\00\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i8* @delete_ele_of_b_from_a(i8* %3, i8* %4)
%6 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: couchpw [-c] passwordfile username\n");
  fprintf(stderr, "The -c flag creates a new file.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: couchpw [-c] passwordfile username\0A\00"
@.str.1 = [33 x i8] c"The -c flag creates a new file.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: couchpw [-c] passwordfile username\0A\00"
@.str.1 = [33 x i8] c"The -c flag creates a new file.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int);
void decefr(int top, int left, int bottom, int right) {
  do_csi("%d;%d;%d;%d'w", top, left, bottom, right);
}


x86 assembly (clang, -O0):
<decefr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decefr>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d;%d;%d;%d'w\00"
define void @decefr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d;%d;%d;%d'w\00"
define void @decefr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int helper(int /*<<< orphan*/, int, int *, int);
int rob(int *nums, int numsSize) {
  return helper(0, numsSize - 1, nums, numsSize);
}


x86 assembly (clang, -O0):
<rob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rob>:
mov    %esi,%ecx
mov    %rdi,%rdx
lea    -0x1(%rcx),%esi
xor    %edi,%edi
jmp    1030 <helper@plt>

LLVM IR (-O0):
define i32 @rob(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @helper(i32 0, i32 %6, i32* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @rob(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @helper(i32 0, i32 %3, i32* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcsncasecmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *, int);
int wcscasecmp(const wchar_t *l, const wchar_t *r) {
  return wcsncasecmp(l, r, -1);
}


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

x86 assembly (clang, -O2):
<wcscasecmp>:
mov    $0xffffffff,%edx
jmp    1030 <wcsncasecmp@plt>

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

LLVM IR (-O2):
define i32 @wcscasecmp(i32* %0, i32* %1) {
%3 = tail call i32 @wcsncasecmp(i32* %0, i32* %1, i32 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int print_string(char *string) {
  int i;
  char c;
  i = 0;
  while ((c = *(string + i)) != '\0') {
    printf("%c", c);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     115b <print_string+0x4b>
lea    0xebc(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <print_string+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @print_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8, i8* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %14)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x9b() {
  Assert_real((iscntrl(155) == 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",
              780, ("iscntrl should be 0 for 0x9b"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x9b>:
push   %rax
mov    $0x9b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x30c,%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 0x9b\00"
define void @t_iscntrl_0x9b() {
%1 = call i64 @iscntrl(i32 155)
%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 780, 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 0x9b\00"
define void @t_iscntrl_0x9b() {
%1 = tail call i64 @iscntrl(i32 155)
%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 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_8Euint16_reg(unsigned short val) {
  return ((val) & (0x8E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 142
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;

/* Variables and functions */
int EINVAL;
int pthread_condattr_destroy(pthread_condattr_t *attr) {
  if (attr == NULL)
    return (EINVAL);
  return (0);
}


x86 assembly (clang, -O0):
<pthread_condattr_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <pthread_condattr_destroy+0x24>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <pthread_condattr_destroy+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_condattr_destroy>:
xor    %eax,%eax
test   %rdi,%rdi
jne    1110 <pthread_condattr_destroy+0x10>
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_condattr_destroy(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = load i32, i32* @EINVAL
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *intToRoman(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", intToRoman(atoi(argv[1])));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <intToRoman@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i8* @intToRoman(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnbr(int n) {
  if (n < 0) {
    n = -n;
    ft_putchar('-');
  }
  if (n >= 10) {
    ft_putnbr(n / 10);
  }
  ft_putchar(n % 10 + '0');
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <ft_putnbr+0x27>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
cmpl   $0xa,-0x4(%rbp)
jl     1163 <ft_putnbr+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <ft_putnbr+0x16>
neg    %ebx
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <ft_putnbr+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <ft_putnbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @ft_putchar(i32 45)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @ft_putnbr(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @ft_putchar(i32 %13)
ret void
}
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_abs(void) {
  double d = luaL_check_number(1);
  if (d < 0)
    d = -d;
  lua_pushnumber(d);
}


x86 assembly (clang, -O0):
<math_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1166 <math_abs+0x46>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_abs>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movapd 0xecd(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_abs() {
%1 = alloca double
%2 = call double @luaL_check_number(i32 1)
store double %2, double* %1
%3 = load double, double* %1
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load double, double* %1
%7 = fneg double %6
store double %7, double* %1
br label %8
8: ; preds = %5, %0
%9 = load double, double* %1
%10 = call i32 @lua_pushnumber(double %9)
ret void
}

LLVM IR (-O2):
define void @math_abs() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fcmp olt double %1, 0.000000e+00
%3 = fneg double %1
%4 = select i1 %2, double %3, double %1
%5 = tail call i32 @lua_pushnumber(double %4)
ret void
}