xunge/DecIR huggingface dataset:
/* Variables and functions */
int fu(int, char *, char *, ...);
int main() {
  int i = fu(2, "one", "two");
  int j = fu(3, "three", "four", "five");
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xed5(%rip),%rsi
lea    0xed2(%rip),%rdx
mov    $0x0,%al
call   1030 <fu@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xebd(%rip),%rcx
mov    $0x0,%al
call   1030 <fu@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <fu@plt>
mov    %eax,%ebx
lea    0xed4(%rip),%rsi
lea    0xed3(%rip),%rdx
lea    0xed1(%rip),%rcx
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <fu@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"one\00"
@.str.1 = [4 x i8] c"two\00"
@.str.2 = [6 x i8] c"three\00"
@.str.3 = [5 x i8] c"four\00"
@.str.4 = [5 x i8] c"five\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i32, i8*, i8*, ...) @fu(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %2
%5 = call i32 (i32, i8*, i8*, ...) @fu(i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"one\00"
@.str.1 = [4 x i8] c"two\00"
@.str.2 = [6 x i8] c"three\00"
@.str.3 = [5 x i8] c"four\00"
@.str.4 = [5 x i8] c"five\00"
define i32 @main() {
%1 = tail call i32 (i32, i8*, i8*, ...) @fu(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i32, i8*, i8*, ...) @fu(i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%3 = add nsw i32 %2, %1
ret i32 %3
}
char *noop_verify(char **end, struct command_arg *arg) { return 0; }


x86 assembly (clang, -O0):
<noop_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.command_arg = type opaque
define i8* @noop_verify(i8** %0, %struct.command_arg* %1) {
%3 = alloca i8**
%4 = alloca %struct.command_arg*
store i8** %0, i8*** %3
store %struct.command_arg* %1, %struct.command_arg** %4
ret i8* null
}

LLVM IR (-O2):
%struct.command_arg = type opaque
define noalias i8* @noop_verify(i8** nocapture readnone %0, %struct.command_arg* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/"
             "src/xzdec/.libs/lt-xzdec.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf45(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf60(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xzdec/.libs/lt-xzdec.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xzdec/.libs/lt-xzdec.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
int doubleCmpFn(const void *p1, const void *p2) {
  double v1, v2;
  v1 = *((double *)p1);
  v2 = *((double *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<doubleCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1148 <doubleCmpFn+0x48>
jp     1148 <doubleCmpFn+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1166 <doubleCmpFn+0x66>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleCmpFn>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @doubleCmpFn(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp oeq double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp olt double %19, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 -1, i32 1
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @doubleCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = fcmp olt double %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void sbcZp16(void) { sbc16(readmemw65816(zeropage())); }


x86 assembly (clang, -O0):
<sbcZp16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <zeropage@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcZp16>:
push   %rax
xor    %eax,%eax
call   1040 <zeropage@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcZp16() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcZp16() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t gettid(void) { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @gettid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
unsigned int mchin();
int mcharinp() {
  static unsigned c;
  c = mchin();
  return c;
}


x86 assembly (clang, -O0):
<mcharinp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mchin@plt>
mov    %eax,0x2f0b(%rip)
mov    0x2f05(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@mcharinp.c = internal global i32 0
define i32 @mcharinp() {
%1 = call i32 (...) @mchin()
store i32 %1, i32* @mcharinp.c
%2 = load i32, i32* @mcharinp.c
ret i32 %2
}

LLVM IR (-O2):
define i32 @mcharinp() {
%1 = tail call i32 (...) @mchin()
ret i32 %1
}
/* Type definitions */
struct mm_array {
  int dummy;
};

/* Variables and functions */
int mm_array_push_front2(struct mm_array *, void *, int);
int mm_array_push_front(struct mm_array *mar, void *element) {
  return mm_array_push_front2(mar, element, 1);
}


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

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

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

LLVM IR (-O2):
%struct.mm_array = type { i32 }
define i32 @mm_array_push_front(%struct.mm_array* %0, i8* %1) {
%3 = tail call i32 @mm_array_push_front2(%struct.mm_array* %0, i8* %1, i32 1)
ret i32 %3
}
int f(int in) {
  if (in == 0) {
    return 0;
  } else {
    return 3 * f(in - 1) + 4;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <f+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1145 <f+0x35>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
imul   $0x3,%eax,%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1128 <f+0x18>
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
lea    (%rax,%rax,2),%eax
add    $0x4,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
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 = sub nsw i32 %8, 1
%10 = call i32 @f(i32 %9)
%11 = mul nsw i32 3, %10
%12 = add nsw i32 %11, 4
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 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @f(i32 %6)
%8 = mul nsw i32 %7, 3
%9 = add nsw i32 %8, 4
br label %3
}
int fun649() { return 649; }


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

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

LLVM IR (-O0):
define i32 @fun649() {
ret i32 649
}

LLVM IR (-O2):
define i32 @fun649() {
ret i32 649
}
int main(int argc, char **argv) {
  long addr = 0;
  printf("Adresse von addr = %x \n", &addr);
  suche_0(&addr);
  printf("Adresse des ersten 0-long Wertes: %l \n", &addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <suche_0@plt>
lea    0xeb6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <suche_0@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Adresse von addr = %x \0A\00"
@.str.1 = [39 x i8] c"Adresse des ersten 0-long Wertes: %l \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64* %6)
%8 = call i32 (i64*, ...) bitcast (i32 (...)* @suche_0 to i32 (i64*, ...)*)(i64* %6)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Adresse von addr = %x \0A\00"
@.str.1 = [39 x i8] c"Adresse des ersten 0-long Wertes: %l \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = call i32 (i64*, ...) bitcast (i32 (...)* @suche_0 to i32 (i64*, ...)*)(i64* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64* %3)
ret i32 0
}
/* Variables and functions */
int setupCond(int);
int doCond(int n, int *pcf, int *pmode, int *pcbn) {
  *pcf = 2;
  *pmode = '6';
  pcbn = 0;
  return setupCond(n);
}


x86 assembly (clang, -O0):
<doCond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x36,(%rax)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <setupCond@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doCond>:
movl   $0x2,(%rsi)
movl   $0x36,(%rdx)
jmp    1030 <setupCond@plt>

LLVM IR (-O0):
define i32 @doCond(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** %6
store i32 2, i32* %9
%10 = load i32*, i32** %7
store i32 54, i32* %10
store i32* null, i32** %8
%11 = load i32, i32* %5
%12 = call i32 @setupCond(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @doCond(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture readnone %3) {
store i32 2, i32* %1
store i32 54, i32* %2
%5 = tail call i32 @setupCond(i32 %0)
ret i32 %5
}
int ft_isupper(int c) { return ((c >= 'A') && (c <= 'Z')); }


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  int i;
  for (i = 0; i < 5; i = i + 1) {
    1;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void elv_dequeue_request(struct request_queue *x, struct request *y) { return; }


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

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @elv_dequeue_request(%struct.request_queue* %0, %struct.request* %1) {
%3 = alloca %struct.request_queue*
%4 = alloca %struct.request*
store %struct.request_queue* %0, %struct.request_queue** %3
store %struct.request* %1, %struct.request** %4
ret void
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @elv_dequeue_request(%struct.request_queue* nocapture %0, %struct.request* nocapture %1) {
ret void
}
int get_int(void *_p) { return *((int *)_p); }


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

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

LLVM IR (-O0):
define i32 @get_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("Epicfail Version %s\n", "1.1"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Epicfail Version %s\0A\00"
@.str.1 = [4 x i8] c"1.1\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Epicfail Version %s\0A\00"
@.str.1 = [4 x i8] c"1.1\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) void outb_p(unsigned char value, unsigned short port) {
  asm volatile("out"
               "b"
               " %"
               "b"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outb_p(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outb_p(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 1; i <= 100; i++) {
    printf("x"
           "i"
           "= %i\n",
           i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"xi= %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"xi= %i\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 101
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void find_cursor(void) {}


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

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

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

LLVM IR (-O2):
define void @find_cursor() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test43(__m64 a, __m64 b) { return _mm_sub_pi32(a, b); }


x86 assembly (clang, -O0):
<test43>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_sub_pi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test43>:
jmp    1030 <_mm_sub_pi32@plt>

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

LLVM IR (-O2):
define i32 @test43(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_pi32(i32 %0, i32 %1)
ret i32 %3
}
void data_write_odd_address(void) {
  int *i = (void *)0x87654321;
  *i = 0;
}


x86 assembly (clang, -O0):
<data_write_odd_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0x87654321,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_write_odd_address>:
mov    $0x87654321,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @data_write_odd_address() {
%1 = alloca i32*
store i32* inttoptr (i64 2271560481 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @data_write_odd_address() {
store i32 0, i32* inttoptr (i64 2271560481 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MPU_I2C_Read(int, int, int, unsigned char *);
short BNO55_Detect() {
  unsigned char dat = 0;
  MPU_I2C_Read(0x28, 0x00, 1, &dat);
  if (dat == 0xA0) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<BNO55_Detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x3(%rbp)
mov    $0x28,%edi
xor    %esi,%esi
mov    $0x1,%edx
lea    -0x3(%rbp),%rcx
call   1030 <MPU_I2C_Read@plt>
movzbl -0x3(%rbp),%eax
cmp    $0xa0,%eax
jne    114b <BNO55_Detect+0x3b>
movw   $0x1,-0x2(%rbp)
jmp    1151 <BNO55_Detect+0x41>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNO55_Detect>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x28,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <MPU_I2C_Read@plt>
xor    %eax,%eax
cmpb   $0xa0,0x7(%rsp)
sete   %al
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @BNO55_Detect() {
%1 = alloca i16
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @MPU_I2C_Read(i32 40, i32 0, i32 1, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 160
br i1 %6, label %7, label %8
7: ; preds = %0
store i16 1, i16* %1
br label %9
8: ; preds = %0
store i16 -1, i16* %1
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %1
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @BNO55_Detect() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @MPU_I2C_Read(i32 40, i32 0, i32 1, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, -96
%5 = select i1 %4, i16 1, i16 -1
ret i16 %5
}
int xmpi_tell_wait() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xmpi_tell_wait() {
ret i32 0
}
/* Variables and functions */
char KeyBrd_Getch_Buf();
int /*<<< orphan*/ KeyBrd_Hit();
char KeyBrd_Getch(void) {
  char ch;
  while (!KeyBrd_Hit())
    ;
  ch = KeyBrd_Getch_Buf();
  return ch;
}


x86 assembly (clang, -O0):
<KeyBrd_Getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <KeyBrd_Hit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <KeyBrd_Getch+0x24>
jmp    1149 <KeyBrd_Getch+0x29>
jmp    1128 <KeyBrd_Getch+0x8>
mov    $0x0,%al
call   1030 <KeyBrd_Getch_Buf@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeyBrd_Getch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <KeyBrd_Hit@plt>
test   %eax,%eax
je     1130 <KeyBrd_Getch+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <KeyBrd_Getch_Buf@plt>

LLVM IR (-O0):
define signext i8 @KeyBrd_Getch() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @KeyBrd_Hit()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call signext i8 (...) @KeyBrd_Getch_Buf()
store i8 %8, i8* %1
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @KeyBrd_Getch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @KeyBrd_Hit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call signext i8 (...) @KeyBrd_Getch_Buf()
ret i8 %5
}
/* Variables and functions */
float __nv_rnormf(int, float const *);
float rnormf(int __dim, const float *__t) { return __nv_rnormf(__dim, __t); }


x86 assembly (clang, -O0):
<rnormf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__nv_rnormf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnormf>:
jmp    1030 <__nv_rnormf@plt>

LLVM IR (-O0):
define float @rnormf(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
store float* %1, float** %4
%5 = load i32, i32* %3
%6 = load float*, float** %4
%7 = call float @__nv_rnormf(i32 %5, float* %6)
ret float %7
}

LLVM IR (-O2):
define float @rnormf(i32 %0, float* %1) {
%3 = tail call float @__nv_rnormf(i32 %0, float* %1)
ret float %3
}
int dead_state_destroy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dead_state_destroy() {
ret i32 0
}
const char *describe_action(char a) {
  static const char *ad = "add    ";
  static const char *de = "delete ";
  static const char *un = "unknown";
  switch (a) {
  case 'a':
    return ad;
  case 'd':
    return de;
  }
  return un;
}


x86 assembly (clang, -O0):
<describe_action>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x61,%eax
je     1130 <describe_action+0x30>
jmp    111f <describe_action+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x64,%eax
je     1140 <describe_action+0x40>
jmp    1150 <describe_action+0x50>
mov    0x2ee9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <describe_action+0x5b>
mov    0x2ee1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <describe_action+0x5b>
mov    0x2ed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<describe_action>:
cmp    $0x64,%dil
lea    0xefd(%rip),%rax
lea    0xefe(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x61,%dil
lea    0xedf(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@describe_action.ad = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0)
@.str = [8 x i8] c"add \00"
@describe_action.de = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [8 x i8] c"delete \00"
@describe_action.un = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0)
@.str.2 = [8 x i8] c"unknown\00"
define i8* @describe_action(i8 signext %0) {
%2 = alloca i8*
%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 97, label %6
i32 100, label %8
]
6: ; preds = %1
%7 = load i8*, i8** @describe_action.ad
store i8* %7, i8** %2
br label %12
8: ; preds = %1
%9 = load i8*, i8** @describe_action.de
store i8* %9, i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** @describe_action.un
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %8, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"add \00"
@.str.1 = [8 x i8] c"delete \00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @describe_action(i8 signext %0) {
%2 = icmp eq i8 %0, 100
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i8 %0, 97
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int ghdl_main(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("ghdl_main: %d\n", ghdl_main(0, NULL));
  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)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <ghdl_main@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"ghdl_main: %d\0A\00"
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 = call i32 @ghdl_main(i32 0, i32* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"ghdl_main: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ghdl_main(i32 0, i32* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void debug_psrwlock_lock_common(struct psrwlock *lock,
                                struct psrwlock_waiter *waiter) {}


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

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

LLVM IR (-O0):
%struct.psrwlock = type opaque
%struct.psrwlock_waiter = type opaque
define void @debug_psrwlock_lock_common(%struct.psrwlock* %0, %struct.psrwlock_waiter* %1) {
%3 = alloca %struct.psrwlock*
%4 = alloca %struct.psrwlock_waiter*
store %struct.psrwlock* %0, %struct.psrwlock** %3
store %struct.psrwlock_waiter* %1, %struct.psrwlock_waiter** %4
ret void
}

LLVM IR (-O2):
%struct.psrwlock = type opaque
%struct.psrwlock_waiter = type opaque
define void @debug_psrwlock_lock_common(%struct.psrwlock* nocapture %0, %struct.psrwlock_waiter* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
void Move_Delay() { Delay_ms(750); }


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

x86 assembly (clang, -O2):
<Move_Delay>:
mov    $0x2ee,%edi
jmp    1030 <Delay_ms@plt>

LLVM IR (-O0):
define void @Move_Delay() {
%1 = call i32 @Delay_ms(i32 750)
ret void
}

LLVM IR (-O2):
define void @Move_Delay() {
%1 = tail call i32 @Delay_ms(i32 750)
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
const char *skipSpace(const char *cp) {
  while (isspace((int)*cp))
    ++cp;
  return cp;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i8* %3
}
double cell(void *context, double a) {
  double *c = context;
  return c[(int)a];
}


x86 assembly (clang, -O0):
<cell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cvttsd2si -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cell>:
cvttsd2si %xmm0,%eax
cltq
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @cell(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca double*
store i8* %0, i8** %3
store double %1, double* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to double*
store double* %7, double** %5
%8 = load double*, double** %5
%9 = load double, double* %4
%10 = fptosi double %9 to i32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %8, i64 %11
%13 = load double, double* %12
ret double %13
}

LLVM IR (-O2):
define double @cell(i8* nocapture %0, double %1) {
%3 = bitcast i8* %0 to double*
%4 = fptosi double %1 to i32
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds double, double* %3, i64 %5
%7 = load double, double* %6
ret double %7
}
void ecrobot_device_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @ecrobot_device_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is my first APUE program\n\n");
  printf("APUE.H is Successfull !!!\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"This is my first APUE program\0A\0A\00"
@.str.1 = [28 x i8] c"APUE.H is Successfull !!!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"This is my first APUE program\0A\00"
@str.2 = [27 x i8] c"APUE.H is Successfull !!!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void OverSpace(char **strptr) {
  int c;
  while ((c = **strptr) == ' ' || c == '\t') {
    (*strptr)++;
  }
}


x86 assembly (clang, -O0):
<OverSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    %ecx,-0xc(%rbp)
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     112d <OverSpace+0x2d>
cmpl   $0x9,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113d <OverSpace+0x3d>
jmp    1150 <OverSpace+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <OverSpace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OverSpace>:
mov    (%rdi),%rax
jmp    1113 <OverSpace+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <OverSpace+0x10>
cmp    $0x9,%cl
je     1110 <OverSpace+0x10>
ret

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

LLVM IR (-O2):
define void @OverSpace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_SYSCALL;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *);
void listen_again(pid_t child_pid) {
  if (ptrace(PTRACE_SYSCALL, child_pid, NULL, NULL) == -1)
    error(250, 0, "Error ptracsing child");
}


x86 assembly (clang, -O0):
<listen_again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
cmp    $0xffffffff,%eax
jne    115f <listen_again+0x3f>
mov    $0xfa,%edi
xor    %esi,%esi
lea    0xea6(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listen_again>:
push   %rax
mov    %edi,%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0xffffffff,%eax
je     113c <listen_again+0x1c>
pop    %rax
ret
lea    0xebd(%rip),%rdx
mov    $0xfa,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@PTRACE_SYSCALL = global i32 0
@.str = [22 x i8] c"Error ptracsing child\00"
define void @listen_again(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_SYSCALL
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32* null, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @error(i32 250, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@PTRACE_SYSCALL = global i32 0
@.str = [22 x i8] c"Error ptracsing child\00"
define void @listen_again(i32 %0) {
%2 = load i32, i32* @PTRACE_SYSCALL
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @error(i32 250, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct Param {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eval_A_times_u(struct Param *);
int /*<<< orphan*/ eval_At_times_u(struct Param *);
void eval_AtA_times_u(struct Param *p) {
  eval_A_times_u(p);
  eval_At_times_u(p);
}


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

x86 assembly (clang, -O2):
<eval_AtA_times_u>:
push   %rbx
mov    %rdi,%rbx
call   1040 <eval_A_times_u@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eval_At_times_u@plt>

LLVM IR (-O0):
%struct.Param = type { i32 }
define void @eval_AtA_times_u(%struct.Param* %0) {
%2 = alloca %struct.Param*
store %struct.Param* %0, %struct.Param** %2
%3 = load %struct.Param*, %struct.Param** %2
%4 = call i32 @eval_A_times_u(%struct.Param* %3)
%5 = load %struct.Param*, %struct.Param** %2
%6 = call i32 @eval_At_times_u(%struct.Param* %5)
ret void
}

LLVM IR (-O2):
%struct.Param = type { i32 }
define void @eval_AtA_times_u(%struct.Param* %0) {
%2 = tail call i32 @eval_A_times_u(%struct.Param* %0)
%3 = tail call i32 @eval_At_times_u(%struct.Param* %0)
ret void
}
int getkey() { return 6; }


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

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

LLVM IR (-O0):
define i32 @getkey() {
ret i32 6
}

LLVM IR (-O2):
define i32 @getkey() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void pput_s(int y, int x) { mvaddch(y, x, ' '); }


x86 assembly (clang, -O0):
<pput_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x20,%edx
call   1030 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pput_s>:
mov    $0x20,%edx
jmp    1030 <mvaddch@plt>

LLVM IR (-O0):
define void @pput_s(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 @mvaddch(i32 %5, i32 %6, i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @pput_s(i32 %0, i32 %1) {
%3 = tail call i32 @mvaddch(i32 %0, i32 %1, i8 signext 32)
ret void
}
double pow(double x, double y) { return 0; }


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
ret double 0.000000e+00
}