xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ time2gpst(int /*<<< orphan*/, int *);
int /*<<< orphan*/ timeget();
int /*<<< orphan*/ utc2gpst(int /*<<< orphan*/);
extern int adjgpsweek(int week) {
  int w;
  (void)time2gpst(utc2gpst(timeget()), &w);
  if (w < 1560) {
    w = 1560;
  }
  return week + (w - week + 512) / 1024 * 1024;
}


x86 assembly (clang, -O0):
<adjgpsweek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <timeget@plt>
mov    %eax,%edi
call   1030 <utc2gpst@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1050 <time2gpst@plt>
cmpl   $0x618,-0x8(%rbp)
jge    1168 <adjgpsweek+0x38>
movl   $0x618,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x200,%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0xa,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjgpsweek>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <timeget@plt>
mov    %eax,%edi
call   1030 <utc2gpst@plt>
lea    0xc(%rsp),%rsi
mov    %eax,%edi
call   1050 <time2gpst@plt>
mov    0xc(%rsp),%ecx
cmp    $0x619,%ecx
mov    $0x618,%eax
cmovge %ecx,%eax
sub    %ebx,%eax
lea    0x200(%rax),%ecx
add    $0x5ff,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xfffffc00,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @adjgpsweek(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @timeget()
%5 = call i32 @utc2gpst(i32 %4)
%6 = call i32 @time2gpst(i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1560
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1560, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 512
%16 = sdiv i32 %15, 1024
%17 = mul nsw i32 %16, 1024
%18 = add nsw i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @adjgpsweek(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @timeget()
%5 = tail call i32 @utc2gpst(i32 %4)
%6 = call i32 @time2gpst(i32 %5, i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 1560
%9 = select i1 %8, i32 %7, i32 1560
%10 = sub i32 512, %0
%11 = add i32 %10, %9
%12 = sdiv i32 %11, 1024
%13 = shl nsw i32 %12, 10
%14 = add nsw i32 %13, %0
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *h264avcc_ppsh_get_pps(const uint8_t *p) { return (uint8_t *)p + 2; }


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

x86 assembly (clang, -O2):
<h264avcc_ppsh_get_pps>:
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @h264avcc_ppsh_get_pps(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
ret i32* %4
}

LLVM IR (-O2):
define i32* @h264avcc_ppsh_get_pps(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *xrealloc_unsigned(void *ptr, size_t newsize) {
  ptr = realloc(ptr, newsize);
  if (!ptr)
    abort();
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <xrealloc_unsigned+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc_unsigned>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <xrealloc_unsigned+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xrealloc_unsigned(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @xrealloc_unsigned(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
void Put_sprite(unsigned short a, short x, short y, unsigned short w,
                unsigned short h, unsigned char f) {}


x86 assembly (clang, -O0):
<Put_sprite>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9b,%al
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Put_sprite(i16 zeroext %0, i16 signext %1, i16 signext %2, i16 zeroext %3, i16 zeroext %4, i8 zeroext %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i8
store i16 %0, i16* %7
store i16 %1, i16* %8
store i16 %2, i16* %9
store i16 %3, i16* %10
store i16 %4, i16* %11
store i8 %5, i8* %12
ret void
}

LLVM IR (-O2):
define void @Put_sprite(i16 zeroext %0, i16 signext %1, i16 signext %2, i16 zeroext %3, i16 zeroext %4, i8 zeroext %5) {
ret void
}
/* Variables and functions */
double fabs(double);
int check_kj_m2(double val) { return (fabs(val) < 1.0e7) ? 1 : 0; }


x86 assembly (clang, -O0):
<check_kj_m2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xefb(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_kj_m2>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @check_kj_m2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e+07
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_kj_m2(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp olt double %2, 1.000000e+07
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *safemalloc(int n) {
  void *p = malloc(n);
  if (!p) {
    fprintf(stderr, "Malloc(%d) failed\n", n);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<safemalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <safemalloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safemalloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <safemalloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Malloc(%d) failed\0A\00"
define i8* @safemalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Malloc(%d) failed\0A\00"
define noalias i8* @safemalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t EMACPowerManagementStatusGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400EC000);
  return ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
          (0x00000040 | 0x00000020 | 0x00000001));
}


x86 assembly (clang, -O0):
<EMACPowerManagementStatusGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
and    $0x61,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPowerManagementStatusGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400ec000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x2c(%rax),%eax
and    $0x61,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @EMACPowerManagementStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074708480
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 44
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 97
ret i32 %12
}

LLVM IR (-O2):
define i32 @EMACPowerManagementStatusGet(i32 %0) {
%2 = icmp eq i32 %0, 1074708480
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 44
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 97
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ malloc_leak();
int /*<<< orphan*/ malloc_order();
int main(int argc, char *argv[]) {
  malloc_order();
  malloc_leak();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <malloc_order@plt>
mov    $0x0,%al
call   1030 <malloc_leak@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <malloc_order@plt>
xor    %eax,%eax
call   1030 <malloc_leak@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @malloc_order()
%6 = call i32 (...) @malloc_leak()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @malloc_order()
%4 = tail call i32 (...) @malloc_leak()
ret i32 0
}
void insb(unsigned short port, void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; ins"
                       "b"
                       : "=D"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
cld
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(long);
void fault_init_random() {
  long seed = 1234567;
  srandom(seed);
}


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

x86 assembly (clang, -O2):
<fault_init_random>:
mov    $0x12d687,%edi
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @fault_init_random() {
%1 = alloca i64
store i64 1234567, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @srandom(i64 %2)
ret void
}

LLVM IR (-O2):
define void @fault_init_random() {
%1 = tail call i32 @srandom(i64 1234567)
ret void
}
int invpcid_checking(unsigned long type, void *desc) {
  asm volatile("movl $0, %%gs:4 \n\t"
               ".pushsection .data.ex \n\t"
               ".quad 1111f, "
               "1f"
               "\n\t"
               ".popsection \n\t"
               "1111:"
               ".byte 0x66,0x0f,0x38,0x82,0x18 \n\t"
               "1:"
               :
               : "a"(desc), "b"(type));
  return exception_vector();
}


x86 assembly (clang, -O0):
<invpcid_checking>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rbx
movl   $0x0,%gs:0x4
invpcid (%rax),%rbx
mov    $0x0,%al
call   1030 <exception_vector@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<invpcid_checking>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
movl   $0x0,%gs:0x4
invpcid (%rax),%rbx
xor    %eax,%eax
pop    %rbx
jmp    1030 <exception_vector@plt>

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

LLVM IR (-O2):
define i32 @invpcid_checking(i64 %0, i8* %1) {
tail call void asm sideeffect "movl $$0, %gs:4 \0A\09.pushsection .data.ex \0A\09.quad 1111f, 1f\0A\09.popsection \0A\091111:.byte 0x66,0x0f,0x38,0x82,0x18 \0A\091:", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %1, i64 %0)
%3 = tail call i32 (...) @exception_vector()
ret i32 %3
}
__attribute__((no)) int foo() {
  int x = 10;
  int y = 100;
  while (--x)
    ++y;
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1132 <foo+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <foo+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 100, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 109
}
char *skip_quoted_string(char *ptr) {
  while (*ptr && (*ptr != '\"'))
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<skip_quoted_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_quoted_string+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_quoted_string+0x3d>
jmp    114e <skip_quoted_string+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_quoted_string+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_quoted_string>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <skip_quoted_string+0x22>
cmp    $0x22,%cl
je     1122 <skip_quoted_string+0x22>
add    $0x1,%rax
jmp    1110 <skip_quoted_string+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_quoted_string(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 34, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int fnet_set_recv_buffsize(int fd, int size) {
  return setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&size, sizeof(int));
}


x86 assembly (clang, -O0):
<fnet_set_recv_buffsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnet_set_recv_buffsize>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @fnet_set_recv_buffsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define i32 @fnet_set_recv_buffsize(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVBUF
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret i32 %7
}
void g_utf8_validate() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_validate() {
ret void
}
int response_count(char *resp_data) {
  int count = 0, i = 0;
  while (resp_data[i++] != '\0') {
    if (resp_data[i] == '/')
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<response_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <response_count+0x58>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1153 <response_count+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <response_count+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<response_count>:
cmpb   $0x0,(%rdi)
je     1126 <response_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    $0x2f,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <response_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @response_count(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 1, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = add nuw i64 %5, 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct smtp_req_arg {
  int dummy;
};

/* Variables and functions */
int parser_on_helo_cb(struct smtp_req_arg *, size_t, void *);
int parser_on_ehlo_cb(struct smtp_req_arg *argv, size_t argc, void *user_data) {
  return parser_on_helo_cb(argv, argc, user_data);
}


x86 assembly (clang, -O0):
<parser_on_ehlo_cb>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <parser_on_helo_cb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_on_ehlo_cb>:
jmp    1030 <parser_on_helo_cb@plt>

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

LLVM IR (-O2):
%struct.smtp_req_arg = type { i32 }
define i32 @parser_on_ehlo_cb(%struct.smtp_req_arg* %0, i64 %1, i8* %2) {
%4 = tail call i32 @parser_on_helo_cb(%struct.smtp_req_arg* %0, i64 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
char *strindex(char *str, int ch) {
  if (str == NULL)
    return NULL;
  do {
    if (*str == ch)
      return str;
    else
      str++;
  } while (*str != '\0');
  return NULL;
}


x86 assembly (clang, -O0):
<strindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <strindex+0x23>
movq   $0x0,-0x8(%rbp)
jmp    116e <strindex+0x6e>
jmp    1128 <strindex+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1145 <strindex+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <strindex+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <strindex+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <strindex+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strindex>:
test   %rdi,%rdi
je     1123 <strindex+0x23>
mov    %rdi,%rax
mov    (%rdi),%cl
nopw   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strindex+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strindex+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strindex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* null, i8** %3
br label %28
9: ; preds = %2
br label %10
10: ; preds = %22, %9
%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 %28
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
br label %21
21: ; preds = %18
br label %22
22: ; preds = %21
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %10, label %27
27: ; preds = %22
store i8* null, i8** %3
br label %28
28: ; preds = %27, %16, %8
%29 = load i8*, i8** %3
ret i8* %29
}

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


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

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

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

LLVM IR (-O2):
define weak void @initialise_monitor_handles() {
ret void
}
void blocking_handler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @blocking_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void takeVoid(void *P) {}


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

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

LLVM IR (-O0):
define void @takeVoid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @takeVoid(i8* nocapture %0) {
ret void
}
int toLowerCase(int c) { return ((c) >= 'A' && (c) <= 'Z') ? c + 32 : c; }


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <toLowerCase+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <toLowerCase+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <toLowerCase+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowerCase>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toLowerCase(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @toLowerCase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int x_mv_bword(c)
int c;
{
  (void)x_bword();
  return 0;
}


x86 assembly (clang, -O0):
<x_mv_bword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <x_bword@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_mv_bword>:
push   %rax
xor    %eax,%eax
call   1030 <x_bword@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @x_mv_bword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @x_bword()
ret i32 0
}

LLVM IR (-O2):
define i32 @x_mv_bword(i32 %0) {
%2 = tail call i32 (...) @x_bword()
ret i32 0
}
long f(long g) {}


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

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

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ fc_sl_save(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void fc_sl_print(void *s, int nproc) { fc_sl_save(s, 0, stdout); }


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

x86 assembly (clang, -O2):
<fc_sl_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fc_sl_save@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @fc_sl_print(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* @stdout
%7 = call i32 @fc_sl_save(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @fc_sl_print(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fc_sl_save(i8* %0, i32 0, i32 %3)
ret void
}
long r(long x) { return x % (-0x7fffffffL - 1L); }


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff80000000,%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
mov    %rdi,%rax
lea    0x7fffffff(%rdi),%rcx
test   %rdi,%rdi
cmovns %rdi,%rcx
and    $0xffffffff80000000,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @r(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, -2147483648
ret i64 %4
}

LLVM IR (-O2):
define i64 @r(i64 %0) {
%2 = srem i64 %0, 2147483648
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void *unload_module(void *handle) {
  dlclose(handle);
  return NULL;
}


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

x86 assembly (clang, -O2):
<unload_module>:
push   %rax
call   1030 <dlclose@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @unload_module(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Terminal_disable_color(void) { printf("\033[0m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @Terminal_disable_color() {
%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 @Terminal_disable_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LPSPI4_DriverIRQHandler();
__attribute__((weak)) void LPSPI4_IRQHandler(void) {
  LPSPI4_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPSPI4_IRQHandler() {
%1 = call i32 (...) @LPSPI4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPSPI4_IRQHandler() {
%1 = tail call i32 (...) @LPSPI4_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ foo(int *);
int main() {
  int x = -1;
#pragma omp task inout(x) final(1)
  { foo(&x); }
#pragma omp taskwait on(x)
  assert(x == 2);
  bar(&x);
#pragma omp taskwait on(x)
  assert(x == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <foo@plt>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x8(%rbp),%rdi
call   1030 <bar@plt>
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <foo@plt>
xor    %edi,%edi
cmpl   $0x2,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
xor    %edi,%edi
cmpl   $0x4,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = call i32 @foo(i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @bar(i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 4
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @bar(i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 4
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ *solve(double const *, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
uint64_t *__WRAPPER_solve(const double *points[], uint64_t num_points,
                          uint64_t dimension, uint64_t start_index,
                          uint64_t norm_degree) {
  return solve((const double *)points, num_points, dimension, start_index,
               norm_degree);
}


x86 assembly (clang, -O0):
<__WRAPPER_solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <solve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__WRAPPER_solve>:
jmp    1030 <solve@plt>

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

LLVM IR (-O2):
define i32* @__WRAPPER_solve(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast double** %0 to double*
%7 = tail call i32* @solve(double* %6, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32* %7
}
/* Variables and functions */
char *get_mime_type(char const *);
int sprintf(char *, char *, char *);
int typeSet(char *buf, const char *type) {
  return sprintf(buf, "Content-Type: %s\n", get_mime_type(type));
}


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

x86 assembly (clang, -O2):
<typeSet>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <get_mime_type@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Content-Type: %s\0A\00"
define i32 @typeSet(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i8* @get_mime_type(i8* %1)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int dlna_get_audio_profile_ac3(int channels, int bitrate, char *profile,
                               char *mimeType) {
  strcpy(mimeType, "audio/vnd.dolby.dd-raw");
  strcpy(profile, "AC3");
  return 0;
}


x86 assembly (clang, -O0):
<dlna_get_audio_profile_ac3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"audio/vnd.dolby.dd-raw\00"
@.str.1 = [4 x i8] c"AC3\00"
define i32 @dlna_get_audio_profile_ac3(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"audio/vnd.dolby.dd-raw\00"
@.str.1 = [4 x i8] c"AC3\00"
define i32 @dlna_get_audio_profile_ac3(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__37__IO__makeInput();
void SharedAnalogDeviceP__0__EnablePin__makeInput(void) {
  HplAtm128GeneralIOPinP__37__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @SharedAnalogDeviceP__0__EnablePin__makeInput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__37__IO__makeInput()
ret void
}
/* Variables and functions */
int strlen(char const *);
int verify_string(const char *buffer) {
  return (buffer != NULL &&
          (*buffer == '\"' && buffer[strlen(buffer) - 1] == '\"'));
}


x86 assembly (clang, -O0):
<verify_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1171 <verify_string+0x61>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x22,%ecx
mov    %al,-0xa(%rbp)
jne    116b <verify_string+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_string>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <verify_string+0x25>
mov    %rdi,%rbx
cmpb   $0x22,(%rdi)
jne    1135 <verify_string+0x25>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x22,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @verify_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %22
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 34
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 34
br label %20
20: ; preds = %10, %5
%21 = phi i1 [ false, %5 ], [ %19, %10 ]
br label %22
22: ; preds = %20, %1
%23 = phi i1 [ false, %1 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @verify_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 34
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 34
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %3, %6, %1
%15 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %13, %6 ]
ret i32 %15
}
char *end_of_token(const char *s) {
  while (*s != '\0' &&
         !(((unsigned char)*s) == ' ' || ((unsigned char)*s) == '\t'))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<end_of_token>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114a <end_of_token+0x4a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <end_of_token+0x42>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <end_of_token+0x5a>
jmp    116b <end_of_token+0x6b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <end_of_token+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_of_token>:
mov    %rdi,%rax
movabs $0x100000201,%rcx
jmp    1114 <end_of_token+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <end_of_token+0x10>
bt     %rdx,%rcx
jae    1110 <end_of_token+0x10>
ret

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

LLVM IR (-O2):
define i8* @end_of_token(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int nmcadec_request_channels(int fd, int n) {
  return ioctl(fd, _IO(0xc1, 1), n);
}


x86 assembly (clang, -O0):
<nmcadec_request_channels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc1,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmcadec_request_channels>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc1,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @nmcadec_request_channels(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_IO(i32 193, i32 1)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @nmcadec_request_channels(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 193, i32 1)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}