xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void quote_calc2_error(const char *s) { fprintf(stderr, "%s\n", s); }


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

x86 assembly (clang, -O2):
<quote_calc2_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @quote_calc2_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double apow(double a, double b) {
  int tmp = (*(1 + (int *)&a));
  int tmp2 = (int)(b * (tmp - 1072632447) + 1072632447);
  double p = 0.0;
  *(1 + (int *)&p) = tmp2;
  return p;
}


x86 assembly (clang, -O0):
<apow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
sub    $0x3fef127f,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<apow>:
movq   %xmm0,%rax
shr    $0x20,%rax
add    $0xc010ed81,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%eax
shl    $0x20,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
define double @apow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = bitcast double* %3 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load double, double* %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1072632447
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double %11, double %14, double 0x41CFF7893F800000)
%16 = fptosi double %15 to i32
store i32 %16, i32* %6
store double 0.000000e+00, double* %7
%17 = load i32, i32* %6
%18 = bitcast double* %7 to i32*
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load double, double* %7
ret double %20
}

LLVM IR (-O2):
define double @apow(double %0, double %1) {
%3 = bitcast double %0 to i64
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1072632447
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %1, double %7, double 0x41CFF7893F800000)
%9 = fptosi double %8 to i32
%10 = zext i32 %9 to i64
%11 = shl nuw i64 %10, 32
%12 = bitcast i64 %11 to double
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ indirect2(char *);
void indirect1(char c[]) { indirect2(c); }


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

x86 assembly (clang, -O2):
<indirect1>:
jmp    1030 <indirect2@plt>

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

