xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, unsigned long,
                           unsigned long, unsigned long, unsigned long);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s <megabytes> <bits> [initial]\n"
                "Possible values for <megabytes>: 0, %lu to %lu\n"
                "Possible values for <bits>: %lu to %lu\n",
                getprogname(), (8UL), (127UL), (unsigned long)((511) + 1),
                (unsigned long)(1UL << 16));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
mov    $0x8,%ecx
mov    $0x7f,%r8d
mov    $0x200,%r9d
movq   $0x10000,(%rsp)
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
movq   $0x10000,(%rsp)
lea    0xeac(%rip),%rsi
mov    $0x8,%ecx
mov    $0x7f,%r8d
mov    $0x200,%r9d
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [126 x i8] c"Usage: %s <megabytes> <bits> [initial]\0APossible values for <megabytes>: 0, %lu to %lu\0APossible values for <bits>: %lu to %lu\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0), i8* %2, i64 8, i64 127, i64 512, i64 65536)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [126 x i8] c"Usage: %s <megabytes> <bits> [initial]\0APossible values for <megabytes>: 0, %lu to %lu\0APossible values for <bits>: %lu to %lu\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0), i8* %2, i64 8, i64 127, i64 512, i64 65536)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct cdrom_tocentry {
  int dummy;
};
typedef int /*<<< orphan*/ entry;

