xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int build_sha256_sum_file(int /*<<< orphan*/ *, unsigned char *);
int /*<<< orphan*/ *fopen(char *, char *);
int build_sha256_sum(char *filename, unsigned char *hash) {
  FILE *fp = NULL;
  fp = fopen(filename, "rb");
  if (fp == NULL) {
    return 0x40;
  }
  return build_sha256_sum_file(fp, hash);
}


x86 assembly (clang, -O0):
<build_sha256_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <build_sha256_sum+0x43>
movl   $0x40,-0x4(%rbp)
jmp    1173 <build_sha256_sum+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <build_sha256_sum_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_sha256_sum>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <build_sha256_sum+0x21>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <build_sha256_sum_file@plt>
mov    $0x40,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @build_sha256_sum(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @build_sha256_sum_file(i32* %3, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 64, %2 ]
ret i32 %8
}
double df5(double x, double y) { return 2 * x * x + 2 * y; }


x86 assembly (clang, -O0):
<df5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed8(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df5>:
movapd %xmm0,%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @df5(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double 2.000000e+00, %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fmul double 2.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %7, double %9)
ret double %10
}

LLVM IR (-O2):
define double @df5(double %0, double %1) {
%3 = fmul double %0, 2.000000e+00
%4 = fmul double %1, 2.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
ret double %5
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void inicializarSemilla() {
  struct timeval start;
  gettimeofday(&start, NULL);
  srand(start.tv_usec);
}


x86 assembly (clang, -O0):
<inicializarSemilla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializarSemilla>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @inicializarSemilla() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @inicializarSemilla() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @srand(i32 %5)
ret void
}
void sfence(void) { __asm volatile("sfence"); }


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

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

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

