xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_window(void *_p, unsigned long _v) {
  ((XGravityEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XGravityEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *fopen(const char *pathname __attribute__((unused)),
            const char *mode __attribute__((unused))) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Uso:\n");
  printf("./decodifica {1 <paquete HEX> | 2}");
  printf(" 1.- Conversión de un paquete a binario\n");
  printf(" 2.- Cálculo de paquetes en función de parámetros\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Uso:\0A\00"
@.str.1 = [35 x i8] c"./decodifica {1 <paquete HEX> | 2}\00"
@.str.2 = [42 x i8] c" 1.- Conversi\C3\B3n de un paquete a binario\0A\00"
@.str.3 = [54 x i8] c" 2.- C\C3\A1lculo de paquetes en funci\C3\B3n de par\C3\A1metros\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"./decodifica {1 <paquete HEX> | 2}\00"
@str = [5 x i8] c"Uso:\00"
@str.4 = [41 x i8] c" 1.- Conversi\C3\B3n de un paquete a binario\00"
@str.5 = [53 x i8] c" 2.- C\C3\A1lculo de paquetes en funci\C3\B3n de par\C3\A1metros\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
int main() {
  int r = 20;
  float area = 2 * 3.14 * (r * r);
  printf("Area of cirlce of Radius= %d is: %.2f\n", r, area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"Area of cirlce of Radius= %d is: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 20, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = fmul double 6.280000e+00, %7
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load i32, i32* %2
%11 = load float, float* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %10, float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Area of cirlce of Radius= %d is: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 20, float 2.512000e+03)
ret i32 0
}
/* Variables and functions */
int test();
int main(void) { return test(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 %1
}
/* Type definitions */
struct tester {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tester *);
void test_destroy(struct tester *tester) { free(tester); }


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

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

LLVM IR (-O2):
%struct.tester = type { i32 }
define void @test_destroy(%struct.tester* nocapture %0) {
%2 = tail call i32 @free(%struct.tester* %0)
ret void
}
__attribute__((no, noclone)) int f1(int A, int B) {
  volatile int C = A & ~B;
  volatile int D = A ^ B;
  return C | D;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
mov    %eax,-0x4(%rsp)
xor    %edi,%esi
mov    %esi,-0x8(%rsp)
mov    -0x4(%rsp),%eax
or     -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
store volatile i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = xor i32 %11, %12
store volatile i32 %13, i32* %6
%14 = load volatile i32, i32* %5
%15 = load volatile i32, i32* %6
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = xor i32 %1, -1
%7 = and i32 %6, %0
store volatile i32 %7, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = xor i32 %1, %0
store volatile i32 %9, i32* %4
%10 = load volatile i32, i32* %3
%11 = load volatile i32, i32* %4
%12 = or i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf30(int f, int n) { return (cbuf(f, n, 30)); }


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

x86 assembly (clang, -O2):
<cbuf30>:
mov    $0x1e,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf30(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 30)
ret i32 %3
}
void a_free(struct sg_alloc_s *a, void *ptr) {}


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

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

LLVM IR (-O0):
%struct.sg_alloc_s = type opaque
define void @a_free(%struct.sg_alloc_s* %0, i8* %1) {
%3 = alloca %struct.sg_alloc_s*
%4 = alloca i8*
store %struct.sg_alloc_s* %0, %struct.sg_alloc_s** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.sg_alloc_s = type opaque
define void @a_free(%struct.sg_alloc_s* nocapture %0, i8* nocapture %1) {
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 9 * 0x00100 | 4 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 133380
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 133380
}
/* Variables and functions */
int foo(int, int *);
int main(void) {
  int a[6] = {};
  return foo(3, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rsi
mov    $0x3,%edi
call   1040 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edi
call   1030 <foo@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32 3, i32* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fileExists(char *s) {
  FILE *file = fopen(s, "r");
  if (file == NULL) {
    return 0;
  } else {
    fclose(file);
    return 1;
  }
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <fileExists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <fileExists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void gtk_toggle_button_get_inconsistent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_get_inconsistent() {
ret void
}
int fun454() { return 454; }


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

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

LLVM IR (-O0):
define i32 @fun454() {
ret i32 454
}

LLVM IR (-O2):
define i32 @fun454() {
ret i32 454
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawnattr_setflags>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_setflags>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_setflags(i32* %0, i16 signext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_setflags(i32* nocapture readnone %0, i16 signext %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ stream_close(int /*<<< orphan*/ *, int /*<<< orphan*/);
void streams_close(FILE *stream_in, FILE *stream_out) {
  stream_close(stream_in, stdin);
  stream_close(stream_out, stdout);
}


x86 assembly (clang, -O0):
<streams_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <stream_close@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <stream_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streams_close>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
call   1030 <stream_close@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <stream_close@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define void @streams_close(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @stdin
%7 = call i32 @stream_close(i32* %5, i32 %6)
%8 = load i32*, i32** %4
%9 = load i32, i32* @stdout
%10 = call i32 @stream_close(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define void @streams_close(i32* %0, i32* %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @stream_close(i32* %0, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @stream_close(i32* %1, i32 %5)
ret void
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int tty_puts(char *buf) {
  unsigned int length = 0;
  while (buf[length] != 0) {
    length++;
  }
  return sys_call(0x02, (unsigned int)buf, length, 0, 0);
}


x86 assembly (clang, -O0):
<tty_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1145 <tty_puts+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <tty_puts+0x13>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_puts>:
mov    %rdi,%rsi
mov    $0xffffffff,%edx
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
cmpb   $0x0,(%rsi,%rdx,1)
jne    1120 <tty_puts+0x10>
mov    $0x2,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

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

LLVM IR (-O2):
define i32 @tty_puts(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = ptrtoint i8* %0 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @sys_call(i32 2, i32 %11, i32 %3, i32 0, i32 0)
ret i32 %12
}
/* Variables and functions */
void v32_htole(void *);
void v32_letoh(void *p) { return v32_htole(p); }


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

x86 assembly (clang, -O2):
<v32_letoh>:
jmp    1030 <v32_htole@plt>

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

LLVM IR (-O2):
define void @v32_letoh(i8* %0) {
tail call void @v32_htole(i8* %0)
ret void
}
/* Variables and functions */
int max(int a, int b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ proc1();
void i() {
  proc1();
  return;
}


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

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

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

LLVM IR (-O2):
define void @i() {
%1 = tail call i32 (...) @proc1()
ret void
}
int open(const char *path, int flags, int mode) {
  int ret;
  asm("movl $5, %%eax\n\t"
      "movl %1, %%ebx\n\t"
      "movl %2, %%ecx\n\t"
      "movl %3, %%edx\n\t"
      "int $0x80\n\t"
      "movl %%eax, %0"
      : "=m"(ret)
      : "m"(path), "m"(flags), "m"(mode));
  return ret;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x5,%eax
mov    -0x8(%rbp),%ebx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %rdi,-0x8(%rsp)
mov    %esi,-0xc(%rsp)
mov    %edx,-0x10(%rsp)
mov    $0x5,%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
mov    -0x10(%rsp),%edx
int    $0x80
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf(
      "\n************* mwiggle, version %d.%d *************\n* utility to "
      "create and query files containing *\n* multiple wiggle plots of genomic "
      "data        *\n************************************************\n",
      0, 4);
  printf("Usage:\n\n mwiggle COMMAND FILE PARAMS, e.g\n\nmwiggle create "
         "myfile.mw *.wig -t 9060 -a CRGh37 -d \"My study files\"\nmwiggle "
         "stats myfile.mw \nmwiggle dump myfile.mw [-r I:1-100] [-t "
         "0,1]\nmwiggle fetch myfile.mw -r I:1-100 [-t 0,1] [-w 20]\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf8b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [200 x i8] c"\0A************* mwiggle, version %d.%d *************\0A* utility to create and query files containing *\0A* multiple wiggle plots of genomic data *\0A************************************************\0A\00"
@.str.1 = [236 x i8] c"Usage:\0A\0A mwiggle COMMAND FILE PARAMS, e.g\0A\0Amwiggle create myfile.mw *.wig -t 9060 -a CRGh37 -d \22My study files\22\0Amwiggle stats myfile.mw \0Amwiggle dump myfile.mw [-r I:1-100] [-t 0,1]\0Amwiggle fetch myfile.mw -r I:1-100 [-t 0,1] [-w 20]\0A\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 0, i32 4)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([236 x i8], [236 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [200 x i8] c"\0A************* mwiggle, version %d.%d *************\0A* utility to create and query files containing *\0A* multiple wiggle plots of genomic data *\0A************************************************\0A\00"
@str = [235 x i8] c"Usage:\0A\0A mwiggle COMMAND FILE PARAMS, e.g\0A\0Amwiggle create myfile.mw *.wig -t 9060 -a CRGh37 -d \22My study files\22\0Amwiggle stats myfile.mw \0Amwiggle dump myfile.mw [-r I:1-100] [-t 0,1]\0Amwiggle fetch myfile.mw -r I:1-100 [-t 0,1] [-w 20]\0A\00"
define void @usage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 0, i32 4)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([235 x i8], [235 x i8]* @str, i64 0, i64 0))
ret void
}
void void_function_no_param_with_int_variable() {
  int variable_of_type_int_in_body_of_function;
}


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

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

LLVM IR (-O0):
define void @void_function_no_param_with_int_variable() {
%1 = alloca i32
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t write_bytes(int f, const void *b, size_t n) { return write(f, b, n); }


x86 assembly (clang, -O0):
<write_bytes>:
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 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bytes>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @write_bytes(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 @write(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_bytes(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
double sqrt(int);
double EDDacos(double x) { return (-x / sqrt(1. - x * x) / (1. - x * x)); }


x86 assembly (clang, -O0):
<EDDacos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe4f(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDDacos>:
sub    $0x28,%rsp
movapd 0xee4(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
divsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @EDDacos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fneg double %5
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = fptosi double %8 to i32
%10 = call double @sqrt(i32 %9)
%11 = fdiv double %4, %10
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fneg double %12
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double 1.000000e+00)
%16 = fdiv double %11, %15
ret double %16
}

LLVM IR (-O2):
define double @EDDacos(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fdiv double %2, %5
%7 = fdiv double %6, %3
ret double %7
}
void I422AlphaToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I422AlphaToARGBRow_NEON() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_selectznz(uintptr_t, uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p224_selectznz(uint32_t out1[7], uint8_t arg1, const uint32_t arg2[7],
                         const uint32_t arg3[7]) {
  internal_fiat_p224_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_p224_selectznz>:
jmp    1030 <internal_fiat_p224_selectznz@plt>

LLVM IR (-O0):
define void @fiat_p224_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_p224_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_p224_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int unlink(char const *);
void unlink_or_exit(const char *file_name) {
  int result = -1;
  errno = 0;
  result = unlink(file_name);
  if (result < 0) {
    perror("Can't unlink");
    exit(7);
  }
}


x86 assembly (clang, -O0):
<unlink_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    0x2e96(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    117d <unlink_or_exit+0x4d>
lea    0xe92(%rip),%rdi
call   1040 <perror@plt>
mov    $0x7,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_or_exit>:
push   %rax
mov    0x2ea8(%rip),%rax
movq   $0x0,(%rax)
call   1030 <unlink@plt>
test   %eax,%eax
js     114a <unlink_or_exit+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x7,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [13 x i8] c"Can't unlink\00"
define void @unlink_or_exit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
store i64 0, i64* @errno
%4 = load i8*, i8** %2
%5 = call i32 @unlink(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 7)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [13 x i8] c"Can't unlink\00"
define void @unlink_or_exit(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 7)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_carry(int);
int /*<<< orphan*/ set_overflow(int);
void restore_flags(int co) {
  set_carry(co & 1);
  set_overflow(co & 2);
}


x86 assembly (clang, -O0):
<restore_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x1,%edi
call   1030 <set_carry@plt>
mov    -0x4(%rbp),%edi
and    $0x2,%edi
call   1040 <set_overflow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_flags>:
push   %rbx
mov    %edi,%ebx
and    $0x1,%edi
call   1030 <set_carry@plt>
and    $0x2,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <set_overflow@plt>

LLVM IR (-O0):
define void @restore_flags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = call i32 @set_carry(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 2
%8 = call i32 @set_overflow(i32 %7)
ret void
}

LLVM IR (-O2):
define void @restore_flags(i32 %0) {
%2 = and i32 %0, 1
%3 = tail call i32 @set_carry(i32 %2)
%4 = and i32 %0, 2
%5 = tail call i32 @set_overflow(i32 %4)
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
unsigned long SDP_StrCount(const char *string, char c) {
  unsigned long total_occurrences = 0;
  char *last_occurrence;
  last_occurrence = strchr(string, c);
  while (last_occurrence) {
    string = last_occurrence;
    ++total_occurrences;
    last_occurrence = strchr(string, c);
  }
  return total_occurrences;
}


x86 assembly (clang, -O0):
<SDP_StrCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1170 <SDP_StrCount+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
jmp    113b <SDP_StrCount+0x2b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDP_StrCount>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1143 <SDP_StrCount+0x33>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <SDP_StrCount+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @SDP_StrCount(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %3, %2 ]
%7 = phi i64 [ %8, %5 ], [ 0, %2 ]
%8 = add i64 %7, 1
%9 = tail call i8* @strchr(i8* %6, i8 signext %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i64 [ 0, %2 ], [ %8, %5 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ RegRead(unsigned char, unsigned char, unsigned char *);
void RegReadA(unsigned short RegAddr, unsigned char *RegData) {
  unsigned char RegAddrH = RegAddr >> 8;
  unsigned char RegAddrL = RegAddr & 0xFF;
  RegRead(RegAddrH, RegAddrL, RegData);
}


x86 assembly (clang, -O0):
<RegReadA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x11(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x12(%rbp),%al
mov    -0x10(%rbp),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <RegRead@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RegReadA>:
mov    %rsi,%rdx
movzbl %dil,%esi
shr    $0x8,%edi
jmp    1030 <RegRead@plt>

LLVM IR (-O0):
define void @RegReadA(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i16 %0, i16* %3
store i8* %1, i8** %4
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i8, i8* %5
%16 = load i8, i8* %6
%17 = load i8*, i8** %4
%18 = call i32 @RegRead(i8 zeroext %15, i8 zeroext %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @RegReadA(i16 zeroext %0, i8* %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %0 to i8
%6 = tail call i32 @RegRead(i8 zeroext %4, i8 zeroext %5, i8* %1)
ret void
}
unsigned char identiuchar(unsigned char c) { return c; }


x86 assembly (clang, -O0):
<identiuchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @identiuchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @identiuchar(i8 returned zeroext %0) {
ret i8 %0
}
/* Type definitions */
struct pdeq {
  int dummy;
};
struct cds_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void pdeq_push_error(struct cds_list_head *e, struct pdeq *d) {
  printf("pdeq_push_error()\n");
  abort();
}


x86 assembly (clang, -O0):
<pdeq_push_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<pdeq_push_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.cds_list_head = type { i32 }
%struct.pdeq = type { i32 }
@.str = [19 x i8] c"pdeq_push_error()\0A\00"
define void @pdeq_push_error(%struct.cds_list_head* %0, %struct.pdeq* %1) {
%3 = alloca %struct.cds_list_head*
%4 = alloca %struct.pdeq*
store %struct.cds_list_head* %0, %struct.cds_list_head** %3
store %struct.pdeq* %1, %struct.pdeq** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.cds_list_head = type { i32 }
%struct.pdeq = type { i32 }
@str = [18 x i8] c"pdeq_push_error()\00"
define void @pdeq_push_error(%struct.cds_list_head* nocapture readnone %0, %struct.pdeq* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void die(char *s, int i) {
  printf("--> %s, thread numero %i\n", s, i);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"--> %s, thread numero %i\0A\00"
define void @die(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 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"--> %s, thread numero %i\0A\00"
define void @die(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t size = 0;
  while (string[size] != 0) {
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
unsigned int fromHex(int c) {
  if (c >= '0' && c <= '9')
    return (c - '0');
  if (c >= 'a' && c <= 'f')
    return (10 + (c - 'a'));
  if (c >= 'A' && c <= 'F')
    return (10 + (c - 'A'));
  return -1;
}


x86 assembly (clang, -O0):
<fromHex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <fromHex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <fromHex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromHex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <fromHex+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <fromHex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromHex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <fromHex+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <fromHex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <fromHex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromHex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <fromHex+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <fromHex+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @fromHex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 10, %20
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 10, %30
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @fromHex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
float obdConvert_2F(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 100.0f / 255.0f;
}


x86 assembly (clang, -O0):
<obdConvert_2F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_2F>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_2F(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fmul float %10, 1.000000e+02
%12 = fdiv float %11, 2.550000e+02
ret float %12
}

LLVM IR (-O2):
define float @obdConvert_2F(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fmul float %5, 1.000000e+02
%7 = fdiv float %6, 2.550000e+02
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t coff_segbase(int32_t segment) { return segment; }


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

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

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

LLVM IR (-O2):
define i32 @coff_segbase(i32 returned %0) {
ret i32 %0
}