xunge/DecIR huggingface dataset:
/* Variables and functions */
long strtol(char const *, char **, int /*<<< orphan*/);
long int getnum(const char *buf, int *succ) {
  char *endptr;
  long int val = strtol(buf, &endptr, 0);
  if (*endptr && *endptr != '\n') {
    *succ = 0;
    return 0;
  } else {
    *succ = 1;
    return val;
  }
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116a <getnum+0x5a>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     116a <getnum+0x5a>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    117c <getnum+0x6c>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsp,%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
mov    (%rcx),%cl
cmp    $0xa,%cl
je     1132 <getnum+0x22>
test   %cl,%cl
jne    1139 <getnum+0x29>
mov    $0x1,%ebx
jmp    113b <getnum+0x2b>
xor    %eax,%eax
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @getnum(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
switch i8 %7, label %9 [
i8 0, label %8
i8 10, label %8
]
8: ; preds = %2, %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 0, %2 ]
%11 = phi i64 [ %5, %8 ], [ 0, %2 ]
store i32 %10, i32* %1
ret i64 %11
}
/* Variables and functions */
double get_cpu_clock_speed();
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("CPU clock speed: %4.0f MHz\n", get_cpu_clock_speed());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"CPU clock speed: %4.0f MHz\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (...) @get_cpu_clock_speed()
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"CPU clock speed: %4.0f MHz\0A\00"
define i32 @main() {
%1 = tail call double (...) @get_cpu_clock_speed()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function(char *);
int main(int argc, char **argv) {
  function(argv[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <function@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @function(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @function(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Led_turnOffAll();
int /*<<< orphan*/ Led_turnOnAll();
int /*<<< orphan*/ delay(unsigned int const);
void Led_flashAll(const unsigned int nanosecs) {
  Led_turnOnAll();
  delay(nanosecs);
  Led_turnOffAll();
}


x86 assembly (clang, -O0):
<Led_flashAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Led_turnOnAll@plt>
mov    -0x4(%rbp),%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1030 <Led_turnOffAll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Led_flashAll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <Led_turnOnAll@plt>
mov    %ebx,%edi
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <Led_turnOffAll@plt>

LLVM IR (-O0):
define void @Led_flashAll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Led_turnOnAll()
%4 = load i32, i32* %2
%5 = call i32 @delay(i32 %4)
%6 = call i32 (...) @Led_turnOffAll()
ret void
}

LLVM IR (-O2):
define void @Led_flashAll(i32 %0) {
%2 = tail call i32 (...) @Led_turnOnAll()
%3 = tail call i32 @delay(i32 %0)
%4 = tail call i32 (...) @Led_turnOffAll()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int fwrite(char const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void output_buf(const char *buf, int len) {
  int ret = fwrite(buf, 1, len, stdout);
  if (ret != len)
    die("fwrite failed\n");
}


x86 assembly (clang, -O0):
<output_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1164 <output_buf+0x44>
lea    0xea1(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_buf>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    %ebx,%edx
call   1040 <fwrite@plt>
cmp    %ebx,%eax
jne    113e <output_buf+0x1e>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1030 <die@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"fwrite failed\0A\00"
define void @output_buf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32 %3)
%5 = icmp eq i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
void interchange(int u, int v) {
  int temp;
  temp = u;
  u = v;
  v = temp;
}


x86 assembly (clang, -O0):
<interchange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @interchange(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
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @interchange(i32 %0, i32 %1) {
ret void
}
int main(void) {
  int *p;
  int b = 3;
  p = 0;
  p[2] = b;
  return p[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x3,0x8
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %3
store i32* null, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 2
store i32 %4, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
store i32 3, i32* inttoptr (i64 8 to i32*)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ assert_context_process();
void schedule(void) {
  {
    { assert_context_process(); }
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @schedule() {
%1 = tail call i32 (...) @assert_context_process()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int stat(const char *file, struct stat *st) { svcPanic(); }


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Type definitions */
struct termios {
  int dummy;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int cfsetspeed(struct termios *, int /*<<< orphan*/);
int cfsetospeed(struct termios *p, speed_t s) { return cfsetspeed(p, s); }


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

x86 assembly (clang, -O2):
<cfsetospeed>:
jmp    1030 <cfsetspeed@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfsetospeed(%struct.termios* %0, i32 %1) {
%3 = alloca %struct.termios*
%4 = alloca i32
store %struct.termios* %0, %struct.termios** %3
store i32 %1, i32* %4
%5 = load %struct.termios*, %struct.termios** %3
%6 = load i32, i32* %4
%7 = call i32 @cfsetspeed(%struct.termios* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfsetospeed(%struct.termios* %0, i32 %1) {
%3 = tail call i32 @cfsetspeed(%struct.termios* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int pow(double, int);
double tilex2long(int x, int z) { return x / pow(2.0, z) * 360.0 - 180; }


x86 assembly (clang, -O0):
<tilex2long>:
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    -0x8(%rbp),%edi
movsd  0xee1(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tilex2long>:
push   %rbx
mov    %edi,%ebx
movsd  0xee5(%rip),%xmm0
mov    %esi,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed0(%rip),%xmm0
addsd  0xed0(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @tilex2long(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @pow(double 2.000000e+00, i32 %6)
%8 = sdiv i32 %5, %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 3.600000e+02, double -1.800000e+02)
ret double %10
}

LLVM IR (-O2):
define double @tilex2long(i32 %0, i32 %1) {
%3 = tail call i32 @pow(double 2.000000e+00, i32 %1)
%4 = sdiv i32 %0, %3
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 3.600000e+02, double -1.800000e+02)
ret double %6
}
void inc_array_by_ptr(int (*arr)[4]) {
  (*arr)[0] = (*arr)[0] + 1;
  (*arr)[1] = (*arr)[1] + 1;
  (*arr)[2] = (*arr)[2] + 1;
  (*arr)[3] = (*arr)[3] + 1;
}


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

x86 assembly (clang, -O2):
<inc_array_by_ptr>:
movdqu (%rdi),%xmm0
pcmpeqd %xmm1,%xmm1
psubd  %xmm1,%xmm0
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @inc_array_by_ptr([4 x i32]* %0) {
%2 = alloca [4 x i32]*
store [4 x i32]* %0, [4 x i32]** %2
%3 = load [4 x i32]*, [4 x i32]** %2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = load [4 x i32]*, [4 x i32]** %2
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 %6, i32* %8
%9 = load [4 x i32]*, [4 x i32]** %2
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = load [4 x i32]*, [4 x i32]** %2
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
store i32 %12, i32* %14
%15 = load [4 x i32]*, [4 x i32]** %2
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 2
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
%19 = load [4 x i32]*, [4 x i32]** %2
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %19, i64 0, i64 2
store i32 %18, i32* %20
%21 = load [4 x i32]*, [4 x i32]** %2
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %21, i64 0, i64 3
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
%25 = load [4 x i32]*, [4 x i32]** %2
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @inc_array_by_ptr([4 x i32]* nocapture %0) {
%2 = bitcast [4 x i32]* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast [4 x i32]* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}
/* Variables and functions */
int longest_increasing_subsequence(char *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strlen(char *);
int main() {
  char buffer[51];
  scanf("%s", buffer);
  printf("%d\n",
         26 - longest_increasing_subsequence(buffer, (int)strlen(buffer)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
call   1060 <longest_increasing_subsequence@plt>
mov    $0x1a,%esi
sub    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <longest_increasing_subsequence@plt>
mov    $0x1a,%esi
sub    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [51 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
%9 = call i32 @longest_increasing_subsequence(i8* %5, i32 %8)
%10 = sub nsw i32 26, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [51 x i8]
%2 = getelementptr inbounds [51 x i8], [51 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strlen(i8* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @longest_increasing_subsequence(i8* %2, i32 %5)
%7 = sub nsw i32 26, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
int is_comp(char c) {
  return ((c == '=') | (c == '<') | (c == '>') | (c == '~') | (c == '{') |
          (c == '}') | (c == '#') | (c == '%'));
}


x86 assembly (clang, -O0):
<is_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x3c,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x3e,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x7e,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x7b,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x7d,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x23,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
movsbl -0x1(%rbp),%ecx
cmp    $0x25,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comp>:
mov    %edi,%eax
movd   %edi,%xmm0
mov    %edi,%ecx
and    $0xfe,%cl
cmp    $0x3c,%cl
sete   %cl
and    $0xbf,%al
cmp    $0x3e,%al
sete   %al
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pcmpeqb 0xed7(%rip),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%edx
test   %edx,%edx
setne  %dl
or     %cl,%al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_comp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 61
%6 = zext i1 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 60
%10 = zext i1 %9 to i32
%11 = or i32 %6, %10
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 62
%15 = zext i1 %14 to i32
%16 = or i32 %11, %15
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 126
%20 = zext i1 %19 to i32
%21 = or i32 %16, %20
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 123
%25 = zext i1 %24 to i32
%26 = or i32 %21, %25
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 125
%30 = zext i1 %29 to i32
%31 = or i32 %26, %30
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 35
%35 = zext i1 %34 to i32
%36 = or i32 %31, %35
%37 = load i8, i8* %2
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 37
%40 = zext i1 %39 to i32
%41 = or i32 %36, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @is_comp(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 60
%4 = and i8 %0, -65
%5 = icmp eq i8 %4, 62
%6 = insertelement <4 x i8> poison, i8 %0, i64 0
%7 = shufflevector <4 x i8> %6, <4 x i8> poison, <4 x i32> zeroinitializer
%8 = icmp eq <4 x i8> %7, <i8 37, i8 35, i8 125, i8 123>
%9 = bitcast <4 x i1> %8 to i4
%10 = icmp ne i4 %9, 0
%11 = or i1 %10, %5
%12 = or i1 %11, %3
%13 = zext i1 %12 to i32
ret i32 %13
}
int cas_int(int *addr, int oldval, int newval) {
  return __sync_bool_compare_and_swap(addr, oldval, newval);
}


x86 assembly (clang, -O0):
<cas_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cas_int>:
mov    %esi,%eax
xor    %ecx,%ecx
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cas_int(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cas_int(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void ResetRobot(struct Robot *robot) {}


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

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

LLVM IR (-O0):
%struct.Robot = type opaque
define void @ResetRobot(%struct.Robot* %0) {
%2 = alloca %struct.Robot*
store %struct.Robot* %0, %struct.Robot** %2
ret void
}

LLVM IR (-O2):
%struct.Robot = type opaque
define void @ResetRobot(%struct.Robot* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StartUpFTP();
int /*<<< orphan*/ neteventinit();
int /*<<< orphan*/ networkUPPinit();
void initnet(void) {
  neteventinit();
  networkUPPinit();
  StartUpFTP();
}


x86 assembly (clang, -O0):
<initnet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <neteventinit@plt>
mov    $0x0,%al
call   1030 <networkUPPinit@plt>
mov    $0x0,%al
call   1050 <StartUpFTP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initnet>:
push   %rax
xor    %eax,%eax
call   1040 <neteventinit@plt>
xor    %eax,%eax
call   1030 <networkUPPinit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <StartUpFTP@plt>

LLVM IR (-O0):
define void @initnet() {
%1 = call i32 (...) @neteventinit()
%2 = call i32 (...) @networkUPPinit()
%3 = call i32 (...) @StartUpFTP()
ret void
}

LLVM IR (-O2):
define void @initnet() {
%1 = tail call i32 (...) @neteventinit()
%2 = tail call i32 (...) @networkUPPinit()
%3 = tail call i32 (...) @StartUpFTP()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
off_t getfilesize(FILE *f) {
  struct stat xstat;
  fstat(fileno(f), &xstat);
  return xstat.st_size;
}


x86 assembly (clang, -O0):
<getfilesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilesize>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getfilesize(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.stat
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fileno(i32* %4)
%6 = call i32 @fstat(i32 %5, %struct.stat* %3)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getfilesize(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_collate {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_collate *_Locale_collate_create(const char *name,
                                               struct _Locale_name_hint *hint
                                               __attribute__((__unused__)),
                                               int *__err_code) {
  return (struct _Locale_collate *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_collate_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

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

LLVM IR (-O2):
%struct._Locale_collate = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_collate* @_Locale_collate_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_collate*
ret %struct._Locale_collate* %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ min_width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_min_width(void *_p) {
  return (int)((XSizeHints *)_p)->min_width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_min_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_min_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: vm [options] IMAGE\n"
                  "Available options are:\n"
                  "  -d       Set breakpoint at startup\n"
                  "  -e       Echo inputs\n"
                  "  -t       Start with trace enabled\n");
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [146 x i8] c"Usage: vm [options] IMAGE\0AAvailable options are:\0A -d Set breakpoint at startup\0A -e Echo inputs\0A -t Start with trace enabled\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [146 x i8] c"Usage: vm [options] IMAGE\0AAvailable options are:\0A -d Set breakpoint at startup\0A -e Echo inputs\0A -t Start with trace enabled\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gu1_delay_approximate(unsigned long);
void gfx_delay_milliseconds(unsigned long milliseconds) {
  gu1_delay_approximate(milliseconds);
}


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

x86 assembly (clang, -O2):
<gfx_delay_milliseconds>:
jmp    1030 <gu1_delay_approximate@plt>

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

LLVM IR (-O2):
define void @gfx_delay_milliseconds(i64 %0) {
%2 = tail call i32 @gu1_delay_approximate(i64 %0)
ret void
}
/* Variables and functions */
void Default_PWM1_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Default_PWM1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t mulModAdd(uint32_t a, uint32_t b, uint32_t c, uint32_t m) {
  return (uint32_t)(((uint64_t)a * b + c) % m);
}


x86 assembly (clang, -O0):
<mulModAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulModAdd>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mulModAdd(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = srem i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @mulModAdd(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = srem i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int EINVAL;
char *cpufreq_get_driver(unsigned int);
int /*<<< orphan*/ cpufreq_put_driver(char *);
int /*<<< orphan*/ printf(char *, char *);
int get_driver(unsigned int cpu) {
  char *driver = cpufreq_get_driver(cpu);
  if (!driver)
    return -EINVAL;
  printf("%s\n", driver);
  cpufreq_put_driver(driver);
  return 0;
}


x86 assembly (clang, -O0):
<get_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <cpufreq_get_driver@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1165 <get_driver+0x35>
xor    %eax,%eax
mov    0x2e85(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <get_driver+0x55>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <cpufreq_put_driver@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_driver>:
push   %rbx
call   1030 <cpufreq_get_driver@plt>
test   %rax,%rax
je     1159 <get_driver+0x29>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <cpufreq_put_driver@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e80(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @get_driver(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i8* @cpufreq_get_driver(i32 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* @EINVAL
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @cpufreq_put_driver(i8* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %12, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@EINVAL = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @get_driver(i32 %0) {
%2 = tail call i8* @cpufreq_get_driver(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
br label %10
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = tail call i32 @cpufreq_put_driver(i8* %2)
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ 0, %7 ], [ %6, %4 ]
ret i32 %11
}
/* Variables and functions */
int g(long long);
int callg(void) {
  long long n = ~0u;
  return g(n + 1);
}


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

x86 assembly (clang, -O2):
<callg>:
movabs $0x100000000,%rdi
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @callg() {
%1 = alloca i64
store i64 4294967295, i64* %1
%2 = load i64, i64* %1
%3 = add nsw i64 %2, 1
%4 = call i32 @g(i64 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @callg() {
%1 = tail call i32 @g(i64 4294967296)
ret i32 %1
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_bezier3(float *, float *, float *, float *, float);
__attribute__((always_)) struct vec3 *psvec3_bezier3(struct vec3 *result,
                                                     struct vec3 *a,
                                                     struct vec3 *b,
                                                     struct vec3 *c, float p) {
  vec3_bezier3((float *)result, (float *)a, (float *)b, (float *)c, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec3_bezier3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movss  -0x24(%rbp),%xmm0
call   1030 <vec3_bezier3@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3_bezier3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_bezier3@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_bezier3(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2, %struct.vec3* %3, float %4) {
%6 = alloca %struct.vec3*
%7 = alloca %struct.vec3*
%8 = alloca %struct.vec3*
%9 = alloca %struct.vec3*
%10 = alloca float
store %struct.vec3* %0, %struct.vec3** %6
store %struct.vec3* %1, %struct.vec3** %7
store %struct.vec3* %2, %struct.vec3** %8
store %struct.vec3* %3, %struct.vec3** %9
store float %4, float* %10
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = load %struct.vec3*, %struct.vec3** %7
%14 = bitcast %struct.vec3* %13 to float*
%15 = load %struct.vec3*, %struct.vec3** %8
%16 = bitcast %struct.vec3* %15 to float*
%17 = load %struct.vec3*, %struct.vec3** %9
%18 = bitcast %struct.vec3* %17 to float*
%19 = load float, float* %10
%20 = call i32 @vec3_bezier3(float* %12, float* %14, float* %16, float* %18, float %19)
%21 = load %struct.vec3*, %struct.vec3** %6
ret %struct.vec3* %21
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_bezier3(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2, %struct.vec3* %3, float %4) {
%6 = bitcast %struct.vec3* %0 to float*
%7 = bitcast %struct.vec3* %1 to float*
%8 = bitcast %struct.vec3* %2 to float*
%9 = bitcast %struct.vec3* %3 to float*
%10 = tail call i32 @vec3_bezier3(float* %6, float* %7, float* %8, float* %9, float %4)
ret %struct.vec3* %0
}
/* Variables and functions */
int __builtin_inb(int);
int /*<<< orphan*/ __builtin_outb(int, int);
void main(void) {
  int i;
  i = __builtin_inb(0x1234);
  if (i == 23) {
    for (;;) {
      int j;
      j = __builtin_inb(0xabcd);
      __builtin_outb(j, 0xef90);
    }
  }
  __builtin_outb(i, 0x5678);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x17,-0x4(%rbp)
jne    1163 <main+0x43>
jmp    1144 <main+0x24>
mov    $0xabcd,%edi
call   1030 <__builtin_inb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xef90,%esi
call   1040 <__builtin_outb@plt>
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%edi
mov    $0x5678,%esi
call   1040 <__builtin_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
cmp    $0x17,%eax
jne    1148 <main+0x28>
mov    $0xabcd,%edi
call   1030 <__builtin_inb@plt>
mov    %eax,%edi
mov    $0xef90,%esi
call   1040 <__builtin_outb@plt>
jmp    1130 <main+0x10>
mov    %eax,%edi
mov    $0x5678,%esi
pop    %rax
jmp    1040 <__builtin_outb@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @__builtin_inb(i32 4660)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 23
br i1 %5, label %6, label %11
6: ; preds = %0
br label %7
7: ; preds = %7, %6
%8 = call i32 @__builtin_inb(i32 43981)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @__builtin_outb(i32 %9, i32 61328)
br label %7
11: ; preds = %0
%12 = load i32, i32* %1
%13 = call i32 @__builtin_outb(i32 %12, i32 22136)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__builtin_inb(i32 4660)
%2 = icmp eq i32 %1, 23
br i1 %2, label %3, label %6
3: ; preds = %0, %3
%4 = tail call i32 @__builtin_inb(i32 43981)
%5 = tail call i32 @__builtin_outb(i32 %4, i32 61328)
br label %3
6: ; preds = %0
%7 = tail call i32 @__builtin_outb(i32 %1, i32 22136)
ret void
}
int I(int x, int y, int cols) {
  int index = (y * cols) + x;
  return index;
}


x86 assembly (clang, -O0):
<I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @I(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @I(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
__float128 from_sign_short_load_n(short *a, long n) { return (__float128)a[n]; }


x86 assembly (clang, -O0):
<from_sign_short_load_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
movswl %ax,%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<from_sign_short_load_n>:
push   %rax
movswl (%rdi,%rsi,2),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_sign_short_load_n(i16* %0, i64 %1) {
%3 = alloca i16*
%4 = alloca i64
store i16* %0, i16** %3
store i64 %1, i64* %4
%5 = load i16*, i16** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i16, i16* %5, i64 %6
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to fp128
ret fp128 %9
}

LLVM IR (-O2):
define fp128 @from_sign_short_load_n(i16* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 %1
%4 = load i16, i16* %3
%5 = sitofp i16 %4 to fp128
ret fp128 %5
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfungt(long double a, long double b) {
  return (_U_Qfcmp(a, b, 1 | 2 | 16) != 0);
}


x86 assembly (clang, -O0):
<_U_Qfungt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x13,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfungt>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    $0x13,%edi
call   1030 <_U_Qfcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfungt(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @_U_Qfcmp(x86_fp80 %5, x86_fp80 %6, i32 19)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_U_Qfungt(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 19)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
float MAX(float r, float g, float b) {
  float tmp;
  if (r > g) {
    tmp = r;
  } else {
    tmp = g;
  }
  if (tmp > b) {
    return (tmp);
  } else {
    return (b);
  }
}


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <MAX+0x31>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    113b <MAX+0x3b>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1159 <MAX+0x59>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <MAX+0x63>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
maxss  %xmm1,%xmm0
maxss  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @MAX(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = select i1 %4, float %0, float %1
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %5, float %2
ret float %7
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *str_append_char(const char *str, char c) {
  size_t len = strlen(str);
  char *new_str = malloc(len + 2);
  strcpy(new_str, str);
  new_str[len] = c;
  new_str[len + 1] = '\0';
  return new_str;
}


x86 assembly (clang, -O0):
<str_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x9(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_append_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbp
lea    0x2(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r14b,(%rbx,%rbp,1)
movb   $0x0,0x1(%rbx,%rbp,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @str_append_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = add i64 %9, 2
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8, i8* %4
%16 = load i8*, i8** %6
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
%19 = load i8*, i8** %6
%20 = load i64, i64* %5
%21 = add i64 %20, 1
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
define i8* @str_append_char(i8* %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 2
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 %1, i8* %7
%8 = add i64 %3, 1
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret i8* %5
}