xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ failure(char *, int);
int /*<<< orphan*/ respond(int /*<<< orphan*/, char *, int);
scalar_t__ rmdir(char *);
void deleted(char *uri, int socketfd) {
  if (rmdir(uri))
    failure("500 Delete failed", socketfd);
  else
    respond(0, "text", socketfd);
}


x86 assembly (clang, -O0):
<deleted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%rax
je     1166 <deleted+0x36>
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1050 <failure@plt>
jmp    1177 <deleted+0x47>
mov    -0xc(%rbp),%edx
xor    %edi,%edi
lea    0xea0(%rip),%rsi
call   1030 <respond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleted>:
push   %rbx
mov    %esi,%ebx
call   1040 <rmdir@plt>
test   %rax,%rax
je     114c <deleted+0x1c>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <failure@plt>
lea    0xebf(%rip),%rsi
xor    %edi,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <respond@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"500 Delete failed\00"
@.str.1 = [5 x i8] c"text\00"
define void @deleted(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 = call i64 @rmdir(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @failure(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @respond(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"500 Delete failed\00"
@.str.1 = [5 x i8] c"text\00"
define void @deleted(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @rmdir(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @failure(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @respond(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_cpx();
int /*<<< orphan*/ e_imm();
void e_cpx_imm() {
  e_imm();
  e_cpx();
}


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

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

LLVM IR (-O0):
define void @e_cpx_imm() {
%1 = call i32 (...) @e_imm()
%2 = call i32 (...) @e_cpx()
ret void
}

LLVM IR (-O2):
define void @e_cpx_imm() {
%1 = tail call i32 (...) @e_imm()
%2 = tail call i32 (...) @e_cpx()
ret void
}
/* Variables and functions */
int add(int, int);
char *add_002() {
  int rel = add(4, 5);
  do {
    return 8 == rel ? NULL
                    : "expect ["
                      "8"
                      "]";
  } while (0);
  ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x8,%edx
lea    0xec7(%rip),%rax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x8,%eax
lea    0xed4(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"expect [8]\00"
define i8* @add_002() {
%1 = tail call i32 @add(i32 4, i32 5)
%2 = icmp eq i32 %1, 8
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ terminate(int);
void wtf() { terminate(841); }


x86 assembly (clang, -O0):
<wtf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x349,%edi
call   1030 <terminate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtf>:
mov    $0x349,%edi
jmp    1030 <terminate@plt>

LLVM IR (-O0):
define void @wtf() {
%1 = call i32 @terminate(i32 841)
ret void
}

LLVM IR (-O2):
define void @wtf() {
%1 = tail call i32 @terminate(i32 841)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *dstring_realloc(void *data, void *ptr, size_t size) {
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<dstring_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @dstring_realloc(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @dstring_realloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
scalar_t__ sx_single_read(int);
int sx_get_last_packet_rssi() { return -164 + (int)sx_single_read(0x1a); }


x86 assembly (clang, -O0):
<sx_get_last_packet_rssi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <sx_single_read@plt>
add    $0xffffff5c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sx_get_last_packet_rssi>:
push   %rax
mov    $0x1a,%edi
call   1030 <sx_single_read@plt>
add    $0xffffff5c,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sx_get_last_packet_rssi() {
%1 = call i64 @sx_single_read(i32 26)
%2 = trunc i64 %1 to i32
%3 = add nsw i32 -164, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @sx_get_last_packet_rssi() {
%1 = tail call i64 @sx_single_read(i32 26)
%2 = trunc i64 %1 to i32
%3 = add nsw i32 %2, -164
ret i32 %3
}
/* Variables and functions */
float __nv_rintf(float);
float rintf(float __a) { return __nv_rintf(__a); }


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

x86 assembly (clang, -O2):
<rintf>:
jmp    1030 <__nv_rintf@plt>

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

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = tail call float @__nv_rintf(float %0)
ret float %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void putchar(unsigned char c) {
  uint32_t a3;
  volatile uint32_t *tx_reg = (uint32_t *)(8192 + 4);
  a3 = 1 | (c << 8);
  *tx_reg = a3;
  a3 = c << 8;
  *tx_reg = a3;
  while (*((uint8_t *)tx_reg) == 0) {
  }
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2004,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114f <putchar+0x4f>
jmp    113c <putchar+0x3c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
shl    $0x8,%edi
lea    0x1(%rdi),%eax
mov    %eax,0x2004
mov    %edi,0x2004
ret

LLVM IR (-O0):
define void @putchar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 8196 to i32*), i32** %4
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 1, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
store volatile i32 %9, i32* %10
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32*, i32** %4
store volatile i32 %14, i32* %15
br label %16
16: ; preds = %21, %1
%17 = load i32*, i32** %4
%18 = bitcast i32* %17 to i64*
%19 = load i64, i64* %18
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
br label %16
22: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @putchar(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 8
%4 = or i32 %3, 1
store volatile i32 %4, i32* inttoptr (i64 8196 to i32*)
store volatile i32 %3, i32* inttoptr (i64 8196 to i32*)
ret void
}
double adifd(double v1, double v2) {
  if (v1 > v2) {
    return v1 - v2;
  } else if (v2 > v1) {
    return v2 - v1;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<adifd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1132 <adifd+0x32>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1163 <adifd+0x63>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1156 <adifd+0x56>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1163 <adifd+0x63>
jmp    115b <adifd+0x5b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adifd>:
ucomisd %xmm1,%xmm0
jbe    110b <adifd+0xb>
subsd  %xmm1,%xmm0
ret
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm1
jbe    111d <adifd+0x1d>
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @adifd(double %0, double %1) {
%3 = fcmp ogt double %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = fsub double %0, %1
br label %10
6: ; preds = %2
%7 = fcmp ogt double %1, %0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = fsub double %1, %0
br label %10
10: ; preds = %6, %8, %4
%11 = phi double [ %5, %4 ], [ %9, %8 ], [ 0.000000e+00, %6 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ W_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void assert_file_write(char *file) {
  if (access(file, W_OK)) {
    fprintf(stderr, "ERROR: File %s cannot be accessed for writing.  Exiting\n",
            file);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
je     117b <assert_file_write+0x4b>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_file_write>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
test   %rax,%rax
jne    1149 <assert_file_write+0x19>
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@W_OK = global i32 0
@stderr = global i32 0
@.str = [57 x i8] c"ERROR: File %s cannot be accessed for writing. Exiting\0A\00"
define void @assert_file_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @W_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@W_OK = global i32 0
@stderr = global i32 0
@.str = [57 x i8] c"ERROR: File %s cannot be accessed for writing. Exiting\0A\00"
define void @assert_file_write(i8* %0) {
%2 = load i32, i32* @W_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_alloc(void *);
void *malloc(size_t);
void *safe_alloc(size_t size) {
  void *p;
  p = malloc(size);
  assert_alloc(p);
  return p;
}


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

x86 assembly (clang, -O2):
<safe_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert_alloc@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert_alloc(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @safe_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @assert_alloc(i8* %2)
ret i8* %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main(int argc, char const *argv[]) {
  char ch;
  ch = getchar();
  while (ch != '\n') {
    if (ch == ' ')
      putchar(ch);
    else
      putchar(ch + 1);
    ch = getchar();
  }
  putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     1186 <main+0x66>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
jne    1168 <main+0x48>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    1177 <main+0x57>
movsbl -0x11(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    1140 <main+0x20>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1138 <main+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%al
je     1130 <main+0x10>
cmp    $0xa,%al
je     114b <main+0x2b>
add    $0x1,%al
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %7, %2
%4 = tail call signext i8 (...) @getchar()
switch i8 %4, label %5 [
i8 10, label %10
i8 32, label %7
]
5: ; preds = %3
%6 = add i8 %4, 1
br label %7
7: ; preds = %3, %5
%8 = phi i8 [ %6, %5 ], [ %4, %3 ]
%9 = tail call i32 @putchar(i8 signext %8)
br label %3
10: ; preds = %3
%11 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ze_clear() { printf("[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @ze_clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
float **(wcheck_float_ptr_ptr)(float **to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define float** @wcheck_float_ptr_ptr(float** readnone returned %0) {
ret float** %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned int getint(FILE *fp) {
  int c, c1, c2, c3;
  c = getc(fp);
  c1 = getc(fp);
  c2 = getc(fp);
  c3 = getc(fp);
  return ((unsigned int)c) + (((unsigned int)c1) << 8) +
         (((unsigned int)c2) << 16) + (((unsigned int)c3) << 24);
}


x86 assembly (clang, -O0):
<getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getint>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <getc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <getc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <getc@plt>
shl    $0x8,%ebp
add    %r14d,%ebp
shl    $0x10,%ebx
add    %ebp,%ebx
shl    $0x18,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getint(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @getc(i32* %9)
store i32 %10, i32* %4
%11 = load i32*, i32** %2
%12 = call i32 @getc(i32* %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %2
%14 = call i32 @getc(i32* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = shl i32 %16, 8
%18 = add i32 %15, %17
%19 = load i32, i32* %5
%20 = shl i32 %19, 16
%21 = add i32 %18, %20
%22 = load i32, i32* %6
%23 = shl i32 %22, 24
%24 = add i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @getint(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i32 @getc(i32* %0)
%5 = tail call i32 @getc(i32* %0)
%6 = shl i32 %3, 8
%7 = add i32 %6, %2
%8 = shl i32 %4, 16
%9 = add i32 %7, %8
%10 = shl i32 %5, 24
%11 = add i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int pow(double, double);
double g(double x) { return (5 * pow(x, 3.0) - 2 * pow(x, 2.0) + 3); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x5,%eax,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%ecx
sub    %ecx,%eax
add    $0x3,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm1
call   1030 <pow@plt>
lea    (%rax,%rax,4),%ebx
movsd  0xed5(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
add    %eax,%eax
sub    %eax,%ebx
add    $0x3,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, double 3.000000e+00)
%5 = mul nsw i32 5, %4
%6 = load double, double* %2
%7 = call i32 @pow(double %6, double 2.000000e+00)
%8 = mul nsw i32 2, %7
%9 = sub nsw i32 %5, %8
%10 = add nsw i32 %9, 3
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = tail call i32 @pow(double %0, double 3.000000e+00)
%3 = mul nsw i32 %2, 5
%4 = tail call i32 @pow(double %0, double 2.000000e+00)
%5 = mul i32 %4, -2
%6 = add i32 %3, 3
%7 = add i32 %6, %5
%8 = sitofp i32 %7 to double
ret double %8
}
void gdk_color_parse() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_parse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned long svz_hash_code(char *key) {
  unsigned long code = 0;
  char *p = key;
  assert(key);
  while (*p) {
    code = (code << 1) ^ *p;
    p++;
  }
  return code;
}


x86 assembly (clang, -O0):
<svz_hash_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <svz_hash_code+0x5a>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x18(%rbp),%rcx
movsbq (%rcx),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <svz_hash_code+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_hash_code>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1147 <svz_hash_code+0x37>
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    %rax,%rax
movsbq %cl,%rcx
xor    %rcx,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <svz_hash_code+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @svz_hash_code(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i8* [ %12, %5 ], [ %0, %1 ]
%8 = phi i64 [ %11, %5 ], [ 0, %1 ]
%9 = shl i64 %8, 1
%10 = sext i8 %6 to i64
%11 = xor i64 %9, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i64 [ 0, %1 ], [ %11, %5 ]
ret i64 %16
}
void g_hook_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_unref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintChar(char);
void PrintDash(void) { PrintChar('-'); }


x86 assembly (clang, -O0):
<PrintDash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <PrintChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintDash>:
mov    $0x2d,%edi
jmp    1030 <PrintChar@plt>

LLVM IR (-O0):
define void @PrintDash() {
%1 = call i32 @PrintChar(i8 signext 45)
ret void
}

LLVM IR (-O2):
define void @PrintDash() {
%1 = tail call i32 @PrintChar(i8 signext 45)
ret void
}
int main() {
  int arg1 = 0xAAAAAAAA;
  int arg2 = 0xFFFFFFFF;
  int arg3 = 0x00000000;
  int out = 0;
  char flags = 0;
  __asm__("addl %2, %2; movl %3, %%edx; adcl %4, %%edx; lahf; movb %%ah, %1; "
          "movl %%edx, %0;"
          : "=r"(out), "=a"(flags)
          : "a"(arg1), "b"(arg2), "c"(arg3)
          : "edx");
  return out == 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0xaaaaaaaa,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
mov    -0x18(%rbp),%ecx
add    %eax,%eax
mov    %ebx,%edx
adc    %ecx,%edx
lahf
mov    %ah,%al
mov    %edx,%ecx
mov    %ecx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xaaaaaaaa,%eax
mov    $0xffffffff,%ebx
xor    %ecx,%ecx
add    %eax,%eax
mov    %ebx,%edx
adc    %ecx,%edx
lahf
mov    %ah,%al
mov    %edx,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
store i32 -1431655766, i32* %2
store i32 -1, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i8 0, i8* %6
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call { i32, i8 } asm "addl $2, $2; movl $3, %edx; adcl $4, %edx; lahf; movb %ah, $1; movl %edx, $0;", "=r,={ax},{ax},{bx},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %7, i32 %8, i32 %9)
%11 = extractvalue { i32, i8 } %10, 0
%12 = extractvalue { i32, i8 } %10, 1
store i32 %11, i32* %5
store i8 %12, i8* %6
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i32, i8 } asm "addl $2, $2; movl $3, %edx; adcl $4, %edx; lahf; movb %ah, $1; movl %edx, $0;", "=r,={ax},{ax},{bx},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 -1431655766, i32 -1, i32 0)
%2 = extractvalue { i32, i8 } %1, 0
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void findMaxElement(int arr[], int arrSize) {
  int max, i;
  max = arr[0];
  for (i = 1; i < arrSize; i++) {
    if (max < arr[i])
      max = arr[i];
  }
}


x86 assembly (clang, -O0):
<findMaxElement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <findMaxElement+0x5c>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1149 <findMaxElement+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <findMaxElement+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <findMaxElement+0x1b>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @findMaxElement(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int lst_insert(void *lst, size_t pos, int v) {}


x86 assembly (clang, -O0):
<lst_insert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lst_insert(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 undef
}
int do_923() { return 923; }


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

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

LLVM IR (-O0):
define i32 @do_923() {
ret i32 923
}

LLVM IR (-O2):
define i32 @do_923() {
ret i32 923
}
/* Variables and functions */
unsigned int errno;
void __set_errno(unsigned int err) { errno = err; }


x86 assembly (clang, -O0):
<__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):
<__set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
@errno = global i32 0
define void @__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 @__set_errno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
int darray_indexof(double number, double a[], int count) {
  int i = 0;
  for (i = 0; i < count; i++) {
    if (a[i] == number) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<darray_indexof>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1166 <darray_indexof+0x66>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1153 <darray_indexof+0x53>
jp     1153 <darray_indexof+0x53>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <darray_indexof+0x6d>
jmp    1158 <darray_indexof+0x58>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111e <darray_indexof+0x1e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<darray_indexof>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    1126 <darray_indexof+0x26>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   (%rax)
movsd  (%rdi,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
jne    111d <darray_indexof+0x1d>
jnp    1127 <darray_indexof+0x27>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <darray_indexof+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @darray_indexof(double %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double %0, double* %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load double*, double** %6
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double, double* %5
%20 = fcmp oeq double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw 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, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @darray_indexof(double %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = fcmp oeq double %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int rand();
int getRandGap() {
  int ret = (rand() % 2) + 1;
  if (!(rand() % 4))
    return (0);
  if (rand() % 2)
    return (ret);
  return (-ret);
}


x86 assembly (clang, -O0):
<getRandGap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <getRandGap+0x41>
movl   $0x0,-0x4(%rbp)
jmp    117c <getRandGap+0x6c>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1174 <getRandGap+0x64>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <getRandGap+0x6c>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandGap>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   $0x3,%al
je     1148 <getRandGap+0x38>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
lea    0x1(%rbx),%ebp
xor    %eax,%eax
call   1030 <rand@plt>
test   $0x1,%al
not    %ebx
cmovne %ebp,%ebx
mov    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getRandGap() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %0
%7 = add nsw i32 %2, 1
%8 = tail call i32 (...) @rand()
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
%11 = xor i32 %2, -1
%12 = select i1 %10, i32 %11, i32 %7
br label %13
13: ; preds = %6, %0
%14 = phi i32 [ 0, %0 ], [ %12, %6 ]
ret i32 %14
}
/* Type definitions */
struct CRYPTO_dynlock_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ d0_destroymutex(struct CRYPTO_dynlock_value *);
void dyn_destroy_function(struct CRYPTO_dynlock_value *l, const char *file,
                          int line) {
  void *m = (void *)l;
  d0_destroymutex(l);
}


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

x86 assembly (clang, -O2):
<dyn_destroy_function>:
jmp    1030 <d0_destroymutex@plt>

LLVM IR (-O0):
%struct.CRYPTO_dynlock_value = type { i32 }
define void @dyn_destroy_function(%struct.CRYPTO_dynlock_value* %0, i8* %1, i32 %2) {
%4 = alloca %struct.CRYPTO_dynlock_value*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.CRYPTO_dynlock_value* %0, %struct.CRYPTO_dynlock_value** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.CRYPTO_dynlock_value*, %struct.CRYPTO_dynlock_value** %4
%9 = bitcast %struct.CRYPTO_dynlock_value* %8 to i8*
store i8* %9, i8** %7
%10 = load %struct.CRYPTO_dynlock_value*, %struct.CRYPTO_dynlock_value** %4
%11 = call i32 @d0_destroymutex(%struct.CRYPTO_dynlock_value* %10)
ret void
}

LLVM IR (-O2):
%struct.CRYPTO_dynlock_value = type { i32 }
define void @dyn_destroy_function(%struct.CRYPTO_dynlock_value* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @d0_destroymutex(%struct.CRYPTO_dynlock_value* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *wrap_Item(int *v) {
  int *item = (int *)malloc(sizeof(int));
  *item = *v;
  return item;
}


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

x86 assembly (clang, -O2):
<wrap_Item>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @wrap_Item(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @wrap_Item(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %0
store i32 %4, i32* %3
ret i32* %3
}
/* Variables and functions */
int is_valid_in_MsgTypes(size_t __tag) {
  switch (__tag) {
  case 372:
  case 385:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_in_MsgTypes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x174,%rax
je     1136 <is_valid_in_MsgTypes+0x36>
jmp    1121 <is_valid_in_MsgTypes+0x21>
mov    -0x18(%rbp),%rax
sub    $0x181,%rax
jne    1142 <is_valid_in_MsgTypes+0x42>
jmp    1136 <is_valid_in_MsgTypes+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_valid_in_MsgTypes+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_in_MsgTypes>:
cmp    $0x174,%rdi
sete   %al
cmp    $0x181,%rdi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_in_MsgTypes(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
i64 372, label %5
i64 385, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_valid_in_MsgTypes(i64 %0) {
%2 = icmp eq i64 %0, 372
%3 = icmp eq i64 %0, 385
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_3b(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x1EF33946;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_3b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1ef33946,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_3b>:
xor    $0x1ef33946,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_3b(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 519256390
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_3b(i32 %0, i32 %1) {
%3 = xor i32 %0, 519256390
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
ISR(INT2_vect) {
  DEBUG("ISR "
        "INT2"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ISR INT2 occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"ISR INT2 occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ preempt_enable();
void __rcu_read_unlock(void) { preempt_enable(); }


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

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

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

LLVM IR (-O2):
define void @__rcu_read_unlock() {
%1 = tail call i32 (...) @preempt_enable()
ret void
}
void I422ToUYVYRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToUYVYRow_Any_AVX2() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int tspec_diff_ms(struct timespec *a, struct timespec *b) {
  return ((a->tv_sec - b->tv_sec) * 1000 + (a->tv_nsec - b->tv_nsec) / 1000000);
}


x86 assembly (clang, -O0):
<tspec_diff_ms>:
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
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tspec_diff_ms>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
sub    (%rsi),%eax
imul   $0x3e8,%eax,%edx
sub    0x4(%rsi),%ecx
movslq %ecx,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @tspec_diff_ms(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timespec*, %struct.timespec** %4
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = sdiv i32 %19, 1000000
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @tspec_diff_ms(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = sdiv i32 %13, 1000000
%15 = add nsw i32 %14, %8
ret i32 %15
}