xunge/DecIR huggingface dataset:
/* Variables and functions */
int getpid();
int pthread_self();
void getProcessAndThreadId(int *const pid, int *const tid) {
  *pid = getpid();
  *tid = pthread_self();
}


x86 assembly (clang, -O0):
<getProcessAndThreadId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProcessAndThreadId>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @getProcessAndThreadId(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @getpid()
store i32 %3, i32* %0
%4 = tail call i32 (...) @pthread_self()
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ransacF(double *, int, double, double, int, double *,
                           int /*<<< orphan*/, int *, int, int);
void ransacFsimple(double *u, int len, double th, double *F) {
  int data_out[3];
  ransacF(u, len, th, 0.95, 1000000, F, 0, data_out, 1, 49);
}


x86 assembly (clang, -O0):
<ransacFsimple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rcx
lea    -0x2c(%rbp),%r9
movsd  0xebc(%rip),%xmm1
mov    $0xf4240,%edx
xor    %r8d,%r8d
movl   $0x1,(%rsp)
movl   $0x31,0x8(%rsp)
call   1030 <ransacF@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ransacFsimple>:
sub    $0x18,%rsp
mov    %rdx,%rcx
movsd  0xee1(%rip),%xmm1
lea    0xc(%rsp),%r9
mov    $0xf4240,%edx
xor    %r8d,%r8d
push   $0x31
push   $0x1
call   1030 <ransacF@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @ransacFsimple(double* %0, i32 %1, double %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca [3 x i32]
store double* %0, double** %5
store i32 %1, i32* %6
store double %2, double* %7
store double* %3, double** %8
%10 = load double*, double** %5
%11 = load i32, i32* %6
%12 = load double, double* %7
%13 = load double*, double** %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%15 = call i32 @ransacF(double* %10, i32 %11, double %12, double 0x3FEE666666666666, i32 1000000, double* %13, i32 0, i32* %14, i32 1, i32 49)
ret void
}

LLVM IR (-O2):
define void @ransacFsimple(double* %0, i32 %1, double %2, double* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%8 = call i32 @ransacF(double* %0, i32 %1, double %2, double 0x3FEE666666666666, i32 1000000, double* %3, i32 0, i32* %7, i32 1, i32 49)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GyroAngleAbsGet();
int /*<<< orphan*/ GyroAngleDegGet();
int /*<<< orphan*/ GyroAngleRadGet();
int /*<<< orphan*/ GyroDebug(int /*<<< orphan*/);
int /*<<< orphan*/ GyroReinit();
int /*<<< orphan*/ GyroValidGet();
void GyroWarningEliminate() {
  GyroDebug(0);
  GyroReinit();
  GyroAngleDegGet();
  GyroAngleRadGet();
  GyroAngleAbsGet();
  GyroValidGet();
  GyroWarningEliminate();
}


x86 assembly (clang, -O0):
<GyroWarningEliminate>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <GyroDebug@plt>
mov    $0x0,%al
call   1080 <GyroReinit@plt>
mov    $0x0,%al
call   1040 <GyroAngleDegGet@plt>
mov    $0x0,%al
call   1030 <GyroAngleRadGet@plt>
mov    $0x0,%al
call   1070 <GyroAngleAbsGet@plt>
mov    $0x0,%al
call   1050 <GyroValidGet@plt>
call   1090 <GyroWarningEliminate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyroWarningEliminate>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1060 <GyroDebug@plt>
xor    %eax,%eax
call   1080 <GyroReinit@plt>
xor    %eax,%eax
call   1040 <GyroAngleDegGet@plt>
xor    %eax,%eax
call   1030 <GyroAngleRadGet@plt>
xor    %eax,%eax
call   1070 <GyroAngleAbsGet@plt>
xor    %eax,%eax
call   1050 <GyroValidGet@plt>
jmp    1170 <GyroWarningEliminate+0x10>

LLVM IR (-O0):
define void @GyroWarningEliminate() {
%1 = call i32 @GyroDebug(i32 0)
%2 = call i32 (...) @GyroReinit()
%3 = call i32 (...) @GyroAngleDegGet()
%4 = call i32 (...) @GyroAngleRadGet()
%5 = call i32 (...) @GyroAngleAbsGet()
%6 = call i32 (...) @GyroValidGet()
ret void
}

LLVM IR (-O2):
define void @GyroWarningEliminate() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GyroDebug(i32 0)
%3 = tail call i32 (...) @GyroReinit()
%4 = tail call i32 (...) @GyroAngleDegGet()
%5 = tail call i32 (...) @GyroAngleRadGet()
%6 = tail call i32 (...) @GyroAngleAbsGet()
%7 = tail call i32 (...) @GyroValidGet()
br label %1
}
/* Variables and functions */
scalar_t__ ioperm(int, int, int);
int /*<<< orphan*/ printf(char *);
int getport() {
  if (ioperm(0x378, 3, 1)) {
    printf("Couldn't get port BASE_PORT \n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<getport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x378,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
cmp    $0x0,%rax
je     115e <getport+0x3e>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1165 <getport+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getport>:
push   %rbx
mov    $0x1,%ebx
mov    $0x378,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
test   %rax,%rax
je     114d <getport+0x2d>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Couldn't get port BASE_PORT \0A\00"
define i32 @getport() {
%1 = alloca i32
%2 = call i64 @ioperm(i32 888, i32 3, i32 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [29 x i8] c"Couldn't get port BASE_PORT \00"
define i32 @getport() {
%1 = tail call i64 @ioperm(i32 888, i32 3, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
char *strchr(const char *s, int c) {
  for (; *s; s++) {
    if (*s == c)
      return (char *)s;
  }
  if (*s == c)
    return (char *)s;
  return (void *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <strchr+0x70>
jmp    113a <strchr+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1168 <strchr+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <strchr+0x70>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     112b <strchr+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %ecx,%ecx
test   %esi,%esi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %18, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ]
%16 = icmp eq i32 %1, 0
%17 = select i1 %16, i8* %15, i8* null
br label %18
18: ; preds = %5, %14
%19 = phi i8* [ %17, %14 ], [ %7, %5 ]
ret i8* %19
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t htons(uint16_t hostshort) {
  return (hostshort << 8) | (hostshort >> 8);
}


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

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

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

LLVM IR (-O2):
define i32 @htons(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
bool nrf51_errata_74(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_74() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void writelines(char *lineptr[], int nlines) {
  while (--nlines >= 0)
    printf("%s\n", *lineptr++);
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1156 <writelines+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <writelines+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <writelines+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <writelines+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8** [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
unsigned char calculate_entry_checksum(const unsigned char *buffer) {
  unsigned char sum = 0;
  int loop = 0;
  for (loop = 0; loop < 19; loop++) {
    sum = sum + buffer[loop];
  }
  sum = sum + 0xBA;
  return sum;
}


x86 assembly (clang, -O0):
<calculate_entry_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x13,-0x10(%rbp)
jge    1147 <calculate_entry_checksum+0x47>
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <calculate_entry_checksum+0x1a>
movzbl -0x9(%rbp),%eax
add    $0xba,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_entry_checksum>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddb  %xmm0,%xmm1
pxor   %xmm0,%xmm0
psadbw %xmm1,%xmm0
movd   %xmm0,%eax
add    0x10(%rdi),%al
add    0x11(%rdi),%al
add    0x12(%rdi),%al
add    $0xba,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @calculate_entry_checksum(i8* nocapture %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 17
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 18
%9 = load i8, i8* %8
%10 = call i8 @llvm.vector.reduce.add.v16i8(<16 x i8> %3)
%11 = add i8 %10, %5
%12 = add i8 %11, %7
%13 = add i8 %12, %9
%14 = add i8 %13, -70
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ telcmdStr(int);
int /*<<< orphan*/ verboseOut(int, char *, char const *, int /*<<< orphan*/);
void telOptPrintCmd(const char *str, int cmd) {
  verboseOut(2, "%s IAC %s\r\n", str, telcmdStr(cmd));
}


x86 assembly (clang, -O0):
<telOptPrintCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <telcmdStr@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0x2,%edi
lea    0xeaf(%rip),%rsi
call   1040 <verboseOut@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<telOptPrintCmd>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <telcmdStr@plt>
lea    0xece(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1040 <verboseOut@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s IAC %s\0D\0A\00"
define void @telOptPrintCmd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @telcmdStr(i32 %6)
%8 = call i32 @verboseOut(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s IAC %s\0D\0A\00"
define void @telOptPrintCmd(i8* %0, i32 %1) {
%3 = tail call i32 @telcmdStr(i32 %1)
%4 = tail call i32 @verboseOut(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int run_script(char *, char **, int /*<<< orphan*/ *, int /*<<< orphan*/);
int del_dir(char *dir) {
  int ret;
  char *argv[4];
  argv[0] = "/bin/rm";
  argv[1] = "-rf";
  argv[2] = dir;
  argv[3] = NULL;
  ret = run_script("/bin/rm", argv, NULL, 0);
  return ret;
}


x86 assembly (clang, -O0):
<del_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <run_script@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_dir>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
lea    0xee2(%rip),%rcx
mov    %rcx,0x8(%rsp)
mov    %rdi,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    %rsp,%rsi
mov    %rax,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <run_script@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/rm\00"
@.str.1 = [4 x i8] c"-rf\00"
define i32 @del_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [4 x i8*]
store i8* %0, i8** %2
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 2
store i8* %7, i8** %8
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 3
store i8* null, i8** %9
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 0
%11 = call i32 @run_script(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %10, i32* null, i32 0)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/rm\00"
@.str.1 = [4 x i8] c"-rf\00"
define i32 @del_dir(i8* %0) {
%2 = alloca [4 x i8*]
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 2
store i8* %0, i8** %6
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 3
store i8* null, i8** %7
%8 = call i32 @run_script(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4, i32* null, i32 0)
ret i32 %8
}
unsigned char checkStringParameter(const char *path, unsigned int *pathLength) {
  if (path == 0x0 && pathLength != 0x0) {
    *pathLength = 0;
  }
  return path != 0x0;
}


x86 assembly (clang, -O0):
<checkStringParameter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <checkStringParameter+0x2c>
cmpq   $0x0,-0x10(%rbp)
je     112c <checkStringParameter+0x2c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkStringParameter>:
test   %rdi,%rdi
jne    1110 <checkStringParameter+0x10>
test   %rsi,%rsi
je     1110 <checkStringParameter+0x10>
movl   $0x0,(%rsi)
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @checkStringParameter(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32*, i32** %4
store i32 0, i32* %11
br label %12
12: ; preds = %10, %7, %2
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
%15 = zext i1 %14 to i32
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @checkStringParameter(i8* readnone %0, i32* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 0, i32* %1
br label %7
7: ; preds = %6, %2
%8 = icmp ne i8* %0, null
%9 = zext i1 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int SLOW_IsNumber(const char *string) {
  while (*string) {
    if (*string != '.' && !isdigit(*string))
      return 0;
    string++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<SLOW_IsNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <SLOW_IsNumber+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     115a <SLOW_IsNumber+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115a <SLOW_IsNumber+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1172 <SLOW_IsNumber+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <SLOW_IsNumber+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLOW_IsNumber>:
push   %rbx
mov    %rdi,%rbx
jmp    1124 <SLOW_IsNumber+0x14>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x2e,%al
je     1120 <SLOW_IsNumber+0x10>
test   %al,%al
je     113f <SLOW_IsNumber+0x2f>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1120 <SLOW_IsNumber+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @SLOW_IsNumber(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %10
i8 46, label %8
]
5: ; preds = %2
%6 = tail call i32 @isdigit(i8 signext %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2, %5
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2, %5
%11 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %11
}
void benchmark_func(void) {}


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

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

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

LLVM IR (-O2):
define void @benchmark_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_Error(char *);
void BOPS_Error(void) { Sys_Error("BoxOnPlaneSide:  Bad signbits"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"BoxOnPlaneSide: Bad signbits\00"
define void @BOPS_Error() {
%1 = call i32 @Sys_Error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"BoxOnPlaneSide: Bad signbits\00"
define void @BOPS_Error() {
%1 = tail call i32 @Sys_Error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
int *f(int *p) {
  char c = 0;
  return p + c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl -0x9(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32* @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 0, i8* %3
%4 = load i32*, i32** %2
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
ret i32* %8
}

LLVM IR (-O2):
define i32* @f(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writePMAGIC(unsigned data) { w5100_write_byte(0x0029, data); }


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

x86 assembly (clang, -O2):
mov    %edi,%esi
mov    $0x29,%edi
jmp    1030 <w5100_write_byte@plt>

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

LLVM IR (-O2):
define void @w5100_writePMAGIC(i32 %0) {
%2 = tail call i32 @w5100_write_byte(i32 41, i32 %0)
ret void
}
int intcmp(const void *x, const void *y) { return *(int *)x - *(int *)y; }


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

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

LLVM IR (-O0):
define i32 @intcmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void initialiser_tableau_marque(int *marque, int nb_sommet) {
  int i;
  for (i = 0; i < nb_sommet; i++) {
    marque[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initialiser_tableau_marque>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initialiser_tableau_marque+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initialiser_tableau_marque+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiser_tableau_marque>:
test   %esi,%esi
jle    1126 <initialiser_tableau_marque+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initialiser_tableau_marque(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void cs_init() {
  (*(volatile unsigned *)0x70000000) &= (~(1 << 4));
  (*(volatile unsigned *)0x70000000) |= (1 << 4);
  (*(volatile unsigned *)0x70000008) = (0x0 << 28) | (0x0 << 24) | (0x7 << 16) |
                                       (0x1 << 12) | (0x0 << 8) | (0x0 << 4) |
                                       (0x0 << 0);
}


x86 assembly (clang, -O0):
<cs_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70000000,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x70000000,%eax
mov    %ecx,(%rax)
mov    $0x70000000,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x70000000,%eax
mov    %ecx,(%rax)
mov    $0x70000008,%eax
movl   $0x71000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_init>:
andl   $0xffffffef,0x70000000
ef
orl    $0x10,0x70000000
10
movl   $0x71000,0x70000008
ret

LLVM IR (-O0):
define void @cs_init() {
%1 = load volatile i32, i32* inttoptr (i64 1879048192 to i32*)
%2 = and i32 %1, -17
store volatile i32 %2, i32* inttoptr (i64 1879048192 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1879048192 to i32*)
%4 = or i32 %3, 16
store volatile i32 %4, i32* inttoptr (i64 1879048192 to i32*)
store volatile i32 462848, i32* inttoptr (i64 1879048200 to i32*)
ret void
}

LLVM IR (-O2):
define void @cs_init() {
%1 = load volatile i32, i32* inttoptr (i64 1879048192 to i32*)
%2 = and i32 %1, -17
store volatile i32 %2, i32* inttoptr (i64 1879048192 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1879048192 to i32*)
%4 = or i32 %3, 16
store volatile i32 %4, i32* inttoptr (i64 1879048192 to i32*)
store volatile i32 462848, i32* inttoptr (i64 1879048200 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRE6_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRE6_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRE6_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kbhit();
int getch(void) {
  while (!kbhit())
    ;
  return (*(volatile unsigned int *)(0x20000000));
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <getch+0x9>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <getch+0x25>
jmp    113a <getch+0x2a>
jmp    1119 <getch+0x9>
mov    $0x20000000,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1120 <getch+0x10>
mov    0x20000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getch() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @kbhit()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 536870912 to i32*)
ret i32 %7
}

LLVM IR (-O2):
define i32 @getch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 536870912 to i32*)
ret i32 %5
}
unsigned xrop3_213_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_213_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_213_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
and    %edi,%esi
lea    -0x100(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_213_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_213_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = and i8 %1, %0
%6 = zext i8 %5 to i32
%7 = or i32 %6, -256
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
extern int f(int x) { return (x + 1); }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ regmatchInsensitive(char *, char *);
int issetaudit(char *string) {
  if (regmatchInsensitive(string, "^set_audit=")) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<issetaudit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
cmp    $0x0,%rax
je     1142 <issetaudit+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <issetaudit+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issetaudit>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"^set_audit=\00"
define i32 @issetaudit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @regmatchInsensitive(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"^set_audit=\00"
define i32 @issetaudit(i8* %0) {
%2 = tail call i64 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
double vbench_clip3f(double v, double f_min, double f_max) {
  return ((v < f_min) ? f_min : (v > f_max) ? f_max : v);
}


x86 assembly (clang, -O0):
<vbench_clip3f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <vbench_clip3f+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <vbench_clip3f+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <vbench_clip3f+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <vbench_clip3f+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbench_clip3f>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @vbench_clip3f(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @vbench_clip3f(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int check_routing(struct sip_msg *, int);
int allow_routing_2(struct sip_msg *msg, char *allow_file, char *deny_file) {
  return check_routing(msg, (int)(long)allow_file);
}


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

x86 assembly (clang, -O2):
<allow_routing_2>:
jmp    1030 <check_routing@plt>

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @allow_routing_2(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.sip_msg*, %struct.sip_msg** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = call i32 @check_routing(%struct.sip_msg* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @allow_routing_2(%struct.sip_msg* %0, i8* %1, i8* nocapture readnone %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @check_routing(%struct.sip_msg* %0, i32 %5)
ret i32 %6
}
void Key_ClearStates(void) {}


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

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

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

LLVM IR (-O2):
define void @Key_ClearStates() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void itoa(int someinteger) {
  printf("%ld\n", someinteger);
  printf("%d", someinteger);
}


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

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @itoa(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int errno;
void my_socket_set_errno(int error) { errno = error; }


x86 assembly (clang, -O0):
<my_socket_set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_socket_set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @my_socket_set_errno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
int rand();
void get_randoms(int *numbers, int upper) {
  int i;
  for (i = upper - 1; i > 0; i -= 1) {
    numbers[i] = rand() % i;
  }
}


x86 assembly (clang, -O0):
<get_randoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1156 <get_randoms+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <get_randoms+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randoms>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     113f <get_randoms+0x2f>
mov    %rdi,%r14
mov    %esi,%ebx
nop
lea    -0x1(%rbx),%r15
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %r15d,%eax
mov    %edx,(%r14,%rax,4)
cmp    $0x2,%rbx
mov    %r15,%rbx
ja     1120 <get_randoms+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_randoms(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @get_randoms(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %8 to i32
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, %9
%12 = and i64 %8, 4294967295
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %11, i32* %13
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int ReadCount();
void udelay(unsigned usec) {
  volatile unsigned now = ReadCount();
  volatile unsigned final = now + usec * 60 / 2;
  for (;;) {
    volatile unsigned now = ReadCount();
    if ((volatile int)(now - final) >= 0)
      break;
  }
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ReadCount@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x3c,-0x4(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ReadCount@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jl     1154 <udelay+0x44>
jmp    1159 <udelay+0x49>
jmp    1134 <udelay+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ReadCount@plt>
mov    %eax,0xc(%rsp)
imul   $0x3c,%ebx,%eax
shr    %eax
add    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
nop
xor    %eax,%eax
call   1030 <ReadCount@plt>
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
js     1130 <udelay+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @ReadCount()
store volatile i32 %6, i32* %3
%7 = load volatile i32, i32* %3
%8 = load i32, i32* %2
%9 = mul i32 %8, 60
%10 = udiv i32 %9, 2
%11 = add i32 %7, %10
store volatile i32 %11, i32* %4
br label %12
12: ; preds = %19, %1
%13 = call i32 (...) @ReadCount()
store volatile i32 %13, i32* %5
%14 = load volatile i32, i32* %5
%15 = load volatile i32, i32* %4
%16 = sub i32 %14, %15
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
br label %20
19: ; preds = %12
br label %12
20: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (...) @ReadCount()
store volatile i32 %6, i32* %2
%7 = bitcast i32* %3 to i8*
%8 = load volatile i32, i32* %2
%9 = mul i32 %0, 60
%10 = lshr exact i32 %9, 1
%11 = add i32 %8, %10
store volatile i32 %11, i32* %3
%12 = bitcast i32* %4 to i8*
br label %13
13: ; preds = %13, %1
%14 = tail call i32 (...) @ReadCount()
store volatile i32 %14, i32* %4
%15 = load volatile i32, i32* %4
%16 = load volatile i32, i32* %3
%17 = sub i32 %15, %16
%18 = icmp sgt i32 %17, -1
br i1 %18, label %19, label %13
19: ; preds = %13
ret void
}