xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int ferror(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
scalar_t__ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  assert(fputc('x', stdin) < 0);
  fflush(NULL);
  assert(ferror(stdin));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    $0x78,%edi
call   1040 <fputc@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <fflush@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%esi
mov    $0x78,%edi
call   1040 <fputc@plt>
shr    $0x3f,%rax
mov    %eax,%edi
call   1050 <assert@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
mov    (%rbx),%edi
call   1030 <ferror@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i64 @fputc(i8 signext 120, i32 %2)
%4 = icmp slt i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @fflush(i32* null)
%8 = load i32, i32* @stdin
%9 = call i32 @ferror(i32 %8)
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i64 @fputc(i8 signext 120, i32 %1)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @fflush(i32* null)
%7 = load i32, i32* @stdin
%8 = tail call i32 @ferror(i32 %7)
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int getpagesize();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("page size = %d\n", getpagesize()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"page size = %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getpagesize()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"page size = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpagesize()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_data_with_mask(int, int);
void operation_i2c_stop() {
  gpio_write_data_with_mask((1 << 7) | (1 << 6), (0 << 7) | (1 << 6));
  gpio_write_data_with_mask((1 << 7) | (1 << 6), (1 << 7) | (1 << 6));
}


x86 assembly (clang, -O0):
<operation_i2c_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%edi
mov    $0x40,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%esi
mov    %esi,%edi
call   1030 <gpio_write_data_with_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_i2c_stop>:
push   %rax
mov    $0xc0,%edi
mov    $0x40,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%edi
mov    $0xc0,%esi
pop    %rax
jmp    1030 <gpio_write_data_with_mask@plt>

LLVM IR (-O0):
define void @operation_i2c_stop() {
%1 = call i32 @gpio_write_data_with_mask(i32 192, i32 64)
%2 = call i32 @gpio_write_data_with_mask(i32 192, i32 192)
ret void
}

LLVM IR (-O2):
define void @operation_i2c_stop() {
%1 = tail call i32 @gpio_write_data_with_mask(i32 192, i32 64)
%2 = tail call i32 @gpio_write_data_with_mask(i32 192, i32 192)
ret void
}
void load_memory(volatile char *mem_ptr, int length, char *value_set) {
  volatile char *index;
  for (index = mem_ptr; index < (mem_ptr + length); index++) {
    *index = *value_set;
    value_set++;
  }
  return;
}


x86 assembly (clang, -O0):
<load_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1158 <load_memory+0x58>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <load_memory+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_memory>:
test   %esi,%esi
jle    1122 <load_memory+0x22>
movslq %esi,%rax
add    %rdi,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdx),%ecx
mov    %cl,(%rdi)
add    $0x1,%rdx
add    $0x1,%rdi
cmp    %rax,%rdi
jb     1110 <load_memory+0x10>
ret

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

LLVM IR (-O2):
define void @load_memory(i8* %0, i32 %1, i8* nocapture %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %14
7: ; preds = %3, %7
%8 = phi i8* [ %12, %7 ], [ %0, %3 ]
%9 = phi i8* [ %11, %7 ], [ %2, %3 ]
%10 = load i8, i8* %9
store volatile i8 %10, i8* %8
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = icmp ult i8* %12, %5
br i1 %13, label %7, label %14
14: ; preds = %7, %3
ret void
}
void g_main_context_pending() {}


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

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

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

LLVM IR (-O2):
define void @g_main_context_pending() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  i = j;
  int c;
  c = 0;
  while (c < 5) {
    i = i + 1;
    j = j + 2;
    c = c + 1;
  }
  assert(i + 5 == j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <main+0x1c>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %3
store i32 %5, i32* %2
store i32 0, i32* %4
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 5
%19 = load i32, i32* %3
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
char *strrchr(char const *, char);
int is_rst(const char *file) {
  char *dot = strrchr(file, '.');
  return dot && !strcmp(dot + 1, "rst");
}


x86 assembly (clang, -O0):
<is_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     116d <is_rst+0x4d>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rst>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     114e <is_rst+0x2e>
add    $0x1,%rax
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"rst\00"
define i32 @is_rst(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"rst\00"
define i32 @is_rst(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void setbit(unsigned char *data, int n, int v) {
  unsigned char mask = 1 << (7 - n % 8);
  if (v)
    data[n / 8] |= mask;
  else
    data[n / 8] &= ~mask;
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1162 <setbit+0x62>
movzbl -0x11(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    118e <setbit+0x8e>
movzbl -0x11(%rbp),%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x1,%esi
shl    %cl,%esi
sar    $0x3,%eax
movslq %eax,%r8
mov    (%rdi,%r8,1),%cl
mov    %esi,%eax
not    %al
and    %cl,%al
or     %sil,%cl
test   %edx,%edx
movzbl %cl,%ecx
movzbl %al,%eax
cmovne %ecx,%eax
mov    %al,(%rdi,%r8,1)
ret

LLVM IR (-O0):
define void @setbit(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = srem i32 %8, 8
%10 = sub nsw i32 7, %9
%11 = shl i32 1, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %3
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sdiv i32 %19, 8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %24, %17
%26 = trunc i32 %25 to i8
store i8 %26, i8* %22
br label %40
27: ; preds = %3
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = sdiv i32 %32, 8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %31, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = and i32 %37, %30
%39 = trunc i32 %38 to i8
store i8 %39, i8* %35
br label %40
40: ; preds = %27, %15
ret void
}

LLVM IR (-O2):
define void @setbit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = srem i32 %1, 8
%5 = sub nsw i32 7, %4
%6 = shl nuw nsw i32 1, %5
%7 = icmp eq i32 %2, 0
%8 = sdiv i32 %1, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = trunc i32 %6 to i8
%13 = xor i8 %12, -1
%14 = and i8 %11, %13
%15 = or i8 %11, %12
%16 = select i1 %7, i8 %14, i8 %15
store i8 %16, i8* %10
ret void
}
int tailleScanLineRGB(int largeurImage) {
  return (largeurImage * 3 + 3) & (int)0x0FFFFFFFCL;
}


x86 assembly (clang, -O0):
<tailleScanLineRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tailleScanLineRGB>:
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @tailleScanLineRGB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = add nsw i32 %4, 3
%6 = and i32 %5, -4
ret i32 %6
}

LLVM IR (-O2):
define i32 @tailleScanLineRGB(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = add nsw i32 %2, 3
%4 = and i32 %3, -4
ret i32 %4
}
/* Variables and functions */
double const square(double const);
double SmoothInvCc(const double x, const double epsilon) {
  return x / (square(x) + square(epsilon));
}


x86 assembly (clang, -O0):
<SmoothInvCc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmoothInvCc>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <square@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <square@plt>
addsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @SmoothInvCc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = call double @square(double %6)
%8 = load double, double* %4
%9 = call double @square(double %8)
%10 = fadd double %7, %9
%11 = fdiv double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @SmoothInvCc(double %0, double %1) {
%3 = tail call double @square(double %0)
%4 = tail call double @square(double %1)
%5 = fadd double %3, %4
%6 = fdiv double %0, %5
ret double %6
}
/* Variables and functions */
long double pow(long double const, double);
void fktn_f(const long double *x, long double *y) { *y = pow(*x, 2.0); }


x86 assembly (clang, -O0):
<fktn_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
movsd  0xecd(%rip),%xmm0
call   1030 <pow@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fktn_f>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
fldt   (%rdi)
fstpt  (%rsp)
movsd  0xedb(%rip),%xmm0
call   1030 <pow@plt>
fstpt  (%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fktn_f(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* %5
%7 = call x86_fp80 @pow(x86_fp80 %6, double 2.000000e+00)
%8 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %7, x86_fp80* %8
ret void
}

LLVM IR (-O2):
define void @fktn_f(x86_fp80* nocapture %0, x86_fp80* nocapture writeonly %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = tail call x86_fp80 @pow(x86_fp80 %3, double 2.000000e+00)
store x86_fp80 %4, x86_fp80* %1
ret void
}
void __attribute__((used)) nop(void) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @nop to i8*)], section "llvm.metadata"
define void @nop() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @nop to i8*)], section "llvm.metadata"
define void @nop() {
ret void
}
int ft_isspace(int c) {
  if ((c >= 9 && c <= 13) || (c == 32))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     111b <ft_isspace+0x1b>
cmpl   $0xd,-0x8(%rbp)
jle    1125 <ft_isspace+0x25>
cmpl   $0x20,-0x8(%rbp)
jne    1131 <ft_isspace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <ft_isspace+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <ft_isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <ft_isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
scalar_t__ isBigEndian();
short ShortVal(short s) {
  {
    (void)((
        int (*)(char failed_static_assertion[(sizeof(short) == 2) ? 1 : -1]))0);
  };
  if (isBigEndian()) {
    unsigned char b1, b2;
    b1 = s & 255;
    b2 = (s >> 8) & 255;
    return (b1 << 8) + b2;
  } else
    return s;
}


x86 assembly (clang, -O0):
<ShortVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <isBigEndian@plt>
cmp    $0x0,%rax
je     1161 <ShortVal+0x51>
movswl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movswl -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
jmp    1169 <ShortVal+0x59>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShortVal>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <isBigEndian@plt>
mov    %ebx,%ecx
rol    $0x8,%cx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i16 @ShortVal(i16 signext %0) {
%2 = tail call i64 (...) @isBigEndian()
%3 = icmp eq i64 %2, 0
%4 = tail call i16 @llvm.bswap.i16(i16 %0)
%5 = select i1 %3, i16 %0, i16 %4
ret i16 %5
}
/* Variables and functions */
double M_PI_2;
double sin(double);
double sineEaseInd(double p) { return sin((p - 1) * M_PI_2) + 1; }


x86 assembly (clang, -O0):
<sineEaseInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    0x2eb3(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sineEaseInd>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    0x2ec8(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
addsd  0xed7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @sineEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = load double, double* @M_PI_2
%6 = fmul double %4, %5
%7 = call double @sin(double %6)
%8 = fadd double %7, 1.000000e+00
ret double %8
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @sineEaseInd(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = load double, double* @M_PI_2
%4 = fmul double %2, %3
%5 = tail call double @sin(double %4)
%6 = fadd double %5, 1.000000e+00
ret double %6
}
int __time_1(long *user_sec, long *user_usec, long *system_sec,
             long *system_usec) {
  *user_sec = *system_sec = 0;
  *user_usec = *system_usec = 0;
  return -1;
}


x86 assembly (clang, -O0):
<__time_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__time_1>:
movq   $0x0,(%rdx)
movq   $0x0,(%rdi)
movq   $0x0,(%rcx)
movq   $0x0,(%rsi)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @__time_1(i64* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64*, i64** %7
store i64 0, i64* %9
%10 = load i64*, i64** %5
store i64 0, i64* %10
%11 = load i64*, i64** %8
store i64 0, i64* %11
%12 = load i64*, i64** %6
store i64 0, i64* %12
ret i32 -1
}

LLVM IR (-O2):
define i32 @__time_1(i64* nocapture writeonly %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
store i64 0, i64* %2
store i64 0, i64* %0
store i64 0, i64* %3
store i64 0, i64* %1
ret i32 -1
}
int main() {
  foo2(({
         (foo(1), foo(2));
         foo(3), foo(4);
       }),
       foo(8));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x3,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x4,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <foo2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <foo@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1040 <foo@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1040 <foo@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x8,%edi
xor    %eax,%eax
call   1040 <foo@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <foo2@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 1)
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 2)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 8)
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @foo2 to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 2)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 3)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 4)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 8)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @foo2 to i32 (i32, i32, ...)*)(i32 %4, i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *MozTaggedAnonymousMmap(void *aAddr, size_t aLength, int aProt, int aFlags,
                             int aFd, off_t aOffset, const char *aTag) {
  return mmap(aAddr, aLength, aProt, aFlags, aFd, aOffset);
}


x86 assembly (clang, -O0):
<MozTaggedAnonymousMmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MozTaggedAnonymousMmap>:
jmp    1030 <mmap@plt>

LLVM IR (-O0):
define i8* @MozTaggedAnonymousMmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i8* %6, i8** %14
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = call i8* @mmap(i8* %15, i64 %16, i32 %17, i32 %18, i32 %19, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @MozTaggedAnonymousMmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* nocapture readnone %6) {
%8 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i8* %8
}
/* Variables and functions */
int opaque();
int test0(void) { return opaque(); }


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

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

LLVM IR (-O0):
define i32 @test0() {
%1 = call i32 (...) @opaque()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test0() {
%1 = tail call i32 (...) @opaque()
ret i32 %1
}
void XtUngrabKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @XtUngrabKeyboard() {
ret void
}
char *sha224base64(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((char *)shacomp(224, 3, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha224base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xe0,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha224base64>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0xe0,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha224base64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 224, i32 3, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha224base64(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 224, i32 3, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int rand();
int gen_cookie() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @gen_cookie() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gen_cookie() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
int my_get_el(char c, char *base) {
  int lp;
  lp = 0;
  while (base[lp] != '\0') {
    if (c == base[lp])
      return (lp);
    ++lp;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<my_get_el>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <my_get_el+0x5b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114d <my_get_el+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <my_get_el+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <my_get_el+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_get_el>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <my_get_el+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <my_get_el+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <my_get_el+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_get_el(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
/* Variables and functions */
int isdigit(char const);
int starts_with_digit(const char *str) { return isdigit(*str); }


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

x86 assembly (clang, -O2):
<starts_with_digit>:
movsbl (%rdi),%edi
jmp    1030 <isdigit@plt>

LLVM IR (-O0):
define i32 @starts_with_digit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @isdigit(i8 signext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @starts_with_digit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isdigit(i8 signext %2)
ret i32 %3
}
/* Variables and functions */
char *BrokenFunction();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("You wrote: %s\n", BrokenFunction());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"You wrote: %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @BrokenFunction()
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"You wrote: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @BrokenFunction()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
char const *CONSTSTR(char *);
const char *ccnl_suite2str(int suite) { return CONSTSTR("?"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define i8* @ccnl_suite2str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @CONSTSTR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @ccnl_suite2str(i32 %0) {
%2 = tail call i8* @CONSTSTR(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int frw_free(void *mem) {
  if (mem) {
    free(mem);
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<frw_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <frw_free+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <frw_free+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frw_free>:
test   %rdi,%rdi
je     1122 <frw_free+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @frw_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
struct tree *new_tree(int /*<<< orphan*/ *);
struct tree *init_tree() {
  return new_tree(NULL);
}


x86 assembly (clang, -O0):
<init_tree>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <new_tree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tree>:
xor    %edi,%edi
jmp    1030 <new_tree@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
define %struct.tree* @init_tree() {
%1 = call %struct.tree* @new_tree(i32* null)
ret %struct.tree* %1
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define %struct.tree* @init_tree() {
%1 = tail call %struct.tree* @new_tree(i32* null)
ret %struct.tree* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_WORM(struct list_head *);
uint8_t clear_default_WORM(struct list_head *l) {
  ;
  return clear_WORM(l);
}


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

x86 assembly (clang, -O2):
<clear_default_WORM>:
jmp    1030 <clear_WORM@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define i32 @clear_default_WORM(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @clear_WORM(%struct.list_head* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @clear_default_WORM(%struct.list_head* %0) {
%2 = tail call i32 @clear_WORM(%struct.list_head* %0)
ret i32 %2
}