xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void fput32b(FILE *fp, uint32_t v) {
  fputc((v >> 24), fp);
  fputc((v >> 16), fp);
  fputc((v >> 8), fp);
  fputc((v & 0xff), fp);
}


x86 assembly (clang, -O0):
<fput32b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput32b>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
sar    $0x18,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%edi
sar    $0x10,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%edi
sar    $0x8,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fput32b(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = call i32 @fputc(i32 %10, i32* %11)
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = call i32 @fputc(i32 %14, i32* %15)
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = load i32*, i32** %3
%20 = call i32 @fputc(i32 %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @fput32b(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = ashr i32 %1, 16
%6 = tail call i32 @fputc(i32 %5, i32* %0)
%7 = ashr i32 %1, 8
%8 = tail call i32 @fputc(i32 %7, i32* %0)
%9 = and i32 %1, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
ret void
}
void avcodec_default_execute() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_default_execute() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned long, void *, unsigned long);
void *test(size_t s) {
  void *p = malloc(s);
  printf("malloc: %ld, %p: %ld\n", (unsigned long)s, p,
         ((unsigned long)p) & (16 - 1));
  return p;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
and    $0xf,%rcx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %ebx,%ecx
and    $0xf,%ecx
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"malloc: %ld, %p: %ld\0A\00"
define i8* @test(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, 15
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7, i64 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [22 x i8] c"malloc: %ld, %p: %ld\0A\00"
define i8* @test(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = ptrtoint i8* %2 to i64
%4 = and i64 %3, 15
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %2, i64 %4)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ format;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
int get_XClientMessageEvent_format(void *_p) {
  return (int)((XClientMessageEvent *)_p)->format;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XClientMessageEvent_format(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void sigwinch_handler(int signum) {
  if (signum) {
  }
}


x86 assembly (clang, -O0):
<sigwinch_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <sigwinch_handler+0x16>
jmp    1116 <sigwinch_handler+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sigwinch_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @sigwinch_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void multimap_free(const void *data) { free((void *)data); }


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

x86 assembly (clang, -O2):
<multimap_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @multimap_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void cha(char str[]) { str[0] = 'm'; }


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

x86 assembly (clang, -O2):
<cha>:
movb   $0x6d,(%rdi)
ret

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

LLVM IR (-O2):
define void @cha(i8* nocapture writeonly %0) {
store i8 109, i8* %0
ret void
}
int XGetClassHint() {}


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

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

LLVM IR (-O0):
define i32 @XGetClassHint() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetClassHint() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ftell(int /*<<< orphan*/ *);
unsigned long f_partial_size(FILE *f) {
  unsigned long len = (unsigned long)ftell(f);
  return len;
}


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

x86 assembly (clang, -O2):
<f_partial_size>:
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define i64 @f_partial_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @ftell(i32* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @f_partial_size(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
ret i64 %2
}
txt_pitchbend(chan, msb, lsb) {
  prtime();
  printf("Pitchbend, chan=%d msb=%d lsb=%d\n", chan + 1, msb, lsb);
}


x86 assembly (clang, -O0):
<txt_pitchbend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_pitchbend>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Pitchbend, chan=%d msb=%d lsb=%d\0A\00"
define i32 @txt_pitchbend(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [34 x i8] c"Pitchbend, chan=%d msb=%d lsb=%d\0A\00"
define i32 @txt_pitchbend(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printer();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello this is the start\n");
  if (argc < 5) {
    printer();
  }
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jge    1153 <main+0x33>
mov    $0x0,%al
call   1040 <printer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x4,%ebx
jg     113b <main+0x1b>
xor    %eax,%eax
call   1040 <printer@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"hello this is the start\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 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @printer()
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@str = [24 x i8] c"hello this is the start\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = icmp slt i32 %0, 5
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @printer()
br label %7
7: ; preds = %5, %2
ret i32 0
}
void fa169(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
    {
      int g[n];
    a:
      goto a;
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa169>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
jmp    1170 <fa169+0x70>

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

LLVM IR (-O0):
define void @fa169(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %7
%31 = alloca i32, i64 %29
store i64 %29, i64* %8
%32 = load i8*, i8** %7
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
%35 = alloca i32, i64 %34
store i64 %34, i64* %9
%36 = load i8*, i8** %3
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
%39 = call i8* @llvm.stacksave()
store i8* %39, i8** %10
%40 = alloca i32, i64 %38
store i64 %38, i64* %11
%41 = load i32, i32* %2
%42 = zext i32 %41 to i64
%43 = call i8* @llvm.stacksave()
store i8* %43, i8** %12
%44 = alloca i32, i64 %42
store i64 %42, i64* %13
br label %45
45: ; preds = %45, %1
br label %45
46: ; No predecessors!
%47 = load i32, i32* %2
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %14
%50 = alloca i32, i64 %48
store i64 %48, i64* %15
%51 = load i8*, i8** %14
%52 = load i32, i32* %2
%53 = zext i32 %52 to i64
%54 = alloca i32, i64 %53
store i64 %53, i64* %16
%55 = load i8*, i8** %10
%56 = load i32, i32* %2
%57 = zext i32 %56 to i64
%58 = call i8* @llvm.stacksave()
store i8* %58, i8** %17
%59 = alloca i32, i64 %57
store i64 %57, i64* %18
%60 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa169(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int rootwrap_bind(int family, int socktype, int protocol,
                  const struct sockaddr *addr, size_t alen) {
  return -1;
}


x86 assembly (clang, -O0):
<rootwrap_bind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @rootwrap_bind(i32 %0, i32 %1, i32 %2, %struct.sockaddr* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.sockaddr*
%10 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store %struct.sockaddr* %3, %struct.sockaddr** %9
store i64 %4, i64* %10
ret i32 -1
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @rootwrap_bind(i32 %0, i32 %1, i32 %2, %struct.sockaddr* nocapture readnone %3, i64 %4) {
ret i32 -1
}
void s3c_pwm_setname(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_pwm_setname(i8* nocapture %0) {
ret void
}
free_dvector(v, nl, nh) int nl, nh;
double *v;
{ free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define i32 @free_dvector(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = bitcast double* %5 to i8*
tail call void @free(i8* %6)
ret i32 undef
}
__attribute__((no)) void myfunc(int a, void *b) {}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @myfunc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @myfunc(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findNumbers(int *, int);
int main() {
  int array[] = {13, 10, 14, 9, 17, 21, 16, 18, 13, 17};
  int n = 5;
  findNumbers(array, n);
  return n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <findNumbers@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <findNumbers@plt>
mov    $0x5,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 13, i32 10, i32 14, i32 9, i32 17, i32 21, i32 16, i32 18, i32 13, i32 17]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @findNumbers(i32* %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 13, i32 10, i32 14, i32 9, i32 17, i32 21, i32 16, i32 18, i32 13, i32 17]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @findNumbers(i32* %3, i32 5)
ret i32 5
}
float hpmRadiansToDegrees(float rad) { return rad * 57.2957795; }


x86 assembly (clang, -O0):
<hpmRadiansToDegrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmRadiansToDegrees>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @hpmRadiansToDegrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x404CA5DC1A47A9E3
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @hpmRadiansToDegrees(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x404CA5DC1A47A9E3
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int join(int p, int q, int *parent, int *treesize) {
  parent[q] = p;
  treesize[p] += treesize[q];
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
movslq %esi,%rax
mov    %edi,(%rdx,%rax,4)
mov    (%rcx,%rax,4),%eax
movslq %edi,%rdx
add    %eax,(%rcx,%rdx,4)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @join(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %2, i64 %5
store i32 %0, i32* %6
%7 = getelementptr inbounds i32, i32* %3, i64 %5
%8 = load i32, i32* %7
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds i32, i32* %3, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, %8
store i32 %12, i32* %10
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
int foo(int bar) {
  int idx;
  int res = 0;
  for (idx = 1; idx < bar; idx++) {
    res += idx;
  }
  res *= idx;
  return (res);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <foo+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <foo+0x15>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111d <foo+0x1d>
lea    -0x2(%rdi),%eax
lea    -0x3(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xfffffffd,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -2
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -3
%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 %4, %11
%13 = add i32 %12, -3
%14 = mul nsw i32 %13, %0
br label %15
15: ; preds = %3, %1
%16 = phi i32 [ %14, %3 ], [ 0, %1 ]
ret i32 %16
}
int res_dnok(const char *dn) {
  int ch;
  while ((ch = *dn++) != '\0')
    if (!((ch) > 0x20 && (ch) < 0x7f))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<res_dnok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114b <res_dnok+0x4b>
cmpl   $0x20,-0x14(%rbp)
jle    113a <res_dnok+0x3a>
cmpl   $0x7f,-0x14(%rbp)
jl     1146 <res_dnok+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1152 <res_dnok+0x52>
jmp    1108 <res_dnok+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_dnok>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <res_dnok+0x14>
add    $0x1,%rdi
add    $0xdf,%al
cmp    $0x5e,%al
jb     1100 <res_dnok>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @res_dnok(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add i8 %4, -33
%9 = icmp ult i8 %8, 94
br i1 %9, label %2, label %10
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("usage: %s [OPTION]... [FCODE-FILE]...\n\n"
         "         -v, --verbose     print fcode numbers\n"
         "         -a, --all         don't stop at end0\n"
         "         -n, --linenumbers print line numbers\n"
         "         -o, --offsets     print byte offsets\n"
         "         -f, --fcodes      add FCodes from list-file\n"
         "         -h, --help        print this help text\n\n",
         name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [327 x i8] c"usage: %s [OPTION]... [FCODE-FILE]...\0A\0A -v, --verbose print fcode numbers\0A -a, --all don't stop at end0\0A -n, --linenumbers print line numbers\0A -o, --offsets print byte offsets\0A -f, --fcodes add FCodes from list-file\0A -h, --help print this help text\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [327 x i8] c"usage: %s [OPTION]... [FCODE-FILE]...\0A\0A -v, --verbose print fcode numbers\0A -a, --all don't stop at end0\0A -n, --linenumbers print line numbers\0A -o, --offsets print byte offsets\0A -f, --fcodes add FCodes from list-file\0A -h, --help print this help text\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_commands(struct Node *, char *, int /*<<< orphan*/,
                                  int);
int strlen(char *);
int parse_commands_list(struct Node *data_list, char *commands) {
  int command_len = strlen(commands);
  if (!(command_len > 0))
    return -1;
  parse_commands(data_list, commands, 0, -1);
  return 0;
}


x86 assembly (clang, -O0):
<parse_commands_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1152 <parse_commands_list+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <parse_commands_list+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1040 <parse_commands@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_commands_list>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    114c <parse_commands_list+0x2c>
xor    %ebp,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1040 <parse_commands@plt>
jmp    1151 <parse_commands_list+0x31>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
define i32 @parse_commands_list(%struct.Node* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.Node*
%5 = alloca i8*
%6 = alloca i32
store %struct.Node* %0, %struct.Node** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load %struct.Node*, %struct.Node** %4
%14 = load i8*, i8** %5
%15 = call i32 @parse_commands(%struct.Node* %13, i8* %14, i32 0, i32 -1)
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define i32 @parse_commands_list(%struct.Node* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @parse_commands(%struct.Node* %0, i8* %1, i32 0, i32 -1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
size_t heap_lix(size_t i) { return (i * 2) + 1; }


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

x86 assembly (clang, -O2):
<heap_lix>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @heap_lix(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x82() {
  Assert_real((iscntrl(130) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              655, ("iscntrl should be 0 for 0x82"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x82\00"
define void @t_iscntrl_0x82() {
%1 = call i64 @iscntrl(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x82\00"
define void @t_iscntrl_0x82() {
%1 = tail call i64 @iscntrl(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RTAssertMsg2V(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertMsg2V() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fib(int n) {
  int a, b, c, i;
  a = 0;
  b = 1;
  for (i = 0; i < n; i++) {
    c = a + b;
    a = b;
    b = c;
    printf("%d\n", c);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116e <fib+0x5e>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <fib+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    114a <fib+0x3a>
mov    %edi,%ebx
mov    $0x1,%r15d
xor    %eax,%eax
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    %eax,%ebp
add    %r15d,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15d,%eax
mov    %ebp,%r15d
add    $0xffffffff,%ebx
jne    1130 <fib+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
store i32 0, i32* %7
br label %8
8: ; preds = %20, %1
%9 = load i32, i32* %7
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %5
store i32 %16, i32* %4
%17 = load i32, i32* %6
store i32 %17, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = phi i32 [ %7, %3 ], [ 1, %1 ]
%7 = add nsw i32 %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ write_char(char const);
void write_string(const char *s) {
  for (; *s; s++)
    write_char(*s);
}


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

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

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

LLVM IR (-O2):
define void @write_string(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 i32 @write_char(i8 signext %5)
%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
}
/* Type definitions */
struct gg_dcc {
  int dummy;
};

/* Variables and functions */
int gg_dcc_fill_file_info2(struct gg_dcc *, char const *, char const *);
int gg_dcc_fill_file_info(struct gg_dcc *d, const char *filename) {
  return gg_dcc_fill_file_info2(d, filename, filename);
}


x86 assembly (clang, -O0):
<gg_dcc_fill_file_info>:
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    -0x10(%rbp),%rdx
call   1030 <gg_dcc_fill_file_info2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.gg_dcc = type { i32 }
define i32 @gg_dcc_fill_file_info(%struct.gg_dcc* %0, i8* %1) {
%3 = tail call i32 @gg_dcc_fill_file_info2(%struct.gg_dcc* %0, i8* %1, i8* %1)
ret i32 %3
}
void test19_Y_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test19_Y_targetInit__I() {
ret void
}
void SSMR3SetLoadErrorV(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3SetLoadErrorV() {
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int getaddrinfo(char const *, char const *, struct addrinfo const *,
                struct addrinfo **);
int xmms_getaddrinfo(const char *node, const char *service,
                     const struct addrinfo *hints, struct addrinfo **res) {
  return getaddrinfo(node, service, hints, res);
}


x86 assembly (clang, -O0):
<xmms_getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <getaddrinfo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmms_getaddrinfo>:
jmp    1030 <getaddrinfo@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @xmms_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.addrinfo*, %struct.addrinfo** %7
%12 = load %struct.addrinfo**, %struct.addrinfo*** %8
%13 = call i32 @getaddrinfo(i8* %9, i8* %10, %struct.addrinfo* %11, %struct.addrinfo** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @xmms_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = tail call i32 @getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3)
ret i32 %5
}
unsigned int inl(int port) {
  unsigned int value;
  asm volatile("in"
               "l"
               " %w1, %"
               ""
               "0"
               : "=a"(value)
               : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl(i32 %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w}, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void debug(char *msg) { puts(msg); }


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

x86 assembly (clang, -O2):
<debug>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
size_t FNV32(char const *, int);
long get_hash(long key, size_t n) {
  return FNV32((const char *)&key, sizeof(key)) % n;
}


x86 assembly (clang, -O0):
<get_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <FNV32@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1030 <FNV32@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1142 <get_hash+0x32>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1148 <get_hash+0x38>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_hash(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = bitcast i64* %3 to i8*
%6 = call i64 @FNV32(i8* %5, i32 8)
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @get_hash(i64 %0, i64 %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = bitcast i64* %3 to i8*
%5 = call i64 @FNV32(i8* %4, i32 8)
%6 = urem i64 %5, %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ interrupts();
__attribute__((__always___)) void _stepIRQ() { interrupts(); }


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

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

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

LLVM IR (-O2):
define void @_stepIRQ() {
%1 = tail call i32 (...) @interrupts()
ret void
}
/* Variables and functions */
int input(int *, int *, int *);
int min(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[100], len = 3, min_range[100], max_range[100];
  len = input(arr, min_range, max_range);
  printf("Minimum = %d \n", min(arr, len));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x1a4(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    -0x340(%rbp),%rsi
lea    -0x4d0(%rbp),%rdx
call   1030 <input@plt>
mov    %eax,-0x1a4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
call   1050 <min@plt>
mov    %eax,%esi
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x4b0,%rsp
lea    0x320(%rsp),%rbx
lea    0x190(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1030 <input@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <min@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x4b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Minimum = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca [100 x i32]
%5 = alloca [100 x i32]
store i32 0, i32* %1
store i32 3, i32* %3
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%9 = call i32 @input(i32* %6, i32* %7, i32* %8)
store i32 %9, i32* %3
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @min(i32* %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Minimum = %d \0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %1 to i8*
%5 = bitcast [100 x i32]* %2 to i8*
%6 = bitcast [100 x i32]* %3 to i8*
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%10 = call i32 @input(i32* %7, i32* %8, i32* %9)
%11 = call i32 @min(i32* %7, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}