xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int);
int main() {
  printf("\nits parent process.\n");
  if (fork() == 0) {
    printf("\ni am first child process.");
  }
  wait(3);
  if (fork() == 0)
    ;
  { printf("\ni am second child process.\n"); }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jne    1168 <main+0x38>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <wait@plt>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jne    1188 <main+0x58>
jmp    1188 <main+0x58>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jne    1165 <main+0x25>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <wait@plt>
xor    %eax,%eax
call   1060 <fork@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0Aits parent process.\0A\00"
@.str.1 = [27 x i8] c"\0Ai am first child process.\00"
@.str.2 = [29 x i8] c"\0Ai am second child process.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @wait(i32 3)
%9 = call i64 (...) @fork()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %12
12: ; preds = %11, %7
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"\0Ai am first child process.\00"
@str = [21 x i8] c"\0Aits parent process.\00"
@str.3 = [28 x i8] c"\0Ai am second child process.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @wait(i32 3)
%8 = tail call i64 (...) @fork()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int xmlUCSIsMiscellaneousSymbols(int code) {
  return (((code >= 0x2600) && (code <= 0x26FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMiscellaneousSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2600,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMiscellaneousSymbols+0x26>
cmpl   $0x26ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsMiscellaneousSymbols>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x2600,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMiscellaneousSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 9728
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9983
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 @xmlUCSIsMiscellaneousSymbols(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 9728
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_37uint16_reg(unsigned short val) {
  return ((val) & (-0x37 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_37uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffc9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_37uint16_reg>:
test   $0xffc9,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_37uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -55
%6 = icmp ne i32 %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_37uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -55
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ctk_dialog_open() {}


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

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

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

LLVM IR (-O2):
define void @ctk_dialog_open() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void trader_mduser_client_test_connect_callback(void *user_data) {
  printf("connected!\n");
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"connected!\0A\00"
define void @trader_mduser_client_test_connect_callback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"connected!\00"
define void @trader_mduser_client_test_connect_callback(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
signed char is_numeric(char *str) {
  while (*str) {
    if (!isdigit(*str))
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <is_numeric+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1147 <is_numeric+0x37>
movb   $0x0,-0x1(%rbp)
jmp    115c <is_numeric+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_numeric+0xc>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%bpl
test   %al,%al
je     114b <is_numeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_numeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_numeric+0x20>
jmp    114b <is_numeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @is_numeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i8 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ notImplementedEpson();
void PrtFrameG() { notImplementedEpson(); }


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

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

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

LLVM IR (-O2):
define void @PrtFrameG() {
%1 = tail call i32 (...) @notImplementedEpson()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_cancel_write() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_cancel_write"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_stream_cancel_write\0A\00"
define i32 @pa_stream_cancel_write() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_stream_cancel_write\00"
define i32 @pa_stream_cancel_write() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
size_t ft_nbrlen(int n) {
  size_t len;
  len = 1;
  if (n < 0) {
    n = -n;
    ++len;
  }
  while (n > 9) {
    ++len;
    n /= 10;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <ft_nbrlen+0x2d>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <ft_nbrlen+0x32>
cmpl   $0x9,-0x4(%rbp)
jle    115b <ft_nbrlen+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_nbrlen+0x32>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
add    $0x1,%rax
cmp    $0xa,%ecx
jb     1135 <ft_nbrlen+0x35>
mov    $0xcccccccd,%edx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <ft_nbrlen+0x20>
ret

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

LLVM IR (-O2):
define i64 @ft_nbrlen(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = select i1 %2, i64 2, i64 1
%6 = icmp ugt i32 %4, 9
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i64 [ %10, %7 ], [ %5, %1 ]
%9 = phi i32 [ %11, %7 ], [ %4, %1 ]
%10 = add i64 %8, 1
%11 = udiv i32 %9, 10
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %1
%14 = phi i64 [ %5, %1 ], [ %10, %7 ]
ret i64 %14
}
float vlength(const float *v) {
  double return_value_sqrt$1;
  return_value_sqrt$1 =
      sqrt((double)(v[(signed long int)0] * v[(signed long int)0] +
                    v[(signed long int)1] * v[(signed long int)1] +
                    v[(signed long int)2] * v[(signed long int)2]));
  return (float)return_value_sqrt$1;
}


x86 assembly (clang, -O0):
<vlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <vlength+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vlength(float* %0) {
%2 = alloca float*
%3 = alloca double
store float* %0, float** %2
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 0
%6 = load float, float* %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = fmul float %12, %15
%17 = call float @llvm.fmuladd.f32(float %6, float %9, float %16)
%18 = load float*, float** %2
%19 = getelementptr inbounds float, float* %18, i64 2
%20 = load float, float* %19
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = call float @llvm.fmuladd.f32(float %20, float %23, float %17)
%25 = fpext float %24 to double
%26 = call double @sqrt(double %25)
store double %26, double* %3
%27 = load double, double* %3
%28 = fptrunc double %27 to float
ret float %28
}

LLVM IR (-O2):
define float @vlength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrtf(float %9)
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ Label_Printf(char *, char *);
void Label(char *label) {
  Label_Printf("\n"
               "_"
               "%s:",
               label);
}


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

x86 assembly (clang, -O2):
<Label>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <Label_Printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A_%s:\00"
define void @Label(i8* %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ port_92_readb(int /*<<< orphan*/, void *);
uint16_t port_92_readw(uint16_t port, void *priv) {
  return port_92_readb(port, priv);
}


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

x86 assembly (clang, -O2):
<port_92_readw>:
jmp    1030 <port_92_readb@plt>

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

LLVM IR (-O2):
define i32 @port_92_readw(i32 %0, i8* %1) {
%3 = tail call i32 @port_92_readb(i32 %0, i8* %1)
ret i32 %3
}
double mean(double *times) {
  int i;
  double sum = 0.0;
  for (i = 0; i < 5; i++)
    sum += times[i];
  return sum / 5;
}


x86 assembly (clang, -O0):
<mean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1146 <mean+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <mean+0x17>
movsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean>:
xorpd  %xmm0,%xmm0
addsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
addsd  0x18(%rdi),%xmm0
addsd  0x20(%rdi),%xmm0
divsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mean(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load double*, double** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fadd double %14, %13
store double %15, double* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load double, double* %4
%21 = fdiv double %20, 5.000000e+00
ret double %21
}

LLVM IR (-O2):
define double @mean(double* nocapture %0) {
%2 = load double, double* %0
%3 = fadd double %2, 0.000000e+00
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fadd double %3, %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = getelementptr inbounds double, double* %0, i64 4
%14 = load double, double* %13
%15 = fadd double %12, %14
%16 = fdiv double %15, 5.000000e+00
ret double %16
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfcomp(long double a, long double b) {
  if (_U_Qfcmp(a, b, 4) == 0)
    return 0;
  return (_U_Qfcmp(a, b, 22) != 0 ? 1 : -1);
}


x86 assembly (clang, -O0):
<_U_Qfcomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x4,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
jne    1152 <_U_Qfcomp+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1181 <_U_Qfcomp+0x71>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x16,%edi
call   1030 <_U_Qfcmp@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfcomp>:
sub    $0x38,%rsp
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fld    %st(1)
fstpt  0x20(%rsp)
fxch   %st(1)
fstpt  0x10(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
mov    $0x4,%edi
call   1030 <_U_Qfcmp@plt>
test   %rax,%rax
je     1167 <_U_Qfcomp+0x57>
fldt   0x20(%rsp)
fstpt  0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
mov    $0x16,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x1,%eax
add    $0x38,%rsp
ret
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfcomp(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca i32
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %4
%7 = load x86_fp80, x86_fp80* %5
%8 = call i64 @_U_Qfcmp(x86_fp80 %6, x86_fp80 %7, i32 4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %18
11: ; preds = %2
%12 = load x86_fp80, x86_fp80* %4
%13 = load x86_fp80, x86_fp80* %5
%14 = call i64 @_U_Qfcmp(x86_fp80 %12, x86_fp80 %13, i32 22)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 -1
store i32 %17, i32* %3
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @_U_Qfcomp(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 4)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 22)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 -1, i32 1
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int do_test(void) {
  int cnt;
  mtrace();
  for (cnt = 0; cnt < 100; ++cnt) {
    setlocale(LC_ALL, "de_DE.ISO-8859-1");
    setlocale(LC_ALL, "de_DE.UTF-8");
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <mtrace@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1178 <do_test+0x58>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <setlocale@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <do_test+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <mtrace@plt>
mov    $0x64,%ebp
mov    0x2ea6(%rip),%rbx
lea    0xebf(%rip),%r14
lea    0xec9(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <setlocale@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <setlocale@plt>
add    $0xffffffff,%ebp
jne    1150 <do_test+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [17 x i8] c"de_DE.ISO-8859-1\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @do_test() {
%1 = alloca i32
%2 = call i32 (...) @mtrace()
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* @LC_ALL
%8 = call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @LC_ALL
%10 = call i32 @setlocale(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [17 x i8] c"de_DE.ISO-8859-1\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @do_test() {
%1 = tail call i32 (...) @mtrace()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = load i32, i32* @LC_ALL
%5 = tail call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @LC_ALL
%7 = tail call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ read_u32b(int /*<<< orphan*/ *);
int /*<<< orphan*/ read_u32l(int /*<<< orphan*/ *);
u_int read_u32(FILE *fp, int e) {
  return (e & 1) ? read_u32b(fp) : read_u32l(fp);
}


x86 assembly (clang, -O0):
<read_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <read_u32+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <read_u32b@plt>
mov    %eax,-0x10(%rbp)
jmp    115b <read_u32+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <read_u32l@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u32>:
test   $0x1,%sil
jne    112b <read_u32+0xb>
jmp    1040 <read_u32l@plt>
jmp    1030 <read_u32b@plt>

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

LLVM IR (-O2):
define i32 @read_u32(i32* %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @read_u32b(i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @read_u32l(i32* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
int do_956() { return 956; }


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

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

LLVM IR (-O0):
define i32 @do_956() {
ret i32 956
}

LLVM IR (-O2):
define i32 @do_956() {
ret i32 956
}
void show_2() { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.show_2 = [7 x i8] c"show_2\00"
define void @show_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.show_2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_adbd();
int /*<<< orphan*/ stop_adbd();
void restart_adbd(void) {
  stop_adbd();
  start_adbd();
}


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

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

LLVM IR (-O0):
define void @restart_adbd() {
%1 = call i32 (...) @stop_adbd()
%2 = call i32 (...) @start_adbd()
ret void
}

LLVM IR (-O2):
define void @restart_adbd() {
%1 = tail call i32 (...) @stop_adbd()
%2 = tail call i32 (...) @start_adbd()
ret void
}
/* Variables and functions */
int consume_byte(int);
scalar_t__ in_set(int, char *);
int preserve_symbol(int c) {
  while (in_set(c, "<=>|&!-")) {
    c = consume_byte(c);
  }
  return c;
}


x86 assembly (clang, -O0):
<preserve_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <in_set@plt>
cmp    $0x0,%rax
je     1154 <preserve_symbol+0x34>
mov    -0x4(%rbp),%edi
call   1030 <consume_byte@plt>
mov    %eax,-0x4(%rbp)
jmp    112b <preserve_symbol+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preserve_symbol>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%rsi
call   1040 <in_set@plt>
test   %rax,%rax
je     1158 <preserve_symbol+0x38>
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <consume_byte@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <in_set@plt>
test   %rax,%rax
jne    1140 <preserve_symbol+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"<=>|&!-\00"
define i32 @preserve_symbol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = call i64 @in_set(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @consume_byte(i32 %8)
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"<=>|&!-\00"
define i32 @preserve_symbol(i32 %0) {
%2 = tail call i64 @in_set(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = tail call i32 @consume_byte(i32 %5)
%7 = tail call i64 @in_set(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ __llvm_profile_register_write_file_atexit();
int /*<<< orphan*/ __llvm_profile_set_filename(char const *);
int main(int argc, const char *argv[]) {
  __llvm_profile_register_write_file_atexit();
  if (argc < 2)
    return 1;
  __llvm_profile_set_filename(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <__llvm_profile_register_write_file_atexit@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1153 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1167 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <__llvm_profile_set_filename@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <__llvm_profile_register_write_file_atexit@plt>
mov    $0x1,%eax
cmp    $0x2,%ebp
jl     1144 <main+0x24>
mov    0x8(%rbx),%rdi
call   1030 <__llvm_profile_set_filename@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @__llvm_profile_register_write_file_atexit()
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @__llvm_profile_set_filename(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @__llvm_profile_register_write_file_atexit()
%4 = icmp slt i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @__llvm_profile_set_filename(i8* %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void setgpio(int fd, int val) {
  char buf[10];
  lseek(fd, 0, SEEK_SET);
  if (val == 1)
    write(fd, "1", 1);
  else
    write(fd, "0", 1);
}


x86 assembly (clang, -O0):
<setgpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1164 <setgpio+0x44>
mov    -0x4(%rbp),%edi
lea    0xeab(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1178 <setgpio+0x58>
mov    -0x4(%rbp),%edi
lea    0xe94(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgpio>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0x1,%ebx
lea    0xebf(%rip),%rax
lea    0xeba(%rip),%rsi
cmove  %rax,%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @setgpio(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 0, i32 %3)
%5 = icmp eq i32 %1, 1
%6 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @write(i32 %0, i8* %6, i32 1)
ret void
}
/* Variables and functions */
char SPI_Read(int);
void SPI_Read_Bytes(char *buffer, unsigned NoBytes) {
  int i;
  for (i = 0; i < NoBytes; i++)
    buffer[i] = SPI_Read(0xFF);
}


x86 assembly (clang, -O0):
<SPI_Read_Bytes>:
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
jae    1157 <SPI_Read_Bytes+0x47>
mov    $0xff,%edi
call   1030 <SPI_Read@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <SPI_Read_Bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_Read_Bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <SPI_Read_Bytes+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xff,%edi
call   1030 <SPI_Read@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SPI_Read_Bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @SPI_Read_Bytes(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 = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call signext i8 @SPI_Read(i32 255)
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @SPI_Read_Bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call signext i8 @SPI_Read(i32 255)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
double test_exp(double x) { return __builtin_exp(x); }


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

x86 assembly (clang, -O2):
<test_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @test_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int f192(int *);
int f193(int *p) { return f192(p); }


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

x86 assembly (clang, -O2):
<f193>:
jmp    1030 <f192@plt>

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

LLVM IR (-O2):
define i32 @f193(i32* %0) {
%2 = tail call i32 @f192(i32* %0)
ret i32 %2
}
/* Variables and functions */
int recurse1(int);
int recurese1(int i) { return recurse1(i + 1); }


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

x86 assembly (clang, -O2):
<recurese1>:
add    $0x1,%edi
jmp    1030 <recurse1@plt>

LLVM IR (-O0):
define i32 @recurese1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @recurse1(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @recurese1(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @recurse1(i32 %2)
ret i32 %3
}
void gtk_text_buffer_get_iter_at_line_index() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
FILE *safe_fopen(const char *path, const char *mode) {
  FILE *file = NULL;
  file = fopen(path, mode);
  if (file == NULL) {
    printf("Could not open file: %s\n", path);
    return NULL;
  }
  return file;
}


x86 assembly (clang, -O0):
<safe_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1171 <safe_fopen+0x51>
mov    -0x10(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1179 <safe_fopen+0x59>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <safe_fopen+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Could not open file: %s\0A\00"
define noalias i32* @safe_fopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %2, %5
ret i32* %3
}
/* Variables and functions */
char *getenv(char const *);
char *wet_getenv(const char *key) {
  char *value;
  value = getenv(key);
  return value;
}


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

x86 assembly (clang, -O2):
<wet_getenv>:
jmp    1030 <getenv@plt>

LLVM IR (-O0):
define i8* @wet_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @wet_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
void BIO_method_name(void) {}


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

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

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

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

/* Variables and functions */
int read(int, unsigned int *, int);
ssize_t read_int4(int f, int *i) {
  unsigned int n;
  if (read(f, &n, 4) == 4) {
    *i = ((n & 0xff000000) >> 24 | (n & 0x00ff0000) >> 8 |
          (n & 0x0000ff00) << 8 | (n & 0x000000ff) << 24);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<read_int4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmp    $0x4,%eax
jne    117e <read_int4+0x6e>
mov    -0x14(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
mov    -0x14(%rbp),%eax
and    $0xff0000,%eax
shr    $0x8,%eax
or     %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1185 <read_int4+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int4>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
jne    113d <read_int4+0x2d>
mov    0xc(%rsp),%eax
bswap  %eax
mov    %eax,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_int4(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = call i32 @read(i32 %7, i32* %6, i32 4)
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %27
10: ; preds = %2
%11 = load i32, i32* %6
%12 = and i32 %11, -16777216
%13 = lshr i32 %12, 24
%14 = load i32, i32* %6
%15 = and i32 %14, 16711680
%16 = lshr i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %6
%19 = and i32 %18, 65280
%20 = shl i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %6
%23 = and i32 %22, 255
%24 = shl i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32*, i32** %5
store i32 %25, i32* %26
store i32 1, i32* %3
br label %28
27: ; preds = %2
store i32 0, i32* %3
br label %28
28: ; preds = %27, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @read_int4(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @read(i32 %0, i32* %3, i32 4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @llvm.bswap.i32(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int int_in_array(int n, const int a[], size_t size) {
  unsigned int i = 0;
  while (i < size) {
    if (n == a[i]) {
      return i;
    }
    ++i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<int_in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    114f <int_in_array+0x4f>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
cmp    (%rcx,%rdx,4),%eax
jne    1141 <int_in_array+0x41>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <int_in_array+0x56>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <int_in_array+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_in_array>:
mov    $0xffffffff,%eax
test   %rdx,%rdx
je     111d <int_in_array+0x1d>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    %edi,(%rsi,%rcx,4)
je     111e <int_in_array+0x1e>
add    $0x1,%ecx
cmp    %rdx,%rcx
jb     1110 <int_in_array+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_in_array(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = zext i32 %10 to i64
%12 = load i64, i64* %7
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = load i32, i32* %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %8
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %15, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %28
24: ; preds = %14
%25 = load i32, i32* %8
%26 = add i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @int_in_array(i32 %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %10
%6 = phi i64 [ %12, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = add nuw nsw i64 %6, 1
%12 = and i64 %11, 4294967295
%13 = icmp ult i64 %12, %2
br i1 %13, label %5, label %16
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %10, %14, %3
%17 = phi i32 [ -1, %3 ], [ %15, %14 ], [ -1, %10 ]
ret i32 %17
}