xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\nPSK not supported. This program is a dummy.\n\n");
  return 1;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"\0APSK not supported. This program is a dummy.\0A\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 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [46 x i8] c"\0APSK not supported. This program is a dummy.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ auto_nav();
int /*<<< orphan*/ compute_dist2_to_home();
void nav_update(void) {
  compute_dist2_to_home();
  auto_nav();
}


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

x86 assembly (clang, -O2):
<nav_update>:
push   %rax
xor    %eax,%eax
call   1040 <compute_dist2_to_home@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <auto_nav@plt>

LLVM IR (-O0):
define void @nav_update() {
%1 = call i32 (...) @compute_dist2_to_home()
%2 = call i32 (...) @auto_nav()
ret void
}

LLVM IR (-O2):
define void @nav_update() {
%1 = tail call i32 (...) @compute_dist2_to_home()
%2 = tail call i32 (...) @auto_nav()
ret void
}
void WebPInitConvertARGBToYUVSSE41(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitConvertARGBToYUVSSE41() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
scalar_t__ isspace(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
void chomp(void) {
  int c;
  while ((c = getchar()) != EOF && isspace(c))
    ;
  ungetc(c, stdin);
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2e93(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     116a <chomp+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    117a <chomp+0x4a>
jmp    117f <chomp+0x4f>
jmp    1138 <chomp+0x8>
mov    -0x4(%rbp),%edi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1050 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     115a <chomp+0x2a>
mov    %ebx,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <chomp+0x10>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
define void @chomp() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i32, i32* %1
%15 = load i32, i32* @stdin
%16 = call i32 @ungetc(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
define void @chomp() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i64 @isspace(i32 %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %1
8: ; preds = %1, %5
%9 = load i32, i32* @stdin
%10 = tail call i32 @ungetc(i32 %2, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, long);
void *malloc(size_t);
void *pen_malloc(size_t n) {
  void *q = malloc(n);
  if (!q)
    error("Can't malloc %ld bytes", (long)n);
  return q;
}


x86 assembly (clang, -O0):
<pen_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <pen_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pen_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <pen_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't malloc %ld bytes\00"
define i8* @pen_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't malloc %ld bytes\00"
define noalias i8* @pen_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_DELETE_ELEM;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_delete_elem(int fd, void *key) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  return syscall(321, BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_delete_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1050 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_delete_elem>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebp,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,0x8(%rsp)
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
mov    %r14,%rdx
mov    $0x4,%ecx
call   1050 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @memset(%union.bpf_attr* %5, i32 0, i32 4)
%7 = load i32, i32* %3
%8 = bitcast %union.bpf_attr* %5 to i32*
store i32 %7, i32* %8
%9 = load i8*, i8** %4
%10 = call i32 @ptr_to_u64(i8* %9)
%11 = bitcast %union.bpf_attr* %5 to i32*
store i32 %10, i32* %11
%12 = load i32, i32* @BPF_MAP_DELETE_ELEM
%13 = call i32 @syscall(i32 321, i32 %12, %union.bpf_attr* %5, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %6
%7 = call i32 @ptr_to_u64(i8* %1)
store i32 %7, i32* %6
%8 = load i32, i32* @BPF_MAP_DELETE_ELEM
%9 = call i32 @syscall(i32 321, i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_PW7_PIN() { set_io_bit(0x40, 7); }


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

x86 assembly (clang, -O2):
<TOSH_SET_PW7_PIN>:
mov    $0x40,%edi
mov    $0x7,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_PW7_PIN() {
%1 = call i32 @set_io_bit(i32 64, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_PW7_PIN() {
%1 = tail call i32 @set_io_bit(i32 64, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prinf(char *, int, int);
void main() {
  for (int x; x < 10; x++) {
    for (int y = 0; y > -10; y--) {
      prinf("%d,%d", x, y);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0xa,-0x4(%rbp)
jge    1166 <main+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0xfffffff6,-0x8(%rbp)
jle    1153 <main+0x43>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <prinf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
jmp    1158 <main+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <main+0x8>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
int compareInt(void *a, void *b) { return *(int *)a - *(int *)b; }


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

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int readKV(int /*<<< orphan*/ *, char const *, char *);
int configz_readKV(const char *configfile, const char *key, char *value) {
  FILE *file = fopen(configfile, "r");
  if (file == NULL) {
    return -1;
  }
  return readKV(file, key, value);
}


x86 assembly (clang, -O0):
<configz_readKV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115f <configz_readKV+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <configz_readKV+0x53>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <readKV@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configz_readKV>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xecf(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1150 <configz_readKV+0x30>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <readKV@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @configz_readKV(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %8
%11 = load i32*, i32** %8
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %19
14: ; preds = %3
%15 = load i32*, i32** %8
%16 = load i8*, i8** %6
%17 = load i8*, i8** %7
%18 = call i32 @readKV(i32* %15, i8* %16, i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @configz_readKV(i8* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @readKV(i32* %4, i8* %1, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
struct utimbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int utime(const char *path __attribute__((unused)),
          const struct utimbuf *times __attribute__((unused))) {
  printf("utime\n");
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32 }
@.str = [7 x i8] c"utime\0A\00"
@ENOENT = global i32 0
@errno = global i32 0
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i8*
%4 = alloca %struct.utimbuf*
store i8* %0, i8** %3
store %struct.utimbuf* %1, %struct.utimbuf** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @ENOENT
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.utimbuf = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
@str = [6 x i8] c"utime\00"
define i32 @utime(i8* nocapture readnone %0, %struct.utimbuf* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @ENOENT
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ timer_reset();
void led_timer_reset(void) { timer_reset(); }


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

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

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

LLVM IR (-O2):
define void @led_timer_reset() {
%1 = tail call i32 (...) @timer_reset()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_88_res_1(uint8_t value) { return value & 0xfd; }


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

x86 assembly (clang, -O2):
<z80_cb_88_res_1>:
mov    %edi,%eax
and    $0xfd,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_88_res_1(i32 %0) {
%2 = and i32 %0, 253
ret i32 %2
}
/* Variables and functions */
int galois_single_multiply(int, int, int);
int jerasure_autoconf_test() {
  int x = galois_single_multiply(1, 2, 8);
  if (x != 2) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<jerasure_autoconf_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x8,%edx
call   1030 <galois_single_multiply@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1145 <jerasure_autoconf_test+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <jerasure_autoconf_test+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jerasure_autoconf_test>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x8,%edx
call   1030 <galois_single_multiply@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jerasure_autoconf_test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @galois_single_multiply(i32 1, i32 2, i32 8)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @jerasure_autoconf_test() {
%1 = tail call i32 @galois_single_multiply(i32 1, i32 2, i32 8)
%2 = icmp ne i32 %1, 2
%3 = sext i1 %2 to i32
ret i32 %3
}
int cairo_code_draw_tabDial_get_height() { return 60; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_tabDial_get_height() {
ret i32 60
}

LLVM IR (-O2):
define i32 @cairo_code_draw_tabDial_get_height() {
ret i32 60
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bt_sys_gettimeofday(struct timeval *, struct timezone *);
int _gettimeofday_r(struct _reent *r, struct timeval *p, struct timezone *z) {
  bt_sys_gettimeofday(p, z);
  return 0;
}


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

x86 assembly (clang, -O2):
<_gettimeofday_r>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <bt_sys_gettimeofday@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @_gettimeofday_r(%struct._reent* %0, %struct.timeval* %1, %struct.timezone* %2) {
%4 = alloca %struct._reent*
%5 = alloca %struct.timeval*
%6 = alloca %struct.timezone*
store %struct._reent* %0, %struct._reent** %4
store %struct.timeval* %1, %struct.timeval** %5
store %struct.timezone* %2, %struct.timezone** %6
%7 = load %struct.timeval*, %struct.timeval** %5
%8 = load %struct.timezone*, %struct.timezone** %6
%9 = call i32 @bt_sys_gettimeofday(%struct.timeval* %7, %struct.timezone* %8)
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type { i32 }
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @_gettimeofday_r(%struct._reent* nocapture readnone %0, %struct.timeval* %1, %struct.timezone* %2) {
%4 = tail call i32 @bt_sys_gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
ret i32 0
}
int __eqstring(s1, len1, s2, len2)
char *s1;
int len1;
char *s2;
int len2;
{
  if (len1 != len2)
    return 0;
  return !memcmp(s1, s2, len1);
}


x86 assembly (clang, -O0):
<__eqstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <__eqstring+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115f <__eqstring+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eqstring>:
xor    %eax,%eax
cmp    %ecx,%esi
jne    1132 <__eqstring+0x22>
push   %rax
movslq %esi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <bcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @__eqstring(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %9
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 0, i32* %5
br label %23
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = load i8*, i8** %8
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = call i32 @memcmp(i8* %15, i8* %16, i64 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
store i32 %22, i32* %5
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @__eqstring(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = sext i32 %1 to i64
%8 = tail call i32 @bcmp(i8* %0, i8* %2, i64 %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ %10, %6 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ftp_put(char *);
int main() {
  ftp_put("ftp.c");
  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 <ftp_put@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ftp.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ftp_put(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"ftp.c\00"
define i32 @main() {
%1 = tail call i32 @ftp_put(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcat(char *, char *);
main() {
  char str1[15] = "first & ";
  char str2[] = "second";
  strcat(str1, str2);
  puts(str1);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xea3(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xe9b(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x16(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0xf(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x2026207473726966,%rax
20 26 20
mov    %rax,0x10(%rsp)
movq   $0x20,0x17(%rsp)
movl   $0x646e6f,0xb(%rsp)
movl   $0x6f636573,0x8(%rsp)
6f
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [15 x i8] c"first & \00\00\00\00\00\00\00"
@__const.main.str2 = [7 x i8] c"second\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [7 x i8]
%3 = bitcast [15 x i8]* %1 to i8*
%4 = bitcast [7 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcat(i8* %5, i8* %6)
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [15 x i8] c"first & \00\00\00\00\00\00\00"
@__const.main.str2 = [7 x i8] c"second\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat(i8* %3, i8* %4)
%6 = call i32 @puts(i8* %3)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, size_t);
void *realloc(void *, size_t);
void *abac_xrealloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (ret == NULL)
    err(1, "couldn't realloc %d bytes\n", size);
  return ret;
}


x86 assembly (clang, -O0):
<abac_xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <abac_xrealloc+0x41>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abac_xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <abac_xrealloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"couldn't realloc %d bytes\0A\00"
define i8* @abac_xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [27 x i8] c"couldn't realloc %d bytes\0A\00"
define noalias i8* @abac_xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ set(unsigned long);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  unsigned long addr = (unsigned long)malloc(sizeof(int));
  set(addr);
  int *p = (int *)addr;
  test_assert(*p == 13);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <set@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xd,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <set@plt>
xor    %edi,%edi
cmpl   $0xd,(%rbx)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
%2 = alloca i32*
%3 = call i64 @malloc(i32 4)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = call i32 @set(i64 %4)
%6 = load i64, i64* %1
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 13
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = tail call i32 @set(i64 %1)
%3 = inttoptr i64 %1 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = tail call i32 @test_assert(i32 %6)
ret i32 0
}
unsigned invert(unsigned x, int p, int n) {
  unsigned mask = ~(~0 << n) << (p - n + 1);
  x = x ^ mask;
  return x;
}


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

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(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
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = shl i32 %10, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = xor i32 %16, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
int digit(int c) {
  if (c >= '1' && c <= '9')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x31,-0x8(%rbp)
jl     1127 <digit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <digit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <digit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xffffffcf,%edi
xor    %eax,%eax
cmp    $0x9,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 49
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -49
%3 = icmp ult i32 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cio_error(char *);
int /*<<< orphan*/ cio_sched(void *);
void __attribute__((noreturn)) cio_routine_exit(void *arg) {
  while (true) {
    cio_sched(arg);
    cio_error("Warning: EINTR ignored");
  }
}


x86 assembly (clang, -O0):
<cio_routine_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cio_sched@plt>
lea    0xec4(%rip),%rdi
call   1030 <cio_error@plt>
jmp    112c <cio_routine_exit+0xc>

x86 assembly (clang, -O2):
<cio_routine_exit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <cio_sched@plt>
mov    %r14,%rdi
call   1030 <cio_error@plt>
jmp    1130 <cio_routine_exit+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"Warning: EINTR ignored\00"
define void @cio_routine_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
%5 = call i32 @cio_sched(i8* %4)
%6 = call i32 @cio_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"Warning: EINTR ignored\00"
define void @cio_routine_exit(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @cio_sched(i8* %0)
%4 = tail call i32 @cio_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "mknandimg_ecc [img_path] [oob size = 64] [ecc size = 256] "
                  "[ecc byte = 3] [page size = 2048]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [93 x i8] c"mknandimg_ecc [img_path] [oob size = 64] [ecc size = 256] [ecc byte = 3] [page size = 2048]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [93 x i8] c"mknandimg_ecc [img_path] [oob size = 64] [ecc size = 256] [ecc byte = 3] [page size = 2048]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *memcpy(int /*<<< orphan*/, char const *, size_t);
int strlen(char const *);
int /*<<< orphan*/ xmalloc(size_t);
char *xstrdup(const char *str) {
  size_t size = strlen(str) + 1;
  return memcpy(xmalloc(size), str, size);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 @xmalloc(i64 %8)
%10 = load i8*, i8** %2
%11 = load i64, i64* %3
%12 = call i8* @memcpy(i32 %9, i8* %10, i64 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i32 @xmalloc(i64 %4)
%6 = tail call i8* @memcpy(i32 %5, i8* %0, i64 %4)
ret i8* %6
}
int do_679() { return 679; }


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

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

LLVM IR (-O0):
define i32 @do_679() {
ret i32 679
}

LLVM IR (-O2):
define i32 @do_679() {
ret i32 679
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xa7() {
  Assert_real((isascii(167) == 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_isascii.c",
              840, ("isascii should be 0 for 0xa7"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xa7>:
push   %rax
mov    $0xa7,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x348,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xa7\00"
define void @t_isascii_0xa7() {
%1 = call i64 @isascii(i32 167)
%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 840, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xa7\00"
define void @t_isascii_0xa7() {
%1 = tail call i64 @isascii(i32 167)
%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 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ add_mpeg_nav(int /*<<< orphan*/ *, unsigned int const);
int /*<<< orphan*/ check_mpeg_encryption(int /*<<< orphan*/ *,
                                         unsigned int const,
                                         unsigned int const);
int /*<<< orphan*/ fix_mpeg2_aspect(int /*<<< orphan*/ *, unsigned int const,
                                    unsigned int const);
void process_mpeg2(uint8_t *buf, const unsigned int bs, void *program) {
  fix_mpeg2_aspect(buf, bs, *(const unsigned int *)program);
  add_mpeg_nav(buf, bs);
  check_mpeg_encryption(buf, bs, *(const unsigned int *)program);
}


x86 assembly (clang, -O0):
<process_mpeg2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <fix_mpeg2_aspect@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <add_mpeg_nav@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1050 <check_mpeg_encryption@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_mpeg2>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdx),%edx
call   1030 <fix_mpeg2_aspect@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <add_mpeg_nav@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <check_mpeg_encryption@plt>

LLVM IR (-O0):
define void @process_mpeg2(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @fix_mpeg2_aspect(i32* %7, i32 %8, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = call i32 @add_mpeg_nav(i32* %13, i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = call i32 @check_mpeg_encryption(i32* %16, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
define void @process_mpeg2(i32* %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @fix_mpeg2_aspect(i32* %0, i32 %1, i32 %5)
%7 = tail call i32 @add_mpeg_nav(i32* %0, i32 %1)
%8 = load i32, i32* %4
%9 = tail call i32 @check_mpeg_encryption(i32* %0, i32 %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *x) { free(x); }


x86 assembly (clang, -O0):
<mem_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):
<mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CL_Snd_Restart();
int /*<<< orphan*/ CL_Vid_Restart_f();
void CL_Snd_Restart_f(void) {
  CL_Snd_Restart();
  CL_Vid_Restart_f();
}


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

x86 assembly (clang, -O2):
<CL_Snd_Restart_f>:
push   %rax
xor    %eax,%eax
call   1030 <CL_Snd_Restart@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CL_Vid_Restart_f@plt>

LLVM IR (-O0):
define void @CL_Snd_Restart_f() {
%1 = call i32 (...) @CL_Snd_Restart()
%2 = call i32 (...) @CL_Vid_Restart_f()
ret void
}

LLVM IR (-O2):
define void @CL_Snd_Restart_f() {
%1 = tail call i32 (...) @CL_Snd_Restart()
%2 = tail call i32 (...) @CL_Vid_Restart_f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned char);
void cmp_m8_imm8(unsigned char *m8, unsigned char imm8) {
  put8(0x80);
  put8(0x3D);
  put32((unsigned int)(m8));
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_m8_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x80,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_m8_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x80,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_m8_imm8(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -128)
%6 = call i32 @put8(i8 zeroext 61)
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @cmp_m8_imm8(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -128)
%4 = tail call i32 @put8(i8 zeroext 61)
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put8(i8 zeroext %1)
ret void
}
void d003t(n) int n;
{
  int i;
#pragma omp parallel default(shared)
  {
#pragma omp for
    for (i = 0; i < n; i++)
      some_work(i, n);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <d003t+0x39>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <some_work@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <d003t+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1132 <d003t+0x22>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <some_work@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <d003t+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @d003t(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @some_work to i32 (i32, i32, ...)*)(i32 %4, i32 %0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *kmalloc(int);
void *kcalloc(int num, int siz) { return kmalloc(num * siz); }


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

x86 assembly (clang, -O2):
<kcalloc>:
imul   %esi,%edi
jmp    1030 <kmalloc@plt>

LLVM IR (-O0):
define i8* @kcalloc(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 = mul nsw i32 %5, %6
%8 = call i8* @kmalloc(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @kcalloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @kmalloc(i32 %3)
ret i8* %4
}