xunge/DecIR huggingface dataset:
void fd262(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a : {
  typedef int(*f)[n];
P02A:
  goto P02A;
  {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
P02B:
  goto P02B;
  {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
P02C:
  goto P02C;
  ;
  typedef int(*i)[n];
P026A:
  goto P026A;
  0;
};
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
p03A:
  goto p03A;
  goto a;
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd262>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd262+0x7>

x86 assembly (clang, -O2):
<fd262>:
jmp    1100 <fd262>

LLVM IR (-O0):
define void @fd262(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; No predecessors!
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %25, %22
br label %25
26: ; No predecessors!
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; No predecessors!
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
br label %39
39: ; preds = %39, %36
br label %39
40: ; preds = %40
br label %40
41: ; No predecessors!
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
br label %44
44: ; preds = %44, %41
br label %44
45: ; preds = %45
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd262(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
size_t nearest_power(size_t num) {
  size_t const MAX_SIZE = -1;
  if (num > MAX_SIZE / 2) {
    return MAX_SIZE;
  }
  size_t power = 1;
  while (power < num) {
    power <<= 1;
  }
  return power;
}


x86 assembly (clang, -O0):
<nearest_power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,-0x10(%rbp)
jbe    1131 <nearest_power+0x31>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1160 <nearest_power+0x60>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <nearest_power+0x58>
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <nearest_power+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearest_power>:
test   %rdi,%rdi
js     111c <nearest_power+0x1c>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <nearest_power+0x10>
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @nearest_power(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 -1, i64* %4
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 9223372036854775807
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 -1, i64* %2
br label %19
9: ; preds = %1
store i64 1, i64* %5
br label %10
10: ; preds = %14, %9
%11 = load i64, i64* %5
%12 = load i64, i64* %3
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i64, i64* %5
%16 = shl i64 %15, 1
store i64 %16, i64* %5
br label %10
17: ; preds = %10
%18 = load i64, i64* %5
store i64 %18, i64* %2
br label %19
19: ; preds = %17, %8
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @nearest_power(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = icmp ult i64 %4, %0
%6 = shl i64 %4, 1
br i1 %5, label %3, label %7
7: ; preds = %3, %1
%8 = phi i64 [ -1, %1 ], [ %4, %3 ]
ret i64 %8
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sockaddr_in6 *);
void tow_internet6_socket_address_free(struct sockaddr_in6 *socket_address) {
  free(socket_address);
}


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

x86 assembly (clang, -O2):
<tow_internet6_socket_address_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
define void @tow_internet6_socket_address_free(%struct.sockaddr_in6* nocapture %0) {
%2 = tail call i32 @free(%struct.sockaddr_in6* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ smp_test_kv_create();
void smp_test_str_main() {
  smp_test_kv_create();
  printf("finished test\n");
}


x86 assembly (clang, -O0):
<smp_test_str_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <smp_test_kv_create@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_str_main>:
push   %rax
xor    %eax,%eax
call   1040 <smp_test_kv_create@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"finished test\0A\00"
define void @smp_test_str_main() {
%1 = call i32 (...) @smp_test_kv_create()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"finished test\00"
define void @smp_test_str_main() {
%1 = tail call i32 (...) @smp_test_kv_create()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void indirect2(int arr[]) {
  print_string("should get 100\ngot: ");
  print_int(arr[1]);
  print_string("\n\n");
}


x86 assembly (clang, -O0):
<indirect2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <print_int@plt>
lea    0xeca(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect2>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <print_string@plt>
mov    0x4(%rbx),%edi
call   1040 <print_int@plt>
lea    0xed6(%rip),%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"should get 100\0Agot: \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @indirect2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @print_string(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = call i32 @print_int(i32 %6)
%8 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"should get 100\0Agot: \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @indirect2(i32* nocapture %0) {
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @print_int(i32 %4)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ quick_sort2(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void sort2(int32_t *a, int32_t n) { quick_sort2(a, 0, n); }


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

x86 assembly (clang, -O2):
<sort2>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <quick_sort2@plt>

LLVM IR (-O0):
define void @sort2(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 @quick_sort2(i32* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @sort2(i32* %0, i32 %1) {
%3 = tail call i32 @quick_sort2(i32* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 1)
    exit(1);
  {
    int ix;
    ix = printf("hello\n");
    printf("%d\n", ix);
  }
  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)
cmpl   $0x1,-0x8(%rbp)
je     114a <main+0x2a>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea2(%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
cmp    $0x1,%edi
jne    1148 <main+0x28>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"hello\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
                    int add_pos) {
  return;
}


x86 assembly (clang, -O0):
<dbg_check_heap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.ubifs_lpt_heap = type opaque
define void @dbg_check_heap(%struct.ubifs_info* %0, %struct.ubifs_lpt_heap* %1, i32 %2, i32 %3) {
%5 = alloca %struct.ubifs_info*
%6 = alloca %struct.ubifs_lpt_heap*
%7 = alloca i32
%8 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %5
store %struct.ubifs_lpt_heap* %1, %struct.ubifs_lpt_heap** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_lpt_heap = type opaque
define void @dbg_check_heap(%struct.ubifs_info* nocapture %0, %struct.ubifs_lpt_heap* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  while (len > 0) {
    len--;
    ((unsigned char *)b)[len] = (unsigned char)c;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    113b <ft_memset+0x3b>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    110f <ft_memset+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ mrf24j40_rf_reset();
int /*<<< orphan*/ mrf24j40_write_long_ctrl_reg(int, int);
void mrf24j40_set_channel(int16_t ch) {
  mrf24j40_write_long_ctrl_reg(0x200, ((ch & 0x0F) << 4) | ((0x03 & 0x0F)));
  mrf24j40_rf_reset();
}


x86 assembly (clang, -O0):
<mrf24j40_set_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0xf,%esi
shl    $0x4,%esi
or     $0x3,%esi
mov    $0x200,%edi
call   1040 <mrf24j40_write_long_ctrl_reg@plt>
mov    $0x0,%al
call   1030 <mrf24j40_rf_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_set_channel>:
push   %rax
shl    $0x4,%edi
or     $0x3,%edi
movzbl %dil,%esi
mov    $0x200,%edi
call   1040 <mrf24j40_write_long_ctrl_reg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mrf24j40_rf_reset@plt>

LLVM IR (-O0):
define void @mrf24j40_set_channel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = shl i32 %4, 4
%6 = or i32 %5, 3
%7 = call i32 @mrf24j40_write_long_ctrl_reg(i32 512, i32 %6)
%8 = call i32 (...) @mrf24j40_rf_reset()
ret void
}

LLVM IR (-O2):
define void @mrf24j40_set_channel(i32 %0) {
%2 = shl i32 %0, 4
%3 = and i32 %2, 240
%4 = or i32 %3, 3
%5 = tail call i32 @mrf24j40_write_long_ctrl_reg(i32 512, i32 %4)
%6 = tail call i32 (...) @mrf24j40_rf_reset()
ret void
}
/* Variables and functions */
int hexdigit(char);
char x2c(char *const x) { return (hexdigit(x[0]) * 16) + hexdigit(x[1]); }


x86 assembly (clang, -O0):
<x2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hexdigit@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hexdigit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @x2c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @hexdigit(i8 signext %5)
%7 = mul nsw i32 %6, 16
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @hexdigit(i8 signext %10)
%12 = add nsw i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @x2c(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hexdigit(i8 signext %2)
%4 = shl nsw i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @hexdigit(i8 signext %6)
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
void disable_hmat(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_hmat() {
ret void
}
int initColorMatrix(int color[], int N) {
  int i;
  for (i = 0; i < N; ++i)
    color[i] = -1;
}


x86 assembly (clang, -O0):
<initColorMatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    113b <initColorMatrix+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <initColorMatrix+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initColorMatrix>:
test   %esi,%esi
jle    1129 <initColorMatrix+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @initColorMatrix(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32 undef
}
void tegra114_init_speedo_data(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra114_init_speedo_data() {
ret void
}
/* Variables and functions */
unsigned char I2C1_Rd(unsigned int);
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(int);
unsigned char eepromReadCurrent(int deviceAddress) {
  unsigned char value;
  I2C1_Start();
  I2C1_Wr(0xa0 + (deviceAddress << 1) + 1);
  value = I2C1_Rd(1u);
  I2C1_Stop();
  return value;
}


x86 assembly (clang, -O0):
<eepromReadCurrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <I2C1_Start@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0xa0,%edi
add    $0x1,%edi
call   1050 <I2C1_Wr@plt>
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <I2C1_Stop@plt>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eepromReadCurrent>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <I2C1_Start@plt>
lea    (%rbx,%rbx,1),%edi
add    $0xa1,%edi
call   1050 <I2C1_Wr@plt>
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <I2C1_Stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @eepromReadCurrent(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = call i32 (...) @I2C1_Start()
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
%7 = add nsw i32 160, %6
%8 = add nsw i32 %7, 1
%9 = call i32 @I2C1_Wr(i32 %8)
%10 = call zeroext i8 @I2C1_Rd(i32 1)
store i8 %10, i8* %3
%11 = call i32 (...) @I2C1_Stop()
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @eepromReadCurrent(i32 %0) {
%2 = tail call i32 (...) @I2C1_Start()
%3 = shl i32 %0, 1
%4 = add nsw i32 %3, 161
%5 = tail call i32 @I2C1_Wr(i32 %4)
%6 = tail call zeroext i8 @I2C1_Rd(i32 1)
%7 = tail call i32 (...) @I2C1_Stop()
ret i8 %6
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int tm_wday;
};

/* Variables and functions */
struct tm *localtime(scalar_t__ *);
scalar_t__ time(int /*<<< orphan*/ *);
void get_week(time_t *startDate, time_t *endDate) {
  time_t t = time(NULL);
  struct tm *d;
  d = localtime(&t);
  t -= 86400 * d->tm_wday;
  *startDate = t;
  *endDate = t + 86400 * 6;
}


x86 assembly (clang, -O0):
<get_week>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x15180,(%rax),%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
add    $0x7e900,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_week>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <localtime@plt>
movslq (%rax),%rax
imul   $0x15180,%rax,%rax
mov    (%rsp),%rcx
mov    %rcx,%rdx
sub    %rax,%rdx
mov    %rdx,(%rbx)
neg    %rax
add    %rcx,%rax
add    $0x7e900,%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @get_week(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
%6 = alloca %struct.tm*
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = call i64 @time(i32* null)
store i64 %7, i64* %5
%8 = call %struct.tm* @localtime(i64* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = mul nsw i32 86400, %11
%13 = sext i32 %12 to i64
%14 = load i64, i64* %5
%15 = sub nsw i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64*, i64** %3
store i64 %16, i64* %17
%18 = load i64, i64* %5
%19 = add nsw i64 %18, 518400
%20 = load i64*, i64** %4
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @get_week(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i64 @time(i32* null)
store i64 %5, i64* %3
%6 = call %struct.tm* @localtime(i64* %3)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 86400
%10 = sext i32 %9 to i64
%11 = load i64, i64* %3
%12 = sub nsw i64 %11, %10
store i64 %12, i64* %0
%13 = add nsw i64 %12, 518400
store i64 %13, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INVOKEVIRTUAL();
void INVOKEINTERFACE() { INVOKEVIRTUAL(); }


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

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

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

LLVM IR (-O2):
define void @INVOKEINTERFACE() {
%1 = tail call i32 (...) @INVOKEVIRTUAL()
ret void
}
/* Variables and functions */
int command(int, int, unsigned int);
int gpio_clear(unsigned int pin) { return command(1, 3, pin); }


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

x86 assembly (clang, -O2):
<gpio_clear>:
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x3,%esi
jmp    1030 <command@plt>

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

LLVM IR (-O2):
define i32 @gpio_clear(i32 %0) {
%2 = tail call i32 @command(i32 1, i32 3, i32 %0)
ret i32 %2
}
/* Variables and functions */
char *strchr(char *, char);
char *strrchr(char *, char);
char *filenameof(char *fname) {
  char *p;
  p = strrchr(fname, '/');
  if (p)
    fname = p + 1;
  p = strchr(fname, '.');
  if (p)
    *p = 0;
  return fname;
}


x86 assembly (clang, -O0):
<filenameof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <filenameof+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1179 <filenameof+0x59>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filenameof>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1151 <filenameof+0x31>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @filenameof(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %2
%13 = call i8* @strchr(i8* %12, i8 signext 46)
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i8*, i8** %3
store i8 0, i8* %17
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @filenameof(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i8* @strchr(i8* dereferenceable(1) %5, i8 signext 46)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ update_z_conf(float, int);
void vff_update(float z_meas) { update_z_conf(z_meas, 1.); }


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

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

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

LLVM IR (-O2):
define void @vff_update(float %0) {
%2 = tail call i32 @update_z_conf(float %0, i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t cdr(int32_t p) {
  int32_t *d = (int32_t *)(p + 3);
  return *d;
}


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

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

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

LLVM IR (-O2):
define i64 @cdr(i64 %0) {
%2 = add nsw i64 %0, 3
%3 = inttoptr i64 %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
int rbracket(char c) { return c == ']'; }


x86 assembly (clang, -O0):
<rbracket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbracket>:
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @rbracket(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 93
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @rbracket(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("All Ok!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"All Ok!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ p16_eeprom();
int /*<<< orphan*/ p16_int_pin();
int /*<<< orphan*/ p16_int_portb();
int /*<<< orphan*/ p16_tmr0();
int /*<<< orphan*/ p16_wdt();
void PIC16F84A_periferic(void) {
  p16_int_pin();
  p16_int_portb();
  p16_tmr0();
  p16_wdt();
  p16_eeprom();
}


x86 assembly (clang, -O0):
<PIC16F84A_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <p16_int_pin@plt>
mov    $0x0,%al
call   1040 <p16_int_portb@plt>
mov    $0x0,%al
call   1030 <p16_tmr0@plt>
mov    $0x0,%al
call   1050 <p16_wdt@plt>
mov    $0x0,%al
call   1060 <p16_eeprom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F84A_periferic>:
push   %rax
xor    %eax,%eax
call   1070 <p16_int_pin@plt>
xor    %eax,%eax
call   1040 <p16_int_portb@plt>
xor    %eax,%eax
call   1030 <p16_tmr0@plt>
xor    %eax,%eax
call   1050 <p16_wdt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <p16_eeprom@plt>

LLVM IR (-O0):
define void @PIC16F84A_periferic() {
%1 = call i32 (...) @p16_int_pin()
%2 = call i32 (...) @p16_int_portb()
%3 = call i32 (...) @p16_tmr0()
%4 = call i32 (...) @p16_wdt()
%5 = call i32 (...) @p16_eeprom()
ret void
}

LLVM IR (-O2):
define void @PIC16F84A_periferic() {
%1 = tail call i32 (...) @p16_int_pin()
%2 = tail call i32 (...) @p16_int_portb()
%3 = tail call i32 (...) @p16_tmr0()
%4 = tail call i32 (...) @p16_wdt()
%5 = tail call i32 (...) @p16_eeprom()
ret void
}
int ref_cmp(const void *litem, const void *ritem) { return litem - ritem; }


x86 assembly (clang, -O0):
<ref_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ref_cmp(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 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ref_cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int dbg_leb_unmap(struct ubifs_info *c, int lnum) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_leb_unmap(%struct.ubifs_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
void rop3_200_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_200_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_200_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
unsigned long get_error_values(int, char const **, int *, char const **, int *);
unsigned long ERR_get_error_line_data(const char **file, int *line,
                                      const char **data, int *flags) {
  return (get_error_values(1, file, line, data, flags));
}


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

x86 assembly (clang, -O2):
<ERR_get_error_line_data>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <get_error_values@plt>

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

LLVM IR (-O2):
define i64 @ERR_get_error_line_data(i8** %0, i32* %1, i8** %2, i32* %3) {
%5 = tail call i64 @get_error_values(i32 1, i8** %0, i32* %1, i8** %2, i32* %3)
ret i64 %5
}
int Fibonacci(int n) {
  if (n == 1 || n == 2)
    return 1;
  else
    return Fibonacci(n - 1) + Fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<Fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <Fibonacci+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <Fibonacci+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <Fibonacci+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <Fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <Fibonacci+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <Fibonacci@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <Fibonacci+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Fibonacci(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @Fibonacci(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ calltrap(int, int /*<<< orphan*/);
int DisableJoystick(void) { calltrap(7, 0); }


x86 assembly (clang, -O0):
<DisableJoystick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <calltrap@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisableJoystick>:
mov    $0x7,%edi
xor    %esi,%esi
jmp    1030 <calltrap@plt>

LLVM IR (-O0):
define i32 @DisableJoystick() {
%1 = alloca i32
%2 = call i32 @calltrap(i32 7, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @DisableJoystick() {
%1 = tail call i32 @calltrap(i32 7, i32 0)
ret i32 undef
}
void gtk_container_propagate_expose() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_propagate_expose() {
ret void
}
/* Variables and functions */
float cosf(float);
float sinf(float);
float mycalc(float a, float b) {
  float c;
  float sine = sinf(a);
  float cosine = cosf(b);
  c = sine + cosine;
  return c;
}


x86 assembly (clang, -O0):
<mycalc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycalc>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <sinf@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <cosf@plt>
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mycalc(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %3
%9 = call float @sinf(float %8)
store float %9, float* %6
%10 = load float, float* %4
%11 = call float @cosf(float %10)
store float %11, float* %7
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fadd float %12, %13
store float %14, float* %5
%15 = load float, float* %5
ret float %15
}

LLVM IR (-O2):
define float @mycalc(float %0, float %1) {
%3 = tail call float @sinf(float %0)
%4 = tail call float @cosf(float %1)
%5 = fadd float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ panic(char *);
void xfree(void *ptr) {
  if (ptr == NULL)
    panic("Got Null-Pointer!\n");
  free(ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <xfree+0x23>
lea    0xec2(%rip),%rdi
call   1040 <panic@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <xfree+0x15>
lea    0xed0(%rip),%rdi
call   1040 <panic@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Got Null-Pointer!\0A\00"
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Got Null-Pointer!\0A\00"
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
void av_stereo3d_type_name() {}


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

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

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

LLVM IR (-O2):
define void @av_stereo3d_type_name() {
ret void
}
int check_int() { return sizeof(int); }


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

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

LLVM IR (-O0):
define i32 @check_int() {
ret i32 4
}

LLVM IR (-O2):
define i32 @check_int() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xac() {
  Assert_real((isalnum(172) == 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_isalnum.c",
              865, ("isalnum should be 0 for 0xac"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xac>:
push   %rax
mov    $0xac,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x361,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xac\00"
define void @t_isalnum_0xac() {
%1 = call i64 @isalnum(i32 172)
%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 865, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xac\00"
define void @t_isalnum_0xac() {
%1 = tail call i64 @isalnum(i32 172)
%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 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
XChangeActivePointerGrab() {}


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

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

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

LLVM IR (-O2):
define i32 @XChangeActivePointerGrab() {
ret i32 undef
}
/* Variables and functions */
int _stricmp(char *, char *);
int compare(const void *arg1, const void *arg2) {
  return _stricmp(*(char **)arg1, *(char **)arg2);
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <_stricmp@plt>

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @_stricmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @_stricmp(i8* %4, i8* %6)
ret i32 %7
}