LLVM IR (-O2):
define void @indirect1(i8* %0) {
%2 = tail call i32 @indirect2(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gpioIntClear(int, int);
scalar_t__ gpioIntStatus(int, int);
void PIOINT2_IRQHandler(void) {
  uint32_t regVal;
  regVal = gpioIntStatus(2, 1);
  if (regVal) {
    gpioIntClear(2, 1);
  }
  return;
}


x86 assembly (clang, -O0):
<PIOINT2_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <gpioIntStatus@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <PIOINT2_IRQHandler+0x35>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <gpioIntClear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIOINT2_IRQHandler>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <gpioIntStatus@plt>
test   %rax,%rax
je     1145 <PIOINT2_IRQHandler+0x25>
mov    $0x2,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <gpioIntClear@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @PIOINT2_IRQHandler() {
%1 = alloca i64
%2 = call i64 @gpioIntStatus(i32 2, i32 1)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @gpioIntClear(i32 2, i32 1)
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @PIOINT2_IRQHandler() {
%1 = tail call i64 @gpioIntStatus(i32 2, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @gpioIntClear(i32 2, i32 1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: scc sourcfile [options]\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
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 = [32 x i8] c"usage: scc sourcfile [options]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: scc sourcfile [options]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello ARM World!"
         "\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Hello ARM World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float cblas_sdot(int const, float const *, int const, float const *, int const);
float c_sdot(const int N, const float *X, const int strideX, const float *Y,
             const int strideY) {
  return cblas_sdot(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_sdot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_sdot@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sdot>:
jmp    1030 <cblas_sdot@plt>

LLVM IR (-O0):
define float @c_sdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store float* %1, float** %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load float*, float** %7
%13 = load i32, i32* %8
%14 = load float*, float** %9
%15 = load i32, i32* %10
%16 = call float @cblas_sdot(i32 %11, float* %12, i32 %13, float* %14, i32 %15)
ret float %16
}

LLVM IR (-O2):
define float @c_sdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = tail call float @cblas_sdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(char **strs, int num) {
  int i;
  for (i = 0; i < num; i++)
    printf("%s ", strs[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_array+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *getLineString(char *buffer, char *str) {
  sprintf(buffer, "%-12.12s", str);
  return buffer;
}


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

x86 assembly (clang, -O2):
<getLineString>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%-12.12s\00"
define i8* @getLineString(i8* returned writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* %0
}
/* Type definitions */
struct READ_REQ {
  int dummy;
};

/* Variables and functions */
struct READ_REQ *generate_read_request(char, int, int);
struct READ_REQ *generate_scan_request(char address) {
  return generate_read_request(address, 0x17, 0x02);
}


x86 assembly (clang, -O0):
<generate_scan_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x17,%esi
mov    $0x2,%edx
movsbl -0x1(%rbp),%edi
call   1030 <generate_read_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_scan_request>:
mov    $0x17,%esi
mov    $0x2,%edx
jmp    1030 <generate_read_request@plt>

LLVM IR (-O0):
%struct.READ_REQ = type { i32 }
define %struct.READ_REQ* @generate_scan_request(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call %struct.READ_REQ* @generate_read_request(i8 signext %3, i32 23, i32 2)
ret %struct.READ_REQ* %4
}

LLVM IR (-O2):
%struct.READ_REQ = type { i32 }
define %struct.READ_REQ* @generate_scan_request(i8 signext %0) {
%2 = tail call %struct.READ_REQ* @generate_read_request(i8 signext %0, i32 23, i32 2)
ret %struct.READ_REQ* %2
}
/* Variables and functions */
size_t start(size_t addition) {
  return addition == 0 ? 2 : addition == 1 ? 0 : 1;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <start+0x20>
mov    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <start+0x35>
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%rdx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
xor    %ecx,%ecx
cmp    $0x1,%rdi
setne  %cl
test   %rdi,%rdi
mov    $0x2,%eax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @start(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = icmp ne i64 %0, 1
%4 = zext i1 %3 to i64
%5 = select i1 %2, i64 2, i64 %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ CyEEPROM_Stop();
void CFG_EEPROM_Stop(void) { CyEEPROM_Stop(); }


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

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

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

LLVM IR (-O2):
define void @CFG_EEPROM_Stop() {
%1 = tail call i32 (...) @CyEEPROM_Stop()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void Under2Space(char *p) {
  for (p = strchr(p, '_'); p; p = strchr(p, '_'))
    *(p++) = ' ';
}


x86 assembly (clang, -O0):
<Under2Space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <Under2Space+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x5f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
jmp    112e <Under2Space+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Under2Space>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x5f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <Under2Space+0x2b>
movb   $0x20,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1120 <Under2Space+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @Under2Space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strchr(i8* %3, i8 signext 95)
store i8* %4, i8** %2
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
store i8 32, i8* %9
br label %11
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = call i8* @strchr(i8* %12, i8 signext 95)
store i8* %13, i8** %2
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Under2Space(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 95)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 32, i8* %5
%7 = tail call i8* @strchr(i8* %6, i8 signext 95)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("Writing to pipe ! and env = %s \n", envp[0]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rdx),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Writing to pipe ! and env = %s \0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %7
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Writing to pipe ! and env = %s \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
struct fnode {
  int dummy;
};

/* Variables and functions */
int fatfs_seek(struct fnode *, int, int);
int vfs_seek(struct fnode *fno, int off, int whence) {
  return fatfs_seek(fno, off, whence);
}


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

x86 assembly (clang, -O2):
<vfs_seek>:
jmp    1030 <fatfs_seek@plt>

LLVM IR (-O0):
%struct.fnode = type { i32 }
define i32 @vfs_seek(%struct.fnode* %0, i32 %1, i32 %2) {
%4 = alloca %struct.fnode*
%5 = alloca i32
%6 = alloca i32
store %struct.fnode* %0, %struct.fnode** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.fnode*, %struct.fnode** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fatfs_seek(%struct.fnode* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fnode = type { i32 }
define i32 @vfs_seek(%struct.fnode* %0, i32 %1, i32 %2) {
%4 = tail call i32 @fatfs_seek(%struct.fnode* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createTanExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0003);
}


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

x86 assembly (clang, -O2):
<createTanExpression>:
mov    $0x3,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createTanExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 3)
ret %struct.memorycontainer* %2
}
signed long long dynref__next(const struct dynref__iter *i) {}


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

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

LLVM IR (-O0):
%struct.dynref__iter = type opaque
define i64 @dynref__next(%struct.dynref__iter* %0) {
%2 = alloca i64
%3 = alloca %struct.dynref__iter*
store %struct.dynref__iter* %0, %struct.dynref__iter** %3
%4 = load i64, i64* %2
ret i64 %4
}

LLVM IR (-O2):
%struct.dynref__iter = type opaque
define i64 @dynref__next(%struct.dynref__iter* nocapture readnone %0) {
ret i64 undef
}
/* Variables and functions */
bool suspend_wakeup_condition(void) { return true; }


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

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

LLVM IR (-O0):
define i32 @suspend_wakeup_condition() {
ret i32 1
}

LLVM IR (-O2):
define i32 @suspend_wakeup_condition() {
ret i32 1
}
void TestA() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TestA+0x9>
jmp    1109 <TestA+0x9>

x86 assembly (clang, -O2):
<TestA>:
jmp    1100 <TestA>

LLVM IR (-O0):
define void @TestA() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @TestA() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void alarm_handler(int signo) {
  fprintf(stderr,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/jtimberman/omnibus/refs/heads/development/"
          "dependencies/otp/17.1/erts/test/erlexec_SUITE_data/erlexec_tests.c"
          " self terminating after timeout\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<alarm_handler>:
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 = [231 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jtimberman/omnibus/refs/heads/development/dependencies/otp/17.1/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [231 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jtimberman/omnibus/refs/heads/development/dependencies/otp/17.1/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int IntNoise(float);
float Smooth1DNoise(float x) {
  return IntNoise(x) / 2 + IntNoise(x - 1) / 4 + IntNoise(x + 1) / 4;
}


x86 assembly (clang, -O0):
<Smooth1DNoise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <IntNoise@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec1(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <IntNoise@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movss  0xe9e(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <IntNoise@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Smooth1DNoise>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <IntNoise@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
movss  0xed1(%rip),%xmm0
addss  0x4(%rsp),%xmm0
call   1030 <IntNoise@plt>
lea    0x3(%rax),%ebp
test   %eax,%eax
cmovns %eax,%ebp
sar    $0x2,%ebp
add    %ebx,%ebp
movss  0x4(%rsp),%xmm0
addss  0xeaf(%rip),%xmm0
call   1030 <IntNoise@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
add    %ebp,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @Smooth1DNoise(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @IntNoise(float %3)
%5 = sdiv i32 %4, 2
%6 = load float, float* %2
%7 = fsub float %6, 1.000000e+00
%8 = call i32 @IntNoise(float %7)
%9 = sdiv i32 %8, 4
%10 = add nsw i32 %5, %9
%11 = load float, float* %2
%12 = fadd float %11, 1.000000e+00
%13 = call i32 @IntNoise(float %12)
%14 = sdiv i32 %13, 4
%15 = add nsw i32 %10, %14
%16 = sitofp i32 %15 to float
ret float %16
}

LLVM IR (-O2):
define float @Smooth1DNoise(float %0) {
%2 = tail call i32 @IntNoise(float %0)
%3 = sdiv i32 %2, 2
%4 = fadd float %0, -1.000000e+00
%5 = tail call i32 @IntNoise(float %4)
%6 = sdiv i32 %5, 4
%7 = add nsw i32 %6, %3
%8 = fadd float %0, 1.000000e+00
%9 = tail call i32 @IntNoise(float %8)
%10 = sdiv i32 %9, 4
%11 = add nsw i32 %7, %10
%12 = sitofp i32 %11 to float
ret float %12
}
double d2r(double angleInDegrees) {
  return angleInDegrees * 3.14159265358979323846 / 180;
}


x86 assembly (clang, -O0):
<d2r>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2r>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @d2r(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @d2r(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
int gdt_compare_long(const void *p1, const void *p2) {
  long n1 = *((long *)p1);
  long n2 = *((long *)p2);
  if (n1 < n2) {
    return -1;
  } else if (n1 > n2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <gdt_compare_long+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <gdt_compare_long+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <gdt_compare_long+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <gdt_compare_long+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_long>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gdt_compare_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharRM(void) { printf("\x01B(0\x075\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0u\1B(B\00"
define void @putLDCharRM() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_9fx_available(void) { return rom_present(L"roms/video/s3/s3_764.bin"); }


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

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

LLVM IR (-O0):
@.str = [25 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 115, i32 51, i32 95, i32 55, i32 54, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @s3_9fx_available() {
%1 = call i32 @rom_present(i8* bitcast ([25 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [25 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 115, i32 51, i32 95, i32 55, i32 54, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @s3_9fx_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([25 x i32]* @.str to i8*))
ret i32 %1
}
int f() {
  int *p;
  return *p;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int waitpid(int, int *, int);
pid_t safewaitpid(pid_t pid, int *status, int options) {
  pid_t ret;
  do {
    ret = waitpid(pid, status, options);
  } while (ret == -1 && errno == EINTR);
  return (ret);
}


x86 assembly (clang, -O0):
<safewaitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <waitpid@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    115d <safewaitpid+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <safewaitpid+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safewaitpid>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    114b <safewaitpid+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <safewaitpid+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @safewaitpid(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
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @waitpid(i32 %9, i32* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @safewaitpid(i32 %0, i32* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
unsigned char protoW_setTime(unsigned char *, unsigned short *,
                             unsigned char *);
unsigned char protoR_radioReadId(unsigned char *buf, unsigned short *bufSize) {
  unsigned char gatewayId[6] = {0};
  return protoW_setTime(buf, bufSize, gatewayId);
}


x86 assembly (clang, -O0):
<protoR_radioReadId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x16(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x16(%rbp),%rdx
call   1040 <protoW_setTime@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoR_radioReadId>:
push   %rax
movw   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rdx
call   1030 <protoW_setTime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @protoR_radioReadId(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca [6 x i8]
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = bitcast [6 x i8]* %5 to i8*
%7 = load i8*, i8** %3
%8 = load i16*, i16** %4
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%10 = call zeroext i8 @protoW_setTime(i8* %7, i16* %8, i8* %9)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @protoR_radioReadId(i8* %0, i16* %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call zeroext i8 @protoW_setTime(i8* %0, i16* %1, i8* %4)
ret i8 %5
}
long vmax(long a, long b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<vmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <vmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <vmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @vmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int ide_do_packet_command_pio(char *, char *, int);
int ide_sense_error(char *buf) {
  char cmd[12] = {0x13, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0};
  return ide_do_packet_command_pio(cmd, buf, 10);
}


x86 assembly (clang, -O0):
<ide_sense_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_sense_error>:
sub    $0x18,%rsp
mov    %rdi,%rsi
movabs $0xa00000013,%rax
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0xa,%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ide_sense_error.cmd = [12 x i8] c"\13\00\00\00\0A\00\00\00\00\00\00\00"
define i32 @ide_sense_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [12 x i8]
store i8* %0, i8** %2
%4 = bitcast [12 x i8]* %3 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @ide_do_packet_command_pio(i8* %5, i8* %6, i32 10)
ret i32 %7
}

LLVM IR (-O2):
@__const.ide_sense_error.cmd = [12 x i8] c"\13\00\00\00\0A\00\00\00\00\00\00\00"
define i32 @ide_sense_error(i8* %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @ide_do_packet_command_pio(i8* %3, i8* %0, i32 10)
ret i32 %4
}
/* Variables and functions */
int rewind_window_end_to_last_snp_with_start_end_index(int, int *, char *, int,
                                                       int /*<<< orphan*/, int);
int rewind_window_end_to_last_snp(int window_end_coordinate, int *snp_locations,
                                  char *child_sequence,
                                  int number_of_branch_snps) {
  return rewind_window_end_to_last_snp_with_start_end_index(
      window_end_coordinate, snp_locations, child_sequence,
      number_of_branch_snps, 0, number_of_branch_snps);
}


x86 assembly (clang, -O0):
<rewind_window_end_to_last_snp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%r9d
xor    %r8d,%r8d
call   1030 <rewind_window_end_to_last_snp_with_start_end_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind_window_end_to_last_snp>:
xor    %r8d,%r8d
mov    %ecx,%r9d
jmp    1030 <rewind_window_end_to_last_snp_with_start_end_index@plt>

LLVM IR (-O0):
define i32 @rewind_window_end_to_last_snp(i32 %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = load i32, i32* %8
%14 = call i32 @rewind_window_end_to_last_snp_with_start_end_index(i32 %9, i32* %10, i8* %11, i32 %12, i32 0, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @rewind_window_end_to_last_snp(i32 %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @rewind_window_end_to_last_snp_with_start_end_index(i32 %0, i32* %1, i8* %2, i32 %3, i32 0, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void int16Copy(int16_t *dst, const int16_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<int16Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @int16Copy(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 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @int16Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
int min(int a, int b) {
  if (a > b) {
    return b;
  } else {
    return a;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int delete_script(int pi, unsigned script_id) {
  return pigpio_command(pi, 39, script_id, 0, 1);
}


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

x86 assembly (clang, -O2):
<delete_script>:
mov    %esi,%edx
mov    $0x27,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @delete_script(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 @pigpio_command(i32 %5, i32 39, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @delete_script(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 39, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperDisable(void) {
  (*((volatile uint32_t *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC400))) &= ~0x00000001;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc360,%eax
movl   $0xa3359554,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc400,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x400fc400,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperDisable>:
push   %rax
movl   $0xa3359554,0x400fc360
54 95 35 a3
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
andl   $0xfffffffe,0x400fc400
fe
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movl   $0x0,0x400fc360
xor    %eax,%eax
pop    %rcx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperDisable() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = and i32 %2, -2
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
%4 = call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperDisable() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775040 to i32*)
%3 = and i32 %2, -2
store volatile i32 %3, i32* inttoptr (i64 1074775040 to i32*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int rand_r(unsigned int *);
unsigned long long __get_random_byte(unsigned *ctx) {
  return (unsigned long long)(rand_r(ctx) % 256);
}


x86 assembly (clang, -O0):
<__get_random_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_random_byte>:
push   %rax
call   1030 <rand_r@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__get_random_byte(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @rand_r(i32* %3)
%5 = srem i32 %4, 256
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @__get_random_byte(i32* %0) {
%2 = tail call i32 @rand_r(i32* %0)
%3 = srem i32 %2, 256
%4 = sext i32 %3 to i64
ret i64 %4
}