/* Variables and functions */
int main(void) {
  struct cdrom_tocentry entry;
  (void)entry;
  return sizeof(entry);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void bitrate_mvr_log(char *mvr_logfile_buffer) { return; }


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

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

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

LLVM IR (-O2):
define void @bitrate_mvr_log(i8* nocapture %0) {
ret void
}
call0b(s, i, l, c) short s;
int i;
long l;
char c;
{
  s = 6;
  i = 7;
  l = 8;
  c = 'j';
}


x86 assembly (clang, -O0):
<call0b>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %di,%cx
mov    %cx,-0x6(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movw   $0x6,-0x6(%rbp)
movl   $0x7,-0xc(%rbp)
movq   $0x8,-0x18(%rbp)
movb   $0x6a,-0x19(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call0b(i32 %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8
%10 = trunc i32 %0 to i16
%11 = trunc i32 %3 to i8
store i16 %10, i16* %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8 %11, i8* %9
store i16 6, i16* %6
store i32 7, i32* %7
store i64 8, i64* %8
store i8 106, i8* %9
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call0b(i32 %0, i32 %1, i64 %2, i32 %3) {
ret i32 undef
}
int addOne(int num) { return (num + 1); }


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

x86 assembly (clang, -O2):
<addOne>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addOne(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ black_pixel;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
unsigned long get_Screen_black_pixel(void *_p) {
  return (unsigned long)((Screen *)_p)->black_pixel;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_Screen_black_pixel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_Screen_black_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct buddy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_buddy(char *, char *);
struct buddy *find_buddy(char *);
int /*<<< orphan*/ serv_add_buddy(char *);
int /*<<< orphan*/ serv_save_config();
int user_add_buddy(char *group, char *buddy) {
  struct buddy *b;
  b = find_buddy(buddy);
  if (b != NULL)
    return -1;
  add_buddy(group, buddy);
  serv_add_buddy(buddy);
  serv_save_config();
  return 1;
}


x86 assembly (clang, -O0):
<user_add_buddy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <find_buddy@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1174 <user_add_buddy+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <user_add_buddy+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <add_buddy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <serv_add_buddy@plt>
mov    $0x0,%al
call   1040 <serv_save_config@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_add_buddy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <find_buddy@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    117e <user_add_buddy+0x3e>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <add_buddy@plt>
mov    %rbx,%rdi
call   1030 <serv_add_buddy@plt>
xor    %eax,%eax
call   1040 <serv_save_config@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.buddy = type { i32 }
define i32 @user_add_buddy(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.buddy*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call %struct.buddy* @find_buddy(i8* %7)
store %struct.buddy* %8, %struct.buddy** %6
%9 = load %struct.buddy*, %struct.buddy** %6
%10 = icmp ne %struct.buddy* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %19
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @add_buddy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @serv_add_buddy(i8* %16)
%18 = call i32 (...) @serv_save_config()
store i32 1, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.buddy = type { i32 }
define i32 @user_add_buddy(i8* %0, i8* %1) {
%3 = tail call %struct.buddy* @find_buddy(i8* %1)
%4 = icmp eq %struct.buddy* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @add_buddy(i8* %0, i8* %1)
%7 = tail call i32 @serv_add_buddy(i8* %1)
%8 = tail call i32 (...) @serv_save_config()
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  foo();
  printf("Success\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Success\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 (...) @foo()
%7 = 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"Success\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = 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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void errExit(const char *s) {
  perror(s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errExit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @errExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @errExit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void CFGMR3QueryS8(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryS8() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int initialize_hyperplane_sections(int m) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(59, &m, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_hyperplane_sections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x3b,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_hyperplane_sections>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3b,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initialize_hyperplane_sections(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 59, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @initialize_hyperplane_sections(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 59, i32* %2, i32* undef, double* undef)
ret i32 %3
}
int in_scratch(unsigned long addr) {
  return addr >= 0xffb00000 && addr < 0xffb01000;
}


x86 assembly (clang, -O0):
<in_scratch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    $0xffb00000,%ecx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jb     112b <in_scratch+0x2b>
mov    $0xffb01000,%eax
cmp    %rax,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_scratch>:
shr    $0xc,%rdi
xor    %eax,%eax
cmp    $0xffb00,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @in_scratch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 4289724416
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ult i64 %6, 4289728512
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @in_scratch(i64 %0) {
%2 = and i64 %0, -4096
%3 = icmp eq i64 %2, 4289724416
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int const);
int isRadix16(const char *c) {
  const char *PREFIX = "#x";
  const int PREFIX_SZ = strlen(PREFIX);
  if (c == NULL)
    return 0;
  if (strncmp(c, PREFIX, PREFIX_SZ) == 0)
    return PREFIX_SZ;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isRadix16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <isRadix16+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1186 <isRadix16+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117f <isRadix16+0x5f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <isRadix16+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRadix16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1040 <strlen@plt>
test   %rbx,%rbx
je     1157 <isRadix16+0x37>
mov    %eax,%ebp
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmove  %ebp,%eax
jmp    1159 <isRadix16+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"#x\00"
define i32 @isRadix16(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 %2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_start(void) {
  mbus_remote_register_write(0x4, 0x01, ((0 << 5) | (1 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_start>:
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x19,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_start() {
%1 = call i32 @mbus_remote_register_write(i32 4, i32 1, i32 25)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_start() {
%1 = tail call i32 @mbus_remote_register_write(i32 4, i32 1, i32 25)
ret void
}
void line_start(unsigned char *pDst) {}


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

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

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

LLVM IR (-O2):
define void @line_start(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int i[10];
  foo(i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x1d() {
  Assert_real((isspace(29) == 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_isspace.c",
              150, ("isspace should be 0 for 0x1d"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x96,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1d\00"
define void @t_isspace_0x1d() {
%1 = call i64 @isspace(i32 29)
%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 150, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1d\00"
define void @t_isspace_0x1d() {
%1 = tail call i64 @isspace(i32 29)
%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 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = -1 + - -1 * -1 * - -1;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffe,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @genfloor_w_d() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void fillWithWhitespaces(int i, FILE *fp) {
  while (i-- > 0) {
    fputc(' ', fp);
  }
}


x86 assembly (clang, -O0):
<fillWithWhitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1146 <fillWithWhitespaces+0x36>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
jmp    111f <fillWithWhitespaces+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillWithWhitespaces>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1135 <fillWithWhitespaces+0x25>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
nop
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <fillWithWhitespaces+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @fillWithWhitespaces(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %4
%11 = call i32 @fputc(i8 signext 32, i32* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @fillWithWhitespaces(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fputc(i8 signext 32, i32* %1)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fpointer = fopen("archivo1.txt", "w");
  fprintf(fpointer, "mi primer linea");
  fclose(fpointer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"archivo1.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [16 x i8] c"mi primer linea\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"archivo1.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [16 x i8] c"mi primer linea\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 15, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
void common_test(const char *data) {
  printf("\t*** %s ***\n", __func__);
  small_string_test(data);
  printf("\t*** %s: done ***\n ", __func__);
}


x86 assembly (clang, -O0):
<common_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <small_string_test@plt>
lea    0xec6(%rip),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
lea    0xed8(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <small_string_test@plt>
lea    0xec9(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.common_test = [12 x i8] c"common_test\00"
@.str.1 = [20 x i8] c"\09*** %s: done ***\0A \00"
define void @common_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.common_test, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.common_test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.common_test = [12 x i8] c"common_test\00"
@.str.1 = [20 x i8] c"\09*** %s: done ***\0A \00"
define void @common_test(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.common_test, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.common_test, i64 0, i64 0))
ret void
}
double get_vol_element(const double *x) { return x[0]; }


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

x86 assembly (clang, -O2):
<get_vol_element>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @get_vol_element(double* nocapture %0) {
%2 = load double, double* %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void catch_error(int error_code) {
  switch (error_code) {
  case 0x05:
    printf("divided by ZERO\n");
    exit(0);
    break;
  case 0x06:
    printf("Using undefined variable\n");
    break;
  default:
    printf("Unknown error\n");
    break;
  }
}


x86 assembly (clang, -O0):
<catch_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x5,%eax
je     1150 <catch_error+0x30>
jmp    113f <catch_error+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
je     1163 <catch_error+0x43>
jmp    1174 <catch_error+0x54>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <catch_error+0x60>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_error>:
cmp    $0x6,%edi
je     1136 <catch_error+0x16>
cmp    $0x5,%edi
je     1142 <catch_error+0x22>
lea    0xef8(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec3(%rip),%rdi
jmp    1030 <puts@plt>
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"divided by ZERO\0A\00"
@.str.1 = [26 x i8] c"Using undefined variable\0A\00"
@.str.2 = [15 x i8] c"Unknown error\0A\00"
define void @catch_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 5, label %4
i32 6, label %7
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Using undefined variable\00"
@str.3 = [16 x i8] c"divided by ZERO\00"
@str.4 = [14 x i8] c"Unknown error\00"
define void @catch_error(i32 %0) {
switch i32 %0, label %5 [
i32 5, label %2
i32 6, label %6
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
br label %6
6: ; preds = %1, %5
%7 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), %1 ]
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
void main(void) {
  int X = 0;
  int N = rand();
  if (N < 0) {
    N = 0;
  }
  while (X < N) {
    X++;
  }
  assert(X - N == 0);
  if (X == N) {
    N = 8;
  } else {
    N = 42;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114a <main+0x2a>
movl   $0x0,-0x8(%rbp)
jmp    114f <main+0x2f>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <main+0x49>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <main+0x2f>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1197 <main+0x77>
movl   $0x8,-0x8(%rbp)
jmp    119e <main+0x7e>
movl   $0x2a,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @rand()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %2
br label %7
7: ; preds = %6, %0
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %8
15: ; preds = %8
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sub nsw i32 %16, %17
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %15
store i32 8, i32* %2
br label %27
26: ; preds = %15
store i32 42, i32* %2
br label %27
27: ; preds = %26, %25
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int yyerror(char *str) {
  fprintf(stderr, "%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void EPIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000210))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<EPIIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x210(%rcx)
ret

LLVM IR (-O0):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 528
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 528
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
double mus_char_to_ldouble(const unsigned char *inp) {
  double o;
  unsigned char *outp = (unsigned char *)&o;
  memcpy((void *)outp, (void *)inp, 8);
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_ldouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_ldouble>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mus_char_to_ldouble(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast double* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %2
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 8)
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @mus_char_to_ldouble(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 8)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int *malloc(int);
int *integer(int n) {
  int *num = malloc(sizeof(int));
  *num = n;
  return num;
}


x86 assembly (clang, -O0):
<integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i32* @integer(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void smpte_fec_set_offset(uint8_t *p_fec, uint8_t offset) {
  p_fec[13] = offset;
}


x86 assembly (clang, -O0):
<smpte_fec_set_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_offset>:
mov    %esi,0x34(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_set_offset(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 13
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @smpte_fec_set_offset(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 13
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_FLASH_CLK_PIN() { return 0x01 & (inp_emulate(0x35) >> 3); }


x86 assembly (clang, -O0):
<TOSH_READ_FLASH_CLK_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
sar    $0x3,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_FLASH_CLK_PIN>:
push   %rax
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
shr    $0x3,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_FLASH_CLK_PIN() {
%1 = call i32 @inp_emulate(i32 53)
%2 = ashr i32 %1, 3
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_FLASH_CLK_PIN() {
%1 = tail call i32 @inp_emulate(i32 53)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 3
%4 = and i8 %3, 1
ret i8 %4
}
int ackermann(int m, int n) {
  if (m == 0) {
    return n + 1;
  }
  if (n == 0) {
    return ackermann(m - 1, 1);
  }
  return ackermann(m - 1, ackermann(m, n - 1));
}


x86 assembly (clang, -O0):
<ackermann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ackermann+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ackermann+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ackermann@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackermann>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ackermann+0x2f>
mov    %edi,%ebx
jmp    112a <ackermann+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ackermann+0x2f>
test   %eax,%eax
je     1120 <ackermann+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
add    $0xffffffff,%ebx
jne    112a <ackermann+0x1a>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ackermann(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ackermann(i32 %9, i32 %16)
br label %11
}
unsigned char answer_8(unsigned char arg0, int arg1, int arg2) {
  char val = ~(arg0 | (1 << arg1));
  return (val >> arg2) & 1;
}


x86 assembly (clang, -O0):
<answer_8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_8>:
mov    %edx,%ecx
bts    %esi,%edi
not    %dil
movsbl %dil,%eax
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @answer_8(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = shl i32 1, %10
%12 = or i32 %9, %11
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = sext i8 %15 to i32
%17 = load i32, i32* %6
%18 = ashr i32 %16, %17
%19 = and i32 %18, 1
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @answer_8(i8 zeroext %0, i32 %1, i32 %2) {
%4 = shl nuw i32 1, %1
%5 = trunc i32 %4 to i8
%6 = or i8 %5, %0
%7 = xor i8 %6, -1
%8 = sext i8 %7 to i32
%9 = lshr i32 %8, %2
%10 = trunc i32 %9 to i8
%11 = and i8 %10, 1
ret i8 %11
}
double InitialHuffmanCost(void) {
  static const int kHuffmanCodeOfHuffmanCodeSize = 19 * 3;
  static const double kSmallBias = 9.1;
  return kHuffmanCodeOfHuffmanCodeSize - kSmallBias;
}


x86 assembly (clang, -O0):
<InitialHuffmanCost>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitialHuffmanCost>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
@InitialHuffmanCost.kHuffmanCodeOfHuffmanCodeSize = internal constant i32 57
@InitialHuffmanCost.kSmallBias = internal constant double 9.100000e+00
define double @InitialHuffmanCost() {
ret double 4.790000e+01
}

LLVM IR (-O2):
define double @InitialHuffmanCost() {
ret double 4.790000e+01
}
int get_magic_mimetype(const char *filename, char *buf) { return -1; }


x86 assembly (clang, -O0):
<get_magic_mimetype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_magic_mimetype(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_by_value_16_x();
int main() {
  struct_by_value_16_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <struct_by_value_16_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <struct_by_value_16_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_by_value_16_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ setup_parameters_L2proj_DG();
int /*<<< orphan*/ setup_parameters_L2proj_HDG();
void setup_parameters_L2proj(void) {
  setup_parameters_L2proj_DG();
  setup_parameters_L2proj_HDG();
}


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

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

LLVM IR (-O0):
define void @setup_parameters_L2proj() {
%1 = call i32 (...) @setup_parameters_L2proj_DG()
%2 = call i32 (...) @setup_parameters_L2proj_HDG()
ret void
}

LLVM IR (-O2):
define void @setup_parameters_L2proj() {
%1 = tail call i32 (...) @setup_parameters_L2proj_DG()
%2 = tail call i32 (...) @setup_parameters_L2proj_HDG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stacktop();
int /*<<< orphan*/ xlerror(char *, int /*<<< orphan*/);
void xlfail(char *emsg) { xlerror(emsg, stacktop()); }


x86 assembly (clang, -O0):
<xlfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <stacktop@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <xlerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlfail>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <stacktop@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <xlerror@plt>

LLVM IR (-O0):
define void @xlfail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @stacktop()
%5 = call i32 @xlerror(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @xlfail(i8* %0) {
%2 = tail call i32 (...) @stacktop()
%3 = tail call i32 @xlerror(i8* %0, i32 %2)
ret void
}