xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fail_file();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *umalloc(size_t size) {
  void *const addr = malloc(size);
  if (0 == addr) {
    fprintf(stderr, "malloc failed: %zu bytes\n", size);
    fail_file();
  }
  return addr;
}


x86 assembly (clang, -O0):
<umalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1175 <umalloc+0x45>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <fail_file@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <umalloc+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <fail_file@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"malloc failed: %zu bytes\0A\00"
define i8* @umalloc(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 eq i8* null, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @fail_file()
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"malloc failed: %zu bytes\0A\00"
define noalias i8* @umalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @fail_file()
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ standard_extension(char *, char *, char *);
void dbg_filename(char *inname, char *outname) {
  standard_extension(inname, outname, ".dbg");
}


x86 assembly (clang, -O0):
<dbg_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <standard_extension@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_filename>:
lea    0xee9(%rip),%rdx
jmp    1030 <standard_extension@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c".dbg\00"
define void @dbg_filename(i8* %0, i8* %1) {
%3 = tail call i32 @standard_extension(i8* %0, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_2_2_1_1_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_1_2_1() {
ret void
}
const char *_Locale_numeric_default(char *__DUMMY_PAR) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_numeric_default(i8* nocapture readnone %0) {
ret i8* null
}
int test_imm_B3uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xB3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B3uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 768799145984
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand_born(int /*<<< orphan*/, int);
int rolld100(void) {
  int a, b;
  a = rand_born(0, 9);
  b = rand_born(0, 9);
  a += b * 10;
  return a;
}


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

x86 assembly (clang, -O2):
push   %rbx
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <rand_born@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <rand_born@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rolld100() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @rand_born(i32 0, i32 9)
store i32 %3, i32* %1
%4 = call i32 @rand_born(i32 0, i32 9)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 10
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @rolld100() {
%1 = tail call i32 @rand_born(i32 0, i32 9)
%2 = tail call i32 @rand_born(i32 0, i32 9)
%3 = mul nsw i32 %2, 10
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct firmata_conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ firmata_send_code(struct firmata_conn *, int);
void firmata_analog_mapping_query(struct firmata_conn *c) {
  firmata_send_code(c, 0x69);
}


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

x86 assembly (clang, -O2):
<firmata_analog_mapping_query>:
mov    $0x69,%esi
jmp    1030 <firmata_send_code@plt>

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

LLVM IR (-O2):
%struct.firmata_conn = type { i32 }
define void @firmata_analog_mapping_query(%struct.firmata_conn* %0) {
%2 = tail call i32 @firmata_send_code(%struct.firmata_conn* %0, i32 105)
ret void
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  long long tv_sec;
};

/* Variables and functions */
long long int timeval_subtract_us(struct timeval *x, struct timeval *y) {
  long long int usec_part;
  long long int sec_part;
  usec_part = x->tv_usec - y->tv_usec;
  sec_part = x->tv_sec - y->tv_sec;
  return ((1000000 * sec_part) + usec_part);
}


x86 assembly (clang, -O0):
<timeval_subtract_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x20(%rbp)
imul   $0xf4240,-0x20(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_subtract_us>:
mov    (%rdi),%rcx
mov    0x8(%rdi),%rax
sub    (%rsi),%rcx
sub    0x8(%rsi),%rax
imul   $0xf4240,%rax,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timeval_subtract_us(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i64
%6 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sub nsw i64 %9, %12
store i64 %13, i64* %5
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
store i64 %20, i64* %6
%21 = load i64, i64* %6
%22 = mul nsw i64 1000000, %21
%23 = load i64, i64* %5
%24 = add nsw i64 %22, %23
ret i64 %24
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timeval_subtract_us(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sub nsw i64 %9, %11
%13 = mul nsw i64 %12, 1000000
%14 = add nsw i64 %7, %13
ret i64 %14
}
/* Variables and functions */
int crashfunc();
int shlib_function(void) { return crashfunc(); }


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

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

LLVM IR (-O0):
define i32 @shlib_function() {
%1 = call i32 (...) @crashfunc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @shlib_function() {
%1 = tail call i32 (...) @crashfunc()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s {sleep time in microseconds}.\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: %s {sleep time in microseconds}.\0A\00"
define void @usage(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 ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: %s {sleep time in microseconds}.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double round_double(double);
double timlib_round_double(double d) { return round_double(d); }


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

x86 assembly (clang, -O2):
<timlib_round_double>:
jmp    1030 <round_double@plt>

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

LLVM IR (-O2):
define double @timlib_round_double(double %0) {
%2 = tail call double @round_double(double %0)
ret double %2
}
/* Type definitions */
struct Person {
  int dummy;
};

/* Variables and functions */
struct Person *Person_create(int, int, int);
int get_age(struct Person *);
int null_pointer_interproc() {
  struct Person *joe = Person_create(32, 64, 140);
  return get_age(joe);
}


x86 assembly (clang, -O0):
<null_pointer_interproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
mov    $0x40,%esi
mov    $0x8c,%edx
call   1040 <Person_create@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_age@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_pointer_interproc>:
push   %rax
mov    $0x20,%edi
mov    $0x40,%esi
mov    $0x8c,%edx
call   1040 <Person_create@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <get_age@plt>

LLVM IR (-O0):
%struct.Person = type { i32 }
define i32 @null_pointer_interproc() {
%1 = alloca %struct.Person*
%2 = call %struct.Person* @Person_create(i32 32, i32 64, i32 140)
store %struct.Person* %2, %struct.Person** %1
%3 = load %struct.Person*, %struct.Person** %1
%4 = call i32 @get_age(%struct.Person* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.Person = type { i32 }
define i32 @null_pointer_interproc() {
%1 = tail call %struct.Person* @Person_create(i32 32, i32 64, i32 140)
%2 = tail call i32 @get_age(%struct.Person* %1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isspace(int);
char *strdup(char *);
char *ltrim(char *s) {
  char *p = s;
  while (*p && isspace((int)(*p)))
    p++;
  return strdup(p);
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <ltrim+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <ltrim+0x4f>
jmp    1180 <ltrim+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <ltrim+0x14>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1149 <ltrim+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1149 <ltrim+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ltrim+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @ltrim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i64 @isspace(i32 %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = call i8* @strdup(i8* %22)
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @ltrim(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
%16 = tail call i8* @strdup(i8* %15)
ret i8* %16
}
/* Variables and functions */
int core2_swap(char *, int);
int U_EMRPOLYPOLYGON_swap(char *record, int torev) {
  return (core2_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYGON_swap>:
jmp    1030 <core2_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYPOLYGON_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core2_swap(i8* %0, i32 %1)
ret i32 %3
}
void ff_hevc_put_hevc_bi_w_qpel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h12_12_sse4() {
ret void
}
void NoBarrier_AtomicExchange(long long *ptr) {
  while (__sync_val_compare_and_swap(ptr, 1, 0))
    ;
}


x86 assembly (clang, -O0):
<NoBarrier_AtomicExchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
mov    $0x1,%eax
lock cmpxchg %rdx,(%rcx)
sete   %cl
cmp    $0x0,%rax
je     112c <NoBarrier_AtomicExchange+0x2c>
jmp    1108 <NoBarrier_AtomicExchange+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NoBarrier_AtomicExchange>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%eax
lock cmpxchg %rcx,(%rdi)
test   %rax,%rax
jne    1110 <NoBarrier_AtomicExchange+0x10>
ret

LLVM IR (-O0):
define void @NoBarrier_AtomicExchange(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
br label %3
3: ; preds = %8, %1
%4 = load i64*, i64** %2
%5 = cmpxchg i64* %4, i64 1, i64 0 seq_cst seq_cst
%6 = extractvalue { i64, i1 } %5, 0
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @NoBarrier_AtomicExchange(i64* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = cmpxchg i64* %0, i64 1, i64 0 seq_cst seq_cst
%4 = extractvalue { i64, i1 } %3, 0
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int isatty(int /*<<< orphan*/);
int optk_ftty(FILE *stream) { return isatty(fileno(stream)); }


x86 assembly (clang, -O0):
<optk_ftty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optk_ftty>:
push   %rax
call   1040 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <isatty@plt>

LLVM IR (-O0):
define i32 @optk_ftty(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = call i32 @isatty(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @optk_ftty(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i32 @isatty(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cpu_arm920_cache_clean_invalidate_all();
void cache_clean_invalidate(void) { cpu_arm920_cache_clean_invalidate_all(); }


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

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

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

LLVM IR (-O2):
define void @cache_clean_invalidate() {
%1 = tail call i32 (...) @cpu_arm920_cache_clean_invalidate_all()
ret void
}
void LPCHalfWordWrite(unsigned long ulBase, unsigned long ulOffset,
                      unsigned short usData) {
  ;
  ;

  ;
  (*((volatile unsigned short *)(ulBase + 0x00000400 + ulOffset))) = usData;
}


x86 assembly (clang, -O0):
<LPCHalfWordWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%cx
mov    -0x8(%rbp),%rax
add    $0x400,%rax
add    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCHalfWordWrite>:
mov    %dx,0x400(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @LPCHalfWordWrite(i64 %0, i64 %1, i16 zeroext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
store i64 %0, i64* %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = load i64, i64* %4
%9 = add i64 %8, 1024
%10 = load i64, i64* %5
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i16*
store volatile i16 %7, i16* %12
ret void
}

LLVM IR (-O2):
define void @LPCHalfWordWrite(i64 %0, i64 %1, i16 zeroext %2) {
%4 = add i64 %0, 1024
%5 = add i64 %4, %1
%6 = inttoptr i64 %5 to i16*
store volatile i16 %2, i16* %6
ret void
}
/* Variables and functions */
int read(int, void *, size_t);
int do_read(int fd, void *buf, size_t count) { return read(fd, buf, count); }


x86 assembly (clang, -O0):
<do_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @do_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @read(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @do_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ allclues();
int /*<<< orphan*/ solvel(int /*<<< orphan*/, int /*<<< orphan*/);
void prep() {
  solvel(0, 0);
  allclues();
}


x86 assembly (clang, -O0):
<prep>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1040 <solvel@plt>
mov    $0x0,%al
call   1030 <allclues@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prep>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <solvel@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <allclues@plt>

LLVM IR (-O0):
define void @prep() {
%1 = call i32 @solvel(i32 0, i32 0)
%2 = call i32 (...) @allclues()
ret void
}

LLVM IR (-O2):
define void @prep() {
%1 = tail call i32 @solvel(i32 0, i32 0)
%2 = tail call i32 (...) @allclues()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cffti1(size_t, double *, size_t *);
void cffti(size_t n, double wsave[]) {
  if (n != 1)
    cffti1(n, wsave + 2 * n, (size_t *)(wsave + 4 * n));
}


x86 assembly (clang, -O0):
<cffti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     115a <cffti+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <cffti1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cffti>:
cmp    $0x1,%rdi
jne    1117 <cffti+0x7>
ret
mov    %rdi,%rax
shl    $0x4,%rax
add    %rsi,%rax
mov    %rdi,%rdx
shl    $0x5,%rdx
add    %rsi,%rdx
mov    %rax,%rsi
jmp    1030 <cffti1@plt>

LLVM IR (-O0):
define void @cffti(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
store double* %1, double** %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 1
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load double*, double** %4
%10 = load i64, i64* %3
%11 = mul i64 2, %10
%12 = getelementptr inbounds double, double* %9, i64 %11
%13 = load double*, double** %4
%14 = load i64, i64* %3
%15 = mul i64 4, %14
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = bitcast double* %16 to i64*
%18 = call i32 @cffti1(i64 %8, double* %12, i64* %17)
br label %19
19: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @cffti(i64 %0, double* %1) {
%3 = icmp eq i64 %0, 1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = shl i64 %0, 1
%6 = getelementptr inbounds double, double* %1, i64 %5
%7 = shl i64 %0, 2
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = bitcast double* %8 to i64*
%10 = tail call i32 @cffti1(i64 %0, double* %6, i64* %9)
br label %11
11: ; preds = %4, %2
ret void
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = input[0UL] + (unsigned char)69;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] - 903211243UL) - (unsigned char)207;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x45,%eax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    1153 <RandomFunc+0x53>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%edx
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%ecx
imul   %edx,%ecx
mov    %cl,-0x11(%rbp,%rax,1)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    111d <RandomFunc+0x1d>
movzbl -0x11(%rbp),%eax
sub    $0x35d5e8eb,%rax
sub    $0xcf,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0x8b,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %10, 69
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %12, i8* %13
store i8 0, i8* %6
br label %14
14: ; preds = %18, %2
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load i8, i8* %6
%20 = zext i8 %19 to i64
%21 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %6
%25 = zext i8 %24 to i64
%26 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = mul nsw i32 %28, %23
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
%31 = load i8, i8* %6
%32 = zext i8 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i8
store i8 %34, i8* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = sub i64 %38, 903211243
%40 = sub i64 %39, 207
%41 = trunc i64 %40 to i8
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 0
store i8 %41, i8* %43
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -117
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gosh_free(void *ptr) { free(ptr); }


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

LLVM IR (-O0):
define void @gosh_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 @gosh_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xc5() {
  Assert_real((isalnum(197) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              990, ("isalnum should be 0 for 0xc5"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xc5>:
push   %rax
mov    $0xc5,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3de,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xc5\00"
define void @t_isalnum_0xc5() {
%1 = call i64 @isalnum(i32 197)
%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 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xc5\00"
define void @t_isalnum_0xc5() {
%1 = tail call i64 @isalnum(i32 197)
%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 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fus_vm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fus_vm_cleanup(struct fus_vm_t *);
int fus_vm_init(struct fus_vm_t *);
int fus_vm_reset(struct fus_vm_t *vm) {
  fus_vm_cleanup(vm);
  return fus_vm_init(vm);
}


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

x86 assembly (clang, -O2):
<fus_vm_reset>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fus_vm_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fus_vm_init@plt>

LLVM IR (-O0):
%struct.fus_vm_t = type { i32 }
define i32 @fus_vm_reset(%struct.fus_vm_t* %0) {
%2 = alloca %struct.fus_vm_t*
store %struct.fus_vm_t* %0, %struct.fus_vm_t** %2
%3 = load %struct.fus_vm_t*, %struct.fus_vm_t** %2
%4 = call i32 @fus_vm_cleanup(%struct.fus_vm_t* %3)
%5 = load %struct.fus_vm_t*, %struct.fus_vm_t** %2
%6 = call i32 @fus_vm_init(%struct.fus_vm_t* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.fus_vm_t = type { i32 }
define i32 @fus_vm_reset(%struct.fus_vm_t* %0) {
%2 = tail call i32 @fus_vm_cleanup(%struct.fus_vm_t* %0)
%3 = tail call i32 @fus_vm_init(%struct.fus_vm_t* %0)
ret i32 %3
}
unsigned int convert_le_u16(const unsigned char *buf) {
  return buf[0] | (buf[1] << 8);
}


x86 assembly (clang, -O0):
<convert_le_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_le_u16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @convert_le_u16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @convert_le_u16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void SplitUVRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @SplitUVRow_Any_AVX2() {
ret void
}
void do_swap2(void *i) {
  char *p = (char *)i;
  char tmp;
  tmp = p[1];
  p[1] = p[0];
  p[0] = tmp;
}


x86 assembly (clang, -O0):
<do_swap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_swap2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @do_swap2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @do_swap2(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
store i8 %4, i8* %2
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_reset_solar_short() {
  pmu_reg_write(0x0E, ((0 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) |
                       (3 << 4) | (0)));
  pmu_reg_write(0x0E, ((0 << 12) | (1 << 11) | (1 << 10) | (0 << 9) | (0 << 8) |
                       (3 << 4) | (0)));
}


x86 assembly (clang, -O0):
<pmu_reset_solar_short>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
mov    $0xe30,%esi
call   1030 <pmu_reg_write@plt>
mov    $0xe,%edi
mov    $0xc30,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_reset_solar_short>:
push   %rax
mov    $0xe,%edi
mov    $0xe30,%esi
call   1030 <pmu_reg_write@plt>
mov    $0xe,%edi
mov    $0xc30,%esi
pop    %rax
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_reset_solar_short() {
%1 = call i32 @pmu_reg_write(i32 14, i32 3632)
%2 = call i32 @pmu_reg_write(i32 14, i32 3120)
ret void
}

LLVM IR (-O2):
define void @pmu_reset_solar_short() {
%1 = tail call i32 @pmu_reg_write(i32 14, i32 3632)
%2 = tail call i32 @pmu_reg_write(i32 14, i32 3120)
ret void
}
int mav(int motor, int velocity) {}


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

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

LLVM IR (-O0):
define i32 @mav(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @mav(i32 %0, i32 %1) {
ret i32 undef
}
int intorder(void *x, void *y) {
  int *a = x, *b = y;
  return *a <= *b;
}


x86 assembly (clang, -O0):
<intorder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intorder>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @intorder(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sle i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @intorder(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *jas_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *jas_calloc(size_t nmemb, size_t size) {
  void *ptr;
  size_t n;
  n = nmemb * size;
  if (!(ptr = jas_malloc(n * sizeof(char)))) {
    return 0;
  }
  memset(ptr, 0, n);
  return ptr;
}


x86 assembly (clang, -O0):
<jas_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <jas_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1165 <jas_calloc+0x45>
movq   $0x0,-0x8(%rbp)
jmp    117c <jas_calloc+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jas_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <jas_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <jas_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @jas_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @jas_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
int corner_val(int perm, int ori) { return ori * 8 + perm; }


x86 assembly (clang, -O0):
<corner_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_val>:
lea    (%rdi,%rsi,8),%eax
ret

LLVM IR (-O0):
define i32 @corner_val(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 = mul nsw i32 %5, 8
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @corner_val(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int get16(unsigned char **);
int /*<<< orphan*/ printf(char *, int);
void readData(unsigned char **head, int protocol) {
  printf("Source port: %d\n", get16(head));
  printf("Destination port: %d\n", get16(head));
}


x86 assembly (clang, -O0):
<readData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get16@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get16@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readData>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get16@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <get16@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Source port: %d\0A\00"
@.str.1 = [22 x i8] c"Destination port: %d\0A\00"
define void @readData(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = call i32 @get16(i8** %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8**, i8*** %3
%9 = call i32 @get16(i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Source port: %d\0A\00"
@.str.1 = [22 x i8] c"Destination port: %d\0A\00"
define void @readData(i8** %0, i32 %1) {
%3 = tail call i32 @get16(i8** %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @get16(i8** %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct signalfd_siginfo {
  int ssi_signo;
};
typedef int /*<<< orphan*/ info;

/* Variables and functions */
int errno;
int read(int, struct signalfd_siginfo *, int);
int read_signal(int fd) {
  struct signalfd_siginfo info;
  int rc;
  rc = read(fd, &info, sizeof(info));
  if (rc > 0) {
    return info.ssi_signo;
  }
  return -errno;
}


x86 assembly (clang, -O0):
<read_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1144 <read_signal+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <read_signal+0x42>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_signal>:
push   %rax
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1127 <read_signal+0x17>
mov    (%rsp),%eax
pop    %rcx
ret
mov    0x2eb2(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.signalfd_siginfo = type { i32 }
@errno = global i32 0
define i32 @read_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.signalfd_siginfo
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, %struct.signalfd_siginfo* %4, i32 4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.signalfd_siginfo, %struct.signalfd_siginfo* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.signalfd_siginfo = type { i32 }
@errno = global i32 0
define i32 @read_signal(i32 %0) {
%2 = alloca %struct.signalfd_siginfo
%3 = bitcast %struct.signalfd_siginfo* %2 to i8*
%4 = call i32 @read(i32 %0, %struct.signalfd_siginfo* %2, i32 4)
%5 = icmp sgt i32 %4, 0
%6 = getelementptr inbounds %struct.signalfd_siginfo, %struct.signalfd_siginfo* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = select i1 %5, i32 %7, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void output(char *text) {
  FILE *file;
  file = fopen("outputfc_10.txt", "w");
  fprintf(file, "%s", text);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <fopen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"outputfc_10.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @output(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fputs(i8* %0, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int serial_close(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}