LLVM IR (-O2):
define void @sfence() {
tail call void asm sideeffect "sfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CapSense_SsTrimIdacsSourcing();
void CapSense_SsTrimIdacs(void) { CapSense_SsTrimIdacsSourcing(); }


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

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

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

LLVM IR (-O2):
define void @CapSense_SsTrimIdacs() {
%1 = tail call i32 (...) @CapSense_SsTrimIdacsSourcing()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _generateOredered(int /*<<< orphan*/, int, int, int);
void generateOredered(int limit) { _generateOredered(0, 9, 1, limit); }


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

x86 assembly (clang, -O2):
<generateOredered>:
mov    %edi,%ecx
xor    %edi,%edi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <_generateOredered@plt>

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

LLVM IR (-O2):
define void @generateOredered(i32 %0) {
%2 = tail call i32 @_generateOredered(i32 0, i32 9, i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ writeTest(int);
void onWrite(int socket) {
  printf("onWrite\n");
  writeTest(socket);
}


x86 assembly (clang, -O0):
<onWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <writeTest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onWrite>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <writeTest@plt>

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

LLVM IR (-O2):
@str = [8 x i8] c"onWrite\00"
define void @onWrite(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @writeTest(i32 %0)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int alphasort(const struct dirent **d1, const struct dirent **d2) {
  return (strcoll((*d1)->d_name, (*d2)->d_name));
}


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

x86 assembly (clang, -O2):
<alphasort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcoll(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcoll(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cursorhorizontalabsolute(int arg) {
  printf("\x1b["
         "%dG",
         arg);
}


x86 assembly (clang, -O0):
<cursorhorizontalabsolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cursorhorizontalabsolute>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dG\00"
define void @cursorhorizontalabsolute(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int compare(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ to_lower(char *);
int compare_case(const char *str1, const char *str2) {
  char copy1[100];
  char copy2[100];
  strcpy(copy1, str1);
  strcpy(copy2, str2);
  to_lower(copy1);
  to_lower(copy2);
  return compare(copy1, copy2);
}


x86 assembly (clang, -O0):
<compare_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
call   1040 <to_lower@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <to_lower@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1050 <compare@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_case>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <to_lower@plt>
mov    %r15,%rdi
call   1040 <to_lower@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <compare@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @compare_case(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = call i32 @to_lower(i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @to_lower(i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%19 = call i32 @compare(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @compare_case(i8* %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %0)
%8 = call i32 @strcpy(i8* %6, i8* %1)
%9 = call i32 @to_lower(i8* %5)
%10 = call i32 @to_lower(i8* %6)
%11 = call i32 @compare(i8* %5, i8* %6)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ kvst_destroy();
int /*<<< orphan*/ mthread_finalize();
void mr_finalize(void) {
  kvst_destroy();
  mthread_finalize();
}


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

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

LLVM IR (-O0):
define void @mr_finalize() {
%1 = call i32 (...) @kvst_destroy()
%2 = call i32 (...) @mthread_finalize()
ret void
}

LLVM IR (-O2):
define void @mr_finalize() {
%1 = tail call i32 (...) @kvst_destroy()
%2 = tail call i32 (...) @mthread_finalize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__2__IrqSignal__fired();
void HplAtm128InterruptSigP__IntSig2__fired(void) {
  HplAtm128InterruptPinP__2__IrqSignal__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptSigP__IntSig2__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__2__IrqSignal__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ maxAndMin();
int /*<<< orphan*/ mean();
int /*<<< orphan*/ mode();
int main() {
  mean();
  mode();
  maxAndMin();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <mean@plt>
xor    %eax,%eax
call   1030 <mode@plt>
xor    %eax,%eax
call   1050 <maxAndMin@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mean()
%2 = tail call i32 (...) @mode()
%3 = tail call i32 (...) @maxAndMin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ innerDoTreeStuff(int /*<<< orphan*/);
int main() {
  innerDoTreeStuff(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @innerDoTreeStuff(i32 0)
ret i32 0
}
double sign_flat(double v) {
  if (v == 0.0)
    return 0.0;
  return v;
}


x86 assembly (clang, -O0):
<sign_flat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <sign_flat+0x2e>
jp     112e <sign_flat+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <sign_flat+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_flat>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sign_flat(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
7: ; preds = %1
%8 = load double, double* %3
store double %8, double* %2
br label %9
9: ; preds = %7, %6
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @sign_flat(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x26() {
  Assert_real((islower(38) == 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_islower.c",
              195, ("islower should be 0 for &"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x26>:
push   %rax
mov    $0x26,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xc3,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for &\00"
define void @t_islower_0x26() {
%1 = call i64 @islower(i32 38)
%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 195, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for &\00"
define void @t_islower_0x26() {
%1 = tail call i64 @islower(i32 38)
%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 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap(int *x, int *y) {
  *y = *x - *y;
  *x = *x - *y;
  *y = *x + *y;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
store i32 %5, i32* %1
%6 = load i32, i32* %0
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
ret void
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gfmiv(int /*<<< orphan*/);
size_t gfmult(size_t, int /*<<< orphan*/);
int /*<<< orphan*/ gfpow(size_t);
size_t rs(size_t *);
void find_one_data_parity_missing(uint8_t d[], uint8_t pos, uint8_t q) {
  uint8_t qx = rs(d);
  qx = qx ^ q;
  d[pos] = gfmult(qx, gfmiv(gfpow(pos)));
}


x86 assembly (clang, -O0):
<find_one_data_parity_missing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <gfpow@plt>
mov    %eax,%edi
call   1050 <gfmiv@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <gfmult@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_one_data_parity_missing>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <rs@plt>
xor    %rax,%rbx
mov    %r14,%rdi
call   1060 <gfpow@plt>
mov    %eax,%edi
call   1050 <gfmiv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <gfmult@plt>
mov    %rax,(%r15,%r14,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @find_one_data_parity_missing(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = call i64 @rs(i64* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = xor i64 %10, %11
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %5
%15 = call i32 @gfpow(i64 %14)
%16 = call i32 @gfmiv(i32 %15)
%17 = call i64 @gfmult(i64 %13, i32 %16)
%18 = load i64*, i64** %4
%19 = load i64, i64* %5
%20 = getelementptr inbounds i64, i64* %18, i64 %19
store i64 %17, i64* %20
ret void
}

LLVM IR (-O2):
define void @find_one_data_parity_missing(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 @rs(i64* %0)
%5 = xor i64 %4, %2
%6 = tail call i32 @gfpow(i64 %1)
%7 = tail call i32 @gfmiv(i32 %6)
%8 = tail call i64 @gfmult(i64 %5, i32 %7)
%9 = getelementptr inbounds i64, i64* %0, i64 %1
store i64 %8, i64* %9
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void sev_time_now(long *sec, long *msec) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *sec = tv.tv_sec;
  *msec = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<sev_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sev_time_now>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @sev_time_now(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @sev_time_now(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
int chan() { return 42; }


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

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

LLVM IR (-O0):
define i32 @chan() {
ret i32 42
}

LLVM IR (-O2):
define i32 @chan() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int _pthread_set_state(int /*<<< orphan*/ *, int, int);
int pthread_attr_setscope(pthread_attr_t *a, int flag) {
  return _pthread_set_state(a, 0x10, flag);
}


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

x86 assembly (clang, -O2):
<pthread_attr_setscope>:
mov    %esi,%edx
mov    $0x10,%esi
jmp    1030 <_pthread_set_state@plt>

LLVM IR (-O0):
define i32 @pthread_attr_setscope(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 @_pthread_set_state(i32* %5, i32 16, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_attr_setscope(i32* %0, i32 %1) {
%3 = tail call i32 @_pthread_set_state(i32* %0, i32 16, i32 %1)
ret i32 %3
}
int main() {
  int i;
  asm volatile(".byte 0x0f, 0x1f, 0xF3");
  for (i = 0; i < 10; i++)
    ;
  asm volatile(".byte 0x0f, 0x1f, 0xF4");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
nop    %ebx
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1132 <main+0x32>
jmp    1124 <main+0x24>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <main+0x15>
nop    %esp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
nop    %ebx
nop    %esp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect ".byte 0x0f, 0x1f, 0xF3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect ".byte 0x0f, 0x1f, 0xF4", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xany;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xany_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xany.serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xany_serial>:
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_XEvent_xany_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xany_serial(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xany_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ calloc_must_clear(int /*<<< orphan*/);
int /*<<< orphan*/ clear(void *, int /*<<< orphan*/);
void *dlmalloc(size_t);
int /*<<< orphan*/ dlsizeof(void *);
int /*<<< orphan*/ mem2chunk(void *);
void *hs_malloc(size_t reqsize) {
  void *mem = dlmalloc(reqsize);
  if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
    clear(mem, dlsizeof(mem));
  return mem;
}


x86 assembly (clang, -O0):
<hs_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <dlmalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11aa <hs_malloc+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <mem2chunk@plt>
mov    %eax,%edi
call   1040 <calloc_must_clear@plt>
cmp    $0x0,%rax
je     11aa <hs_malloc+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <dlsizeof@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <clear@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs_malloc>:
push   %rbx
call   1070 <dlmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1184 <hs_malloc+0x34>
mov    %rbx,%rdi
call   1030 <mem2chunk@plt>
mov    %eax,%edi
call   1040 <calloc_must_clear@plt>
test   %rax,%rax
je     1184 <hs_malloc+0x34>
mov    %rbx,%rdi
call   1050 <dlsizeof@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <clear@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hs_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @dlmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @mem2chunk(i8* %9)
%11 = call i64 @calloc_must_clear(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8*, i8** %3
%16 = call i32 @dlsizeof(i8* %15)
%17 = call i32 @clear(i8* %14, i32 %16)
br label %18
18: ; preds = %13, %8, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @hs_malloc(i64 %0) {
%2 = tail call i8* @dlmalloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @mem2chunk(i8* %2)
%6 = tail call i64 @calloc_must_clear(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @dlsizeof(i8* %2)
%10 = tail call i32 @clear(i8* %2, i32 %9)
br label %11
11: ; preds = %8, %4, %1
ret i8* %2
}
unsigned char unsignedCharTest(unsigned char value) { return value; }


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

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

LLVM IR (-O0):
define zeroext i8 @unsignedCharTest(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 @unsignedCharTest(i8 returned zeroext %0) {
ret i8 %0
}
void SWI_Routine(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XTextItem(void *_p) {
  if (_p == NULL)
    abort();
  free((XTextItem *)_p);
}


x86 assembly (clang, -O0):
<free_XTextItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XTextItem+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XTextItem>:
test   %rdi,%rdi
je     112a <free_XTextItem+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XTextItem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XTextItem(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
int gp_enumerate_fonts_next(void *enum_state, char **fontname, char **path) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gp_enumerate_fonts_next(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 0
}
void I420Rect() {}


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

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

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

LLVM IR (-O2):
define void @I420Rect() {
ret void
}
void start() {}


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

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

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

LLVM IR (-O2):
define void @start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int, int *, int);
void read_integer_(int *z, int *fd) { read(*fd, z, sizeof(int)); }


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

x86 assembly (clang, -O2):
<read_integer_>:
mov    %rdi,%rax
mov    (%rsi),%edi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define void @read_integer_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @read(i32 %3, i32* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
float foo(float);
int main(void) {
  if (foo(-1.0f) != 1.0f)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
call   1040 <foo@plt>
movss  0xebc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1158 <main+0x38>
jp     1158 <main+0x38>
jmp    115f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <foo@plt>
ucomiss 0xecf(%rip),%xmm0
jne    113d <main+0x1d>
jp     113d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call float @foo(float -1.000000e+00)
%3 = fcmp une float %2, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @foo(float -1.000000e+00)
%2 = fcmp une float %1, 1.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
unsigned int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnMSSR(unsigned sock) {
  unsigned res = w5100_readSn_byte(sock, 0x0012);
  res = (res << 8) + w5100_readSn_byte(sock, 0x0012 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x13,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x12,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
mov    $0x13,%esi
call   1030 <w5100_readSn_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @w5100_readSnMSSR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @w5100_readSn_byte(i32 %4, i32 18)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %2
%9 = call i32 @w5100_readSn_byte(i32 %8, i32 19)
%10 = add i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @w5100_readSnMSSR(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 18)
%3 = shl i32 %2, 8
%4 = tail call i32 @w5100_readSn_byte(i32 %0, i32 19)
%5 = add i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void swap(uint32_t *a, uint32_t *b) {
  (void)0;
  ;
  uint32_t c = *a;
  *a = *b;
  *b = c;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
struct connection {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int conn_data_consume(struct connection *);
int conn_do_write(struct connection *c) {
  ssize_t n;
  for (;;) {
    n = conn_data_consume(c);
    if (n == -1)
      return -1;
    else if (n == 0)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<conn_do_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <conn_data_consume@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    113e <conn_do_write+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <conn_do_write+0x4e>
cmpl   $0x0,-0x14(%rbp)
jne    114d <conn_do_write+0x3d>
jmp    1157 <conn_do_write+0x47>
jmp    1152 <conn_do_write+0x42>
jmp    111c <conn_do_write+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conn_do_write>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <conn_data_consume@plt>
lea    0x1(%rax),%ecx
cmp    $0x1,%ecx
ja     1120 <conn_do_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.connection = type { i32 }
define i32 @conn_do_write(%struct.connection* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @conn_data_consume(%struct.connection* %0)
switch i32 %3, label %2 [
i32 -1, label %4
i32 0, label %4
]
4: ; preds = %2, %2
ret i32 %3
}
void XtIsConstraint() {}


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

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

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

LLVM IR (-O2):
define void @XtIsConstraint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void say_version(void) {
  fprintf(stderr, "zerone-v1.0"
                  "\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"zerone-v1.0\0A\00"
define void @say_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"zerone-v1.0\0A\00"
define void @say_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: lcd-tools [options] ...\n"
         "  -h --help\t\t\tPrint this help message\n"
         "  -c --control\t\t\tTurn off or on (0/1)\n"
         "  -s --string\t\t\tDisplay string\n"
         "  -i --init\t\t\tInit LCD\n");
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"Usage: lcd-tools [options] ...\0A -h --help\09\09\09Print this help message\0A -c --control\09\09\09Turn off or on (0/1)\0A -s --string\09\09\09Display string\0A -i --init\09\09\09Init LCD\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [161 x i8] c"Usage: lcd-tools [options] ...\0A -h --help\09\09\09Print this help message\0A -c --control\09\09\09Turn off or on (0/1)\0A -s --string\09\09\09Display string\0A -i --init\09\09\09Init LCD\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int BNCFrontOnOff() {
  int ii, stat = 99;
  char com1, data;
  printf("Front panel on/off=1/0 \n");
  scanf("%i", &ii);
  BNCIO2(32, ii);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCFrontOnOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
call   1040 <BNCIO2@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFrontOnOff>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    $0x20,%edi
call   1040 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Front panel on/off=1/0 \0A\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @BNCFrontOnOff() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @BNCIO2(i32 32, i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@str = [24 x i8] c"Front panel on/off=1/0 \00"
define i32 @BNCFrontOnOff() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @BNCIO2(i32 32, i32 %5)
ret i32 99
}