xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ mostraplinha(char);
int /*<<< orphan*/ sprintf(char, char *);
void fraseum(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "1: Suco s/acucar");
  mostraplinha(plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<fraseum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1040 <sprintf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <mostraplinha@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fraseum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1040 <sprintf@plt>
mov    %ebp,%edi
call   1050 <mostraplinha@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"1: Suco s/acucar\00"
define void @fraseum(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @mostraplinha(i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"1: Suco s/acucar\00"
define void @fraseum(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mostraplinha(i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
scalar_t__ strtoll(char const *, char **, int);
long strtol(const char *str, char **endptr, int base) {
  return (long)strtoll(str, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtol>:
jmp    1030 <strtoll@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
long decode(char *buf, int base) {
  register long tmp = 0, pw = 1;
  register int i;
  for (i = 3; !(i < 0); i--) {
    tmp += (buf[i] - ' ') * pw;
    pw *= base;
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movl   $0x3,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
setl   %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <decode+0x38>
jmp    1171 <decode+0x71>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x20,%eax
cltq
imul   -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1122 <decode+0x22>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
movslq %esi,%rax
movsbq 0x3(%rdi),%rcx
movsbq 0x2(%rdi),%rdx
add    $0xffffffffffffffe0,%rdx
imul   %rax,%rdx
add    %rcx,%rdx
mov    %rax,%rcx
imul   %rax,%rcx
movsbq 0x1(%rdi),%rsi
add    $0xffffffffffffffe0,%rsi
imul   %rcx,%rsi
add    %rdx,%rsi
imul   %rax,%rcx
movsbq (%rdi),%rax
add    $0xffffffffffffffe0,%rax
imul   %rcx,%rax
add    %rsi,%rax
add    $0xffffffffffffffe0,%rax
ret

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

LLVM IR (-O2):
define i64 @decode(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = add nsw i64 %6, -32
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = add nsw i64 %10, -32
%12 = mul nsw i64 %11, %3
%13 = add nsw i64 %12, %7
%14 = mul nsw i64 %3, %3
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i64
%18 = add nsw i64 %17, -32
%19 = mul nsw i64 %18, %14
%20 = add nsw i64 %19, %13
%21 = mul nsw i64 %14, %3
%22 = load i8, i8* %0
%23 = sext i8 %22 to i64
%24 = add nsw i64 %23, -32
%25 = mul nsw i64 %24, %21
%26 = add nsw i64 %25, %20
ret i64 %26
}
_Bool foo(_Bool a, _Bool b, _Bool c) {
  _Bool r1 = a == 0 & b != 0;
  _Bool r2 = b != 0 & c == 0;
  return (r1 == 0 & r2 == 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
and    $0x1,%dl
mov    %dl,-0x1(%rbp)
and    $0x1,%cl
mov    %cl,-0x2(%rbp)
and    $0x1,%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x2(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x4(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x3(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x5(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
xor    $0x1,%sil
and    %edx,%eax
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i1 @foo(i1 zeroext %0, i1 zeroext %1, i1 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = zext i1 %0 to i8
store i8 %9, i8* %4
%10 = zext i1 %1 to i8
store i8 %10, i8* %5
%11 = zext i1 %2 to i8
store i8 %11, i8* %6
%12 = load i8, i8* %4
%13 = trunc i8 %12 to i1
%14 = zext i1 %13 to i32
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = load i8, i8* %5
%18 = trunc i8 %17 to i1
%19 = zext i1 %18 to i32
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i32
%22 = and i32 %16, %21
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i8
store i8 %24, i8* %7
%25 = load i8, i8* %5
%26 = trunc i8 %25 to i1
%27 = zext i1 %26 to i32
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i32
%30 = load i8, i8* %6
%31 = trunc i8 %30 to i1
%32 = zext i1 %31 to i32
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = and i32 %29, %34
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i8
store i8 %37, i8* %8
%38 = load i8, i8* %7
%39 = trunc i8 %38 to i1
%40 = zext i1 %39 to i32
%41 = icmp eq i32 %40, 0
%42 = zext i1 %41 to i32
%43 = load i8, i8* %8
%44 = trunc i8 %43 to i1
%45 = zext i1 %44 to i32
%46 = icmp eq i32 %45, 0
%47 = zext i1 %46 to i32
%48 = and i32 %42, %47
%49 = icmp ne i32 %48, 0
ret i1 %49
}

LLVM IR (-O2):
define zeroext i1 @foo(i1 zeroext %0, i1 zeroext %1, i1 zeroext %2) {
%4 = xor i1 %1, true
%5 = and i1 %0, %2
%6 = or i1 %5, %4
ret i1 %6
}
/* Variables and functions */
int ci_send_obj(int, int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int ci_enter_menu(int fd, int slot) {
  int re;
  ci_send_obj(fd, 0x9F8800, NULL, 0);
  re = ci_send_obj(fd, 0x9F8022, NULL, 0);
  sleep(3);
  return re;
}


x86 assembly (clang, -O0):
<ci_enter_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9f8800,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ci_send_obj@plt>
mov    -0x4(%rbp),%edi
mov    $0x9f8022,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ci_send_obj@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ci_enter_menu>:
push   %rbx
mov    %edi,%ebx
mov    $0x9f8800,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ci_send_obj@plt>
mov    %ebx,%edi
mov    $0x9f8022,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ci_send_obj@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ci_enter_menu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @ci_send_obj(i32 %6, i32 10455040, i32* null, i32 0)
%8 = load i32, i32* %3
%9 = call i32 @ci_send_obj(i32 %8, i32 10453026, i32* null, i32 0)
store i32 %9, i32* %5
%10 = call i32 @sleep(i32 3)
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @ci_enter_menu(i32 %0, i32 %1) {
%3 = tail call i32 @ci_send_obj(i32 %0, i32 10455040, i32* null, i32 0)
%4 = tail call i32 @ci_send_obj(i32 %0, i32 10453026, i32* null, i32 0)
%5 = tail call i32 @sleep(i32 3)
ret i32 %4
}
double colordifference_ch(const double x, const double y, const double alphas) {
  const double black = x - y, white = black + alphas;
  return black * black + white * white;
}


x86 assembly (clang, -O0):
<colordifference_ch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<colordifference_ch>:
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @colordifference_ch(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fadd double %12, %13
store double %14, double* %8
%15 = load double, double* %7
%16 = load double, double* %7
%17 = load double, double* %8
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
ret double %20
}

LLVM IR (-O2):
define double @colordifference_ch(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fadd double %4, %2
%6 = fmul double %5, %5
%7 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void thirdNum() {
  printf("\n\nNow I print every third number from 1000  to 0:\n");
  for (int i = 1000; i >= 0; i--) {
    printf("\n%d", i);
    i = i - 2;
  }
}


x86 assembly (clang, -O0):
<thirdNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3e8,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     115f <thirdNum+0x4f>
mov    -0x4(%rbp),%esi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <thirdNum+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thirdNum>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3eb,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
add    $0xfffffffd,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%ebx
ja     1140 <thirdNum+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"\0A\0ANow I print every third number from 1000 to 0:\0A\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define void @thirdNum() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
store i32 1000, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = sub nsw i32 %9, 2
store i32 %10, i32* %1
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"\0A%d\00"
@str = [50 x i8] c"\0A\0ANow I print every third number from 1000 to 0:\00"
define void @thirdNum() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %3
2: ; preds = %3
ret void
3: ; preds = %0, %3
%4 = phi i32 [ 1000, %0 ], [ %6, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -3
%7 = icmp ugt i32 %4, 2
br i1 %7, label %3, label %2
}
__attribute__((noreturn)) void f(__attribute__((noreturn)) void (*x)(void)) {
  x();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)

x86 assembly (clang, -O2):
<f>:
push   %rax
call   *%rdi

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

LLVM IR (-O2):
define void @f(void ()* nocapture %0) {
tail call void %0()
unreachable
}
const char *zlibVersion() { return "1.2.3-ossec"; }


x86 assembly (clang, -O0):
<zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"1.2.3-ossec\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"1.2.3-ossec\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char tolower(char);
void minuscola(char *s) {
  for (; *s; s++)
    *s = tolower(*s);
}


x86 assembly (clang, -O0):
<minuscola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <minuscola+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <minuscola+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscola>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <minuscola+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <minuscola+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @minuscola(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
size_t enough_capacity(size_t size) {
  size_t capacity = 1;
  while (capacity < size) {
    capacity *= 2;
  }
  return capacity;
}


x86 assembly (clang, -O0):
<enough_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <enough_capacity+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <enough_capacity+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enough_capacity>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <enough_capacity+0x10>
ret

LLVM IR (-O0):
define i64 @enough_capacity(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 2
store i64 %10, i64* %3
br label %4
11: ; preds = %4
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @enough_capacity(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void fn(void (*cb)()) {
  printf("HELLO\n");
  fflush(stdout);
  cb();
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
@stdout = global i32 0
@str = [6 x i8] c"HELLO\00"
define void @fn(void (...)* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main(void) {
  int i;
  for (i = 100; i <= 200; i++) {
    if (i % 3 == 0)
      continue;
    printf("%d ", i);
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     1179 <main+0x59>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <main+0x3c>
jmp    116b <main+0x4b>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x64,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0xc9,%ebx
je     116c <main+0x4c>
movzbl %bl,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %cl,%al
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 200
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %14
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
%18 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 100, %0 ], [ %9, %8 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 3
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %1, %6
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 201
br i1 %10, label %11, label %1
11: ; preds = %8
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
main() {
  char name[25];
  puts("Enter your name [Max: 25]: ");
  fflush(stdin);
  gets(name);
  puts("Hello. How are you?");
  puts(name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x20(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter your name [Max: 25]: \00"
@stdin = global i32 0
@.str.1 = [20 x i8] c"Hello. How are you?\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call i32 @fflush(i32 %3)
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter your name [Max: 25]: \00"
@stdin = global i32 0
@.str.1 = [20 x i8] c"Hello. How are you?\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @fflush(i32 %4)
%6 = call i32 @gets(i8* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
struct typed_value {
  int dummy;
};
struct prefix {
  int dummy;
};
struct key_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_map_sym_push_value(struct key_value *,
                                           struct typed_value *);
struct key_value *prefix_make_value_binding(struct prefix *, char *, int);
void prefix_def_value(struct prefix *self, char *name, int name_len,
                      struct typed_value *value) {
  struct key_value *binding = prefix_make_value_binding(self, name, name_len);
  hash_map_sym_push_value(binding, value);
}


x86 assembly (clang, -O0):
<prefix_def_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <prefix_make_value_binding@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <hash_map_sym_push_value@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_def_value>:
push   %rbx
mov    %rcx,%rbx
call   1030 <prefix_make_value_binding@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <hash_map_sym_push_value@plt>

LLVM IR (-O0):
%struct.prefix = type { i32 }
%struct.typed_value = type { i32 }
%struct.key_value = type { i32 }
define void @prefix_def_value(%struct.prefix* %0, i8* %1, i32 %2, %struct.typed_value* %3) {
%5 = alloca %struct.prefix*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.typed_value*
%9 = alloca %struct.key_value*
store %struct.prefix* %0, %struct.prefix** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.typed_value* %3, %struct.typed_value** %8
%10 = load %struct.prefix*, %struct.prefix** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call %struct.key_value* @prefix_make_value_binding(%struct.prefix* %10, i8* %11, i32 %12)
store %struct.key_value* %13, %struct.key_value** %9
%14 = load %struct.key_value*, %struct.key_value** %9
%15 = load %struct.typed_value*, %struct.typed_value** %8
%16 = call i32 @hash_map_sym_push_value(%struct.key_value* %14, %struct.typed_value* %15)
ret void
}

LLVM IR (-O2):
%struct.prefix = type { i32 }
%struct.typed_value = type { i32 }
%struct.key_value = type { i32 }
define void @prefix_def_value(%struct.prefix* %0, i8* %1, i32 %2, %struct.typed_value* %3) {
%5 = tail call %struct.key_value* @prefix_make_value_binding(%struct.prefix* %0, i8* %1, i32 %2)
%6 = tail call i32 @hash_map_sym_push_value(%struct.key_value* %5, %struct.typed_value* %3)
ret void
}
/* Type definitions */
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LexGetRawToken(struct ParseState *, int /*<<< orphan*/, int);
void LexHashIncPos(struct ParseState *Parser, int IncPos) {
  if (!IncPos)
    LexGetRawToken(Parser, 0, 1);
}


x86 assembly (clang, -O0):
<LexHashIncPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1139 <LexHashIncPos+0x29>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <LexGetRawToken@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LexHashIncPos>:
test   %esi,%esi
je     1115 <LexHashIncPos+0x5>
ret
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <LexGetRawToken@plt>

LLVM IR (-O0):
%struct.ParseState = type { i32 }
define void @LexHashIncPos(%struct.ParseState* %0, i32 %1) {
%3 = alloca %struct.ParseState*
%4 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load %struct.ParseState*, %struct.ParseState** %3
%9 = call i32 @LexGetRawToken(%struct.ParseState* %8, i32 0, i32 1)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
define void @LexHashIncPos(%struct.ParseState* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @LexGetRawToken(%struct.ParseState* %0, i32 0, i32 1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogResetDisable(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<WatchdogResetDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogResetDisable+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogResetDisable>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffffffd,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogResetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 8
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, -3
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogResetDisable(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -3
store volatile i64 %9, i64* %7
ret void
}
int getTriangular(int n) {
  if (n < 1)
    return 0;
  else
    return n + getTriangular(n - 1);
}


x86 assembly (clang, -O0):
<getTriangular>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <getTriangular+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <getTriangular+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <getTriangular@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTriangular>:
test   %edi,%edi
jle    1119 <getTriangular+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getTriangular(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int v = 300;
  int s = 0;
  scanf("%d", &s);
  printf("%d", s / 300);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12c,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x12c,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x1b4e81b5,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 300
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int machineEndianness() {
  long int i = 1;
  const char *p = (const char *)&i;
  if (p[0] == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<machineEndianness>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1130 <machineEndianness+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <machineEndianness+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @machineEndianness() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i64 1, i64* %2
%4 = bitcast i64* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %1
br label %12
11: ; preds = %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @machineEndianness() {
ret i32 0
}
unsigned long sdbm(str)
unsigned char *str;
{
  unsigned long hash = 0;
  int c;
  while (c = *str++)
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <sdbm+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdbm+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <sdbm+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sdbm(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 i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
int prec(char a) {
  switch (a) {
  case '+':
    return 1;
  case '-':
    return 1;
  case '*':
    return 2;
  case '/':
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<prec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1164 <prec+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116b <prec+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <prec+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <prec+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <prec+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prec>:
add    $0xffffffd6,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <prec+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @prec(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 43, label %6
i32 45, label %7
i32 42, label %8
i32 47, label %9
]
6: ; preds = %1
store i32 1, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 2, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.prec = [6 x i32] [i32 2, i32 1, i32 -1, i32 1, i32 -1, i32 2]
define i32 @prec(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -42
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.prec, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
const char *Current_Name(void) { return "Current"; }


x86 assembly (clang, -O0):
<Current_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Current_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Current\00"
define i8* @Current_Name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Current\00"
define i8* @Current_Name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
void function_empty_est_date_end() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_est_date_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPTLerror(char *, char const *);
double utr_nanotime() {
  static const char *thisfunc = "utr_nanotime";
  (void)GPTLerror("%s: not enabled\n", thisfunc);
  return -1.;
}


x86 assembly (clang, -O0):
<utr_nanotime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xef3(%rip),%rdi
call   1030 <GPTLerror@plt>
movsd  0xed1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utr_nanotime>:
push   %rax
lea    0xefd(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <GPTLerror@plt>
movsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@utr_nanotime.thisfunc = internal global i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)
@.str = [13 x i8] c"utr_nanotime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_nanotime() {
%1 = load i8*, i8** @utr_nanotime.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret double -1.000000e+00
}

LLVM IR (-O2):
@.str = [13 x i8] c"utr_nanotime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_nanotime() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret double -1.000000e+00
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_set_type_of_mixture(int r, int *mix) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(91, &r, mix, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_set_type_of_mixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5b,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_set_type_of_mixture>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x5b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_set_type_of_mixture(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 91, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_set_type_of_mixture(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 91, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
int do_417() { return 417; }


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

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

LLVM IR (-O0):
define i32 @do_417() {
ret i32 417
}

LLVM IR (-O2):
define i32 @do_417() {
ret i32 417
}
/* Type definitions */
struct mstats_base {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mstats_base_incrs(struct mstats_base *, int, int);
void mstats_base_incr(struct mstats_base *stb, int key) {
  mstats_base_incrs(stb, key, 1);
}


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

x86 assembly (clang, -O2):
<mstats_base_incr>:
mov    $0x1,%edx
jmp    1030 <mstats_base_incrs@plt>

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

LLVM IR (-O2):
%struct.mstats_base = type { i32 }
define void @mstats_base_incr(%struct.mstats_base* %0, i32 %1) {
%3 = tail call i32 @mstats_base_incrs(%struct.mstats_base* %0, i32 %1, i32 1)
ret void
}
void x87_set_control_word(unsigned short mode) {
  __asm__ __volatile__("fldcw %0" : : "m"(*&mode));
}


x86 assembly (clang, -O0):
<x87_set_control_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
fldcw  -0x2(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<x87_set_control_word>:
mov    %di,-0x2(%rsp)
fldcw  -0x2(%rsp)
ret

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

LLVM IR (-O2):
define void @x87_set_control_word(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/);
int my_dup(int fd) {
  int new_fd;
  new_fd = fcntl(fd, F_DUPFD);
  return new_fd;
}


x86 assembly (clang, -O0):
<my_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_dup>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @my_dup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_DUPFD
%6 = call i32 @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @my_dup(i32 %0) {
%2 = load i32, i32* @F_DUPFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
ret i32 %3
}
unsigned myrem(unsigned x, unsigned y) {
  return (unsigned)((signed)x % (signed)y);
}


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

x86 assembly (clang, -O2):
<myrem>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @myrem(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @myrem(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int main() { _Static_assert(1, "in function"); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *_gpgme_mailbox_from_userid(char const *);
char *gpgme_addrspec_from_uid(const char *uid) {
  return _gpgme_mailbox_from_userid(uid);
}


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

x86 assembly (clang, -O2):
<gpgme_addrspec_from_uid>:
jmp    1030 <_gpgme_mailbox_from_userid@plt>

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

LLVM IR (-O2):
define i8* @gpgme_addrspec_from_uid(i8* %0) {
%2 = tail call i8* @_gpgme_mailbox_from_userid(i8* %0)
ret i8* %2
}