xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ master_server();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Server Started!\n");
  master_server();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Server Started!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @master_server()
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16r7(uint16_t x) { return (x >> 7) | (x << 9); }


x86 assembly (clang, -O0):
<rot16r7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
mov    -0x4(%rbp),%ecx
shl    $0x9,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16r7>:
mov    %edi,%eax
sar    $0x7,%eax
shl    $0x9,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16r7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
%5 = load i32, i32* %2
%6 = shl i32 %5, 9
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16r7(i32 %0) {
%2 = ashr i32 %0, 7
%3 = shl i32 %0, 9
%4 = or i32 %2, %3
ret i32 %4
}
double scale_dh33(double x, double y, double z) { return 0.0; }


x86 assembly (clang, -O0):
<scale_dh33>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_dh33>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @scale_dh33(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @scale_dh33(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Variables and functions */
int syscall(int, int, int);
int dup2(int fd, int gd) { return syscall(43, fd, gd); }


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

x86 assembly (clang, -O2):
<dup2>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x2b,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @dup2(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 @syscall(i32 43, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 43, i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
int get_XButtonReleasedEvent_x(void *_p) {
  return (int)((XButtonReleasedEvent *)_p)->x;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XButtonReleasedEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ fwriteInt(int /*<<< orphan*/, int);
void writeInt(int v) { fwriteInt(STDOUT_FILENO, v); }


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <fwriteInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
mov    %edi,%esi
mov    0x2ed7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fwriteInt@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @writeInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* %2
%5 = call i32 @fwriteInt(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @writeInt(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @fwriteInt(i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ece391_halt(int);
void _exit(int code) {
  ece391_halt(code);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ece391_halt@plt>
jmp    1123 <_exit+0x13>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <ece391_halt@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <_exit+0x10>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ece391_halt(i32 %3)
br label %5
5: ; preds = %5, %1
br label %5
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @ece391_halt(i32 %0)
br label %3
3: ; preds = %3, %1
br label %3
}
int seq_pos(int pos, int rev, int off) {
  if (rev) {
    return -pos - 1 + off;
  } else {
    return pos;
  }
}


x86 assembly (clang, -O0):
<seq_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <seq_pos+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <seq_pos+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_pos>:
mov    %edi,%eax
not    %eax
add    %edx,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @seq_pos(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %5
%12 = sub nsw i32 0, %11
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
store i32 %15, i32* %4
br label %18
16: ; preds = %3
%17 = load i32, i32* %5
store i32 %17, i32* %4
br label %18
18: ; preds = %16, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @seq_pos(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = xor i32 %0, -1
%6 = add nsw i32 %5, %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void closeSocket(int s) {
  if (close(s) < 0) {
    perror("Close socket error:");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<closeSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1163 <closeSocket+0x33>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSocket>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
js     113d <closeSocket+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Close socket error:\00"
define void @closeSocket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Close socket error:\00"
define void @closeSocket(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float celsius;
  scanf("%f", &celsius);
  printf("%f", celsius + 273.15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fadd double %5, 2.731500e+02
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fadd double %5, 2.731500e+02
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CEX_free(void *);
void CEX_aligned_free(void *p) {
  if (p) {
    CEX_free(*((void **)p - 1));
  }
}


x86 assembly (clang, -O0):
<CEX_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <CEX_aligned_free+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <CEX_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CEX_aligned_free>:
test   %rdi,%rdi
je     111e <CEX_aligned_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <CEX_free@plt>
ret

LLVM IR (-O0):
define void @CEX_aligned_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = getelementptr inbounds i8*, i8** %7, i64 -1
%9 = load i8*, i8** %8
%10 = call i32 @CEX_free(i8* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @CEX_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @CEX_free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *init_logger(char *filename) {
  FILE *new_file;
  new_file = fopen(filename, "w");
  if (new_file == NULL) {
    exit(-1);
  }
  return (new_file);
}


x86 assembly (clang, -O0):
<init_logger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <init_logger+0x35>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_logger>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1134 <init_logger+0x14>
pop    %rcx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @init_logger(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 %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
ret i32* %2
}
void test_user_bp(void) {
  asm("nop");
  asm("nop");
  asm("nop");
  asm("nop");
}


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

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

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

LLVM IR (-O2):
define void @test_user_bp() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned long ulongval() { return (long)(sizeof(size_t)); }


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

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

LLVM IR (-O0):
define i64 @ulongval() {
ret i64 8
}

LLVM IR (-O2):
define i64 @ulongval() {
ret i64 8
}
/* Variables and functions */
bool dimensionesValidas(int num) { return ((num < 10) && (num >= 0)); }


x86 assembly (clang, -O0):
<dimensionesValidas>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1120 <dimensionesValidas+0x20>
cmpl   $0x0,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dimensionesValidas>:
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @dimensionesValidas(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int Cnd_Eq(void) {
  int v = ArgNum();
  return (GetFlag(v) == ArgNum());
}


x86 assembly (clang, -O0):
<Cnd_Eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_Eq>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgNum@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_Eq() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @Cnd_Eq() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = icmp eq i32 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double fa_inverse_error_func(int);
float fa_get_pdf_beta(float alpha) {
  float beta;
  beta = 1.41421356237 * fa_inverse_error_func(2. * alpha - 1);
  return beta;
}


x86 assembly (clang, -O0):
<fa_get_pdf_beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fa_inverse_error_func@plt>
movaps %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_get_pdf_beta>:
push   %rax
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fa_inverse_error_func@plt>
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fa_get_pdf_beta(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %5, double -1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call double @fa_inverse_error_func(i32 %7)
%9 = fmul double 0x3FF6A09E667F055A, %8
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @fa_get_pdf_beta(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double -1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @fa_inverse_error_func(i32 %4)
%6 = fmul double %5, 0x3FF6A09E667F055A
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void serial_closePort(int port) { close(port); }


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

x86 assembly (clang, -O2):
<serial_closePort>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @serial_closePort(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void EdgeCutter_LoadSettings(struct EdgeCutter_Settings *settings,
                             struct EdgeCutter_Params *params) {}


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

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

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

LLVM IR (-O2):
%struct.EdgeCutter_Settings = type opaque
%struct.EdgeCutter_Params = type opaque
define void @EdgeCutter_LoadSettings(%struct.EdgeCutter_Settings* nocapture %0, %struct.EdgeCutter_Params* nocapture %1) {
ret void
}
short int shortint_id(short int x) { return x; }


x86 assembly (clang, -O0):
<shortint_id>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @shortint_id(i16 returned signext %0) {
ret i16 %0
}
int m12mo_status_fac(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @m12mo_status_fac() {
ret i32 0
}

LLVM IR (-O2):
define i32 @m12mo_status_fac() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init_1(void) { printf("init array 1\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"init array 1\0A\00"
define void @init_1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"init array 1\00"
define void @init_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void _Unwind_GetRegionStart() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetRegionStart() {
ret void
}
void RTLinuxSysFsGetLinkDest(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsGetLinkDest() {
ret void
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_report_justified(struct event *, int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void event_report(struct event *e) { event_report_justified(e, 0, 0); }


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

x86 assembly (clang, -O2):
<event_report>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <event_report_justified@plt>

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

LLVM IR (-O2):
%struct.event = type { i32 }
define void @event_report(%struct.event* %0) {
%2 = tail call i32 @event_report_justified(%struct.event* %0, i32 0, i32 0)
ret void
}
int test_imm_49uint16_mem(unsigned short *val) {
  return ((*val) & (0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_49uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 73
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int testDeprecatedUsed() { return 0; }


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

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

LLVM IR (-O0):
define i32 @testDeprecatedUsed() {
ret i32 0
}

LLVM IR (-O2):
define i32 @testDeprecatedUsed() {
ret i32 0
}
float mapFloat(float x, float in_min, float in_max, float out_min,
               float out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<mapFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapFloat>:
subss  %xmm1,%xmm0
subss  %xmm3,%xmm4
mulss  %xmm4,%xmm0
subss  %xmm1,%xmm2
divss  %xmm2,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @mapFloat(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %10
%15 = load float, float* %9
%16 = fsub float %14, %15
%17 = fmul float %13, %16
%18 = load float, float* %8
%19 = load float, float* %7
%20 = fsub float %18, %19
%21 = fdiv float %17, %20
%22 = load float, float* %9
%23 = fadd float %21, %22
ret float %23
}

LLVM IR (-O2):
define float @mapFloat(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %1
%7 = fsub float %4, %3
%8 = fmul float %6, %7
%9 = fsub float %2, %1
%10 = fdiv float %8, %9
%11 = fadd float %10, %3
ret float %11
}
char *strcpydelim(char *dest, const char *src, char delim) {
  {};
  {};
  char c;
  while (((c = *src) != delim) && (c != '\0')) {
    *dest = c;
    ++dest;
    ++src;
  }
  *dest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpydelim>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl %al,%ecx
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x13(%rbp)
je     113b <strcpydelim+0x3b>
movsbl -0x12(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
test   $0x1,%al
jne    114b <strcpydelim+0x4b>
jmp    1171 <strcpydelim+0x71>
mov    -0x12(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strcpydelim+0x11>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpydelim>:
mov    %rdi,%rax
mov    (%rsi),%cl
cmp    %dl,%cl
je     1135 <strcpydelim+0x35>
test   %cl,%cl
je     1135 <strcpydelim+0x35>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
cmp    %dl,%cl
je     1135 <strcpydelim+0x35>
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpydelim+0x20>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpydelim(i8* writeonly %0, i8* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, %2
%6 = icmp ne i8 %4, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %3, %8
%9 = phi i8 [ %14, %8 ], [ %4, %3 ]
%10 = phi i8* [ %12, %8 ], [ %0, %3 ]
%11 = phi i8* [ %13, %8 ], [ %1, %3 ]
store i8 %9, i8* %10
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, %2
%16 = icmp ne i8 %14, 0
%17 = and i1 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
%19 = phi i8* [ %0, %3 ], [ %12, %8 ]
store i8 0, i8* %19
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
main() {
  fprintf(stderr, "Compile error: struct exec invalid\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Compile error: struct exec invalid\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Compile error: struct exec invalid\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgpushlit(int n) { ngen("%s\t$%d", "pushl", n); }


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

x86 assembly (clang, -O2):
<cgpushlit>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s\09$%d\00"
@.str.1 = [6 x i8] c"pushl\00"
define void @cgpushlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09$%d\00"
@.str.1 = [6 x i8] c"pushl\00"
define void @cgpushlit(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ HTTPWrapperIsAscii(int);
int HTTPWrapperToLower(int c) {
  if (HTTPWrapperIsAscii(c) > 0) {
    if (c >= 65 && c <= 90) {
      return (c + 32);
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<HTTPWrapperToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <HTTPWrapperIsAscii@plt>
cmp    $0x0,%rax
jle    1154 <HTTPWrapperToLower+0x44>
cmpl   $0x41,-0x8(%rbp)
jl     114f <HTTPWrapperToLower+0x3f>
cmpl   $0x5a,-0x8(%rbp)
jg     114f <HTTPWrapperToLower+0x3f>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <HTTPWrapperToLower+0x4a>
jmp    1154 <HTTPWrapperToLower+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTPWrapperToLower>:
push   %rbx
mov    %edi,%ebx
call   1030 <HTTPWrapperIsAscii@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmovle %ebx,%ecx
lea    -0x41(%rbx),%eax
cmp    $0x1a,%eax
cmovae %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HTTPWrapperToLower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @HTTPWrapperIsAscii(i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 65
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 90
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 32
store i32 %15, i32* %2
br label %19
16: ; preds = %10, %7
br label %17
17: ; preds = %16, %1
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @HTTPWrapperToLower(i32 %0) {
%2 = tail call i64 @HTTPWrapperIsAscii(i32 %0)
%3 = icmp sgt i64 %2, 0
%4 = add i32 %0, -65
%5 = icmp ult i32 %4, 26
%6 = and i1 %5, %3
%7 = add nsw i32 %0, 32
%8 = select i1 %6, i32 %7, i32 %0
ret i32 %8
}
int gcd(long int a, long int b) {
  if (a == 0)
    return b;
  if (b == 0)
    return a;
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <gcd+0x27>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1167 <gcd+0x57>
cmpq   $0x0,-0x18(%rbp)
jne    114e <gcd+0x3e>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1167 <gcd+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
test   %rdi,%rdi
je     1145 <gcd+0x45>
mov    %rdi,%rax
test   %rdx,%rdx
jne    112d <gcd+0x2d>
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %ecx,%eax
ret
mov    %rdx,%rcx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %8, %6 ], [ %0, %4 ]
%8 = phi i64 [ %9, %6 ], [ %1, %4 ]
%9 = srem i64 %7, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %4, %2
%12 = phi i64 [ %1, %2 ], [ %0, %4 ], [ %8, %6 ]
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ lprcat(char *);
void ignore() { lprcat("ignore\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"ignore\0A\00"
define void @ignore() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ignore\0A\00"
define void @ignore() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t xorWord(uint64_t wordA, uint64_t wordB) { return wordA ^ wordB; }


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

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

LLVM IR (-O0):
define i32 @xorWord(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @xorWord(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xa6() {
  Assert_real((ispunct(166) == 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_ispunct.c",
              835, ("ispunct should be 0 for 0xa6"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xa6>:
push   %rax
mov    $0xa6,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x343,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa6\00"
define void @t_ispunct_0xa6() {
%1 = call i64 @ispunct(i32 166)
%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 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa6\00"
define void @t_ispunct_0xa6() {
%1 = tail call i64 @ispunct(i32 166)
%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 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_fatal(char *);
int shutdown(int, int);
void Shutdown(int fd, int how) {
  int n;
  n = shutdown(fd, how);
  if (n != 0) {
    err_fatal("ERROR. shutdown() failed");
  }
  return;
}


x86 assembly (clang, -O0):
<Shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <Shutdown+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <err_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shutdown>:
push   %rax
call   1030 <shutdown@plt>
test   %eax,%eax
je     1137 <Shutdown+0x17>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <err_fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"ERROR. shutdown() failed\00"
define void @Shutdown(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* %4
%8 = call i32 @shutdown(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @err_fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"ERROR. shutdown() failed\00"
define void @Shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @err_fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           int const);
int teeint(FILE *fp, const char *s, const int i) {
  assert(NULL != fp);
  assert(NULL != s);
  fprintf(fp, "%s%d\n", s, i);
  return i;
}


x86 assembly (clang, -O0):
<teeint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teeint>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
lea    0xeb0(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1040 <fprintf@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s%d\0A\00"
define i32 @teeint(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = icmp ne i32* null, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = icmp ne i8* null, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %4
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%d\0A\00"
define i32 @teeint(i32* %0, i8* %1, i32 returned %2) {
%4 = icmp ne i32* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i8* %1, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret i32 %2
}
int test_imm_66int64_lowword_mem(long long *val) {
  return ((*val) & (0x66 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_66int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 102
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ EVP_PKEY_NONE;
int pkey_set_type(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *, int);
int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) {
  return pkey_set_type(pkey, EVP_PKEY_NONE, str, len);
}


x86 assembly (clang, -O0):
<EVP_PKEY_set_type_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <pkey_set_type@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set_type_str>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <pkey_set_type@plt>

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

LLVM IR (-O2):
@EVP_PKEY_NONE = global i32 0
define i32 @EVP_PKEY_set_type_str(i32* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @EVP_PKEY_NONE
%5 = tail call i32 @pkey_set_type(i32* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
void swap(int s[], int i, int j) {
  int temp;
  temp = s[i];
  s[i] = s[j];
  s[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}