xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_repmat();
int main(int argc, char *argv[]) {
  test_repmat();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_repmat()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_repmat()
ret i32 0
}
unsigned int putch(unsigned char string, int y) {
  char *vgamem = (char *)0xb8000;
  unsigned int i2 = 0;
  i2 = (y * 80 * 2);
  vgamem[i2] = string;
  string++;
  i2++;
  vgamem[i2] = 0x2F;
  i2++;
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
imul   $0x50,-0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
shl    $0x5,%esi
lea    (%rsi,%rsi,4),%eax
mov    %dil,0xb8000(%rax)
add    $0xb8000,%rax
or     $0x1,%rax
movb   $0x2f,(%rax)
ret

LLVM IR (-O0):
define i32 @putch(i8 zeroext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8* inttoptr (i64 753664 to i8*), i8** %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 80
%10 = mul nsw i32 %9, 2
store i32 %10, i32* %7
%11 = load i8, i8* %4
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
%16 = load i8, i8* %4
%17 = add i8 %16, 1
store i8 %17, i8* %4
%18 = load i32, i32* %7
%19 = add i32 %18, 1
store i32 %19, i32* %7
%20 = load i8*, i8** %6
%21 = load i32, i32* %7
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 47, i8* %23
%24 = load i32, i32* %7
%25 = add i32 %24, 1
store i32 %25, i32* %7
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @putch(i8 zeroext %0, i32 %1) {
%3 = mul i32 %1, 160
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %4
store i8 %0, i8* %5
%6 = or i32 %3, 1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %7
store i8 47, i8* %8
ret i32 undef
}
unsigned short __atomic_load_2(const volatile void *atom, int memorder) {
  return *(volatile unsigned short *)atom;
}


x86 assembly (clang, -O0):
<__atomic_load_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_load_2>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @__atomic_load_2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i16*
%7 = load volatile i16, i16* %6
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @__atomic_load_2(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i16*
%4 = load volatile i16, i16* %3
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int);
pid_t Waitpid(pid_t pid, int *iptr, int options) {
  pid_t retpid;
  retpid = waitpid(pid, iptr, options);
  return (retpid);
}


x86 assembly (clang, -O0):
<Waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <waitpid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Waitpid>:
jmp    1030 <waitpid@plt>

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

LLVM IR (-O2):
define i32 @Waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int thing_var;
  int *thing_ptr;
  thing_var = 2;
  printf("Thing %d\n", thing_var);
  thing_ptr = &thing_var;
  *thing_ptr = 3;
  printf("Thing %d\n", thing_var);
  printf("Thing %d\n", *thing_ptr);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Thing %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int, int, int);
int /*<<< orphan*/ printfail();
void fexpect(char *file, int line, int a, int b) {
  if (a == b)
    return;
  printfail();
  printf("%s:%d: %d expected, but got %d\n", file, line, a, b);
  exit(1);
}


x86 assembly (clang, -O0):
<fexpect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1157 <fexpect+0x27>
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <printfail@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fexpect>:
cmp    %ecx,%edx
jne    1135 <fexpect+0x5>
ret
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <printfail@plt>
lea    0xeac(%rip),%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%s:%d: %d expected, but got %d\0A\00"
define void @fexpect(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
ret void
13: ; preds = %4
%14 = call i32 (...) @printfail()
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i32 %17, i32 %18)
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"%s:%d: %d expected, but got %d\0A\00"
define void @fexpect(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %6, label %7
6: ; preds = %4
ret void
7: ; preds = %4
%8 = tail call i32 (...) @printfail()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i32 %3)
%10 = tail call i32 @exit(i32 1)
unreachable
}
void fd37(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    p012A:
      goto p012A;
      goto a;
    P012A:
      goto P012A;
      0;
    }
  a : {
    typedef int(*d)[n];
  P013A:
    goto P013A;
    0;
  }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd37>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd37+0x7>

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

LLVM IR (-O0):
define void @fd37(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd37(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void _interrupt_init() {
  outb(0x0020, 0x10 | 0x01);
  outb(0x00a0, 0x10 | 0x01);
  outb(0x0021, 0x20);
  outb(0x00a1, 0x20 + 8);
  outb(0x0021, 0x04);
  outb(0x00a1, 0x02);
  outb(0x0021, 0x01);
  outb(0x00a1, 0x01);
  outb(0x0021, 0xFB);
  outb(0x00a1, 0xFF);
}


x86 assembly (clang, -O0):
<_interrupt_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xfb,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_interrupt_init>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xfb,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @_interrupt_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 251)
%10 = call i32 @outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @_interrupt_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 251)
%10 = tail call i32 @outb(i32 161, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void flex_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<flex_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <flex_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flex_free>:
test   %rdi,%rdi
je     111a <flex_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @flex_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *p = malloc(sizeof(int));
  *p = 5;
  free(p);
  *p;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movl   $0x5,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 5, i32* %1
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
int count_char(const char *s, char c) {
  int i = 0, a = 0;
  while (1) {
    if (s[i] == '\0')
      return a;
    if (s[i] == c)
      a++;
    i++;
  }
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1136 <count_char+0x36>
mov    -0x14(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1157 <count_char+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <count_char+0x1c>

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i32 [ 0, %2 ], [ %13, %7 ]
ret i32 %6
7: ; preds = %2, %7
%8 = phi i64 [ %14, %7 ], [ 0, %2 ]
%9 = phi i8 [ %16, %7 ], [ %3, %2 ]
%10 = phi i32 [ %13, %7 ], [ 0, %2 ]
%11 = icmp eq i8 %9, %1
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = add nuw nsw i64 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %5, label %7
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_14() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 3;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_14>:
push   %rax
mov    $0xc40,%edi
call   1030 <exynos_5410_gpio_read@plt>
shr    $0x3,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_14() {
%1 = alloca i32
%2 = alloca i32
store i32 3136, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_14() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = lshr i32 %1, 3
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ COND_LS();
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sls_8_pd7(void) {
  m68ki_write_8(EA_A7_PD_8(), COND_LS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sls_8_pd7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_A7_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sls_8_pd7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_A7_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sls_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i64 (...) @COND_LS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sls_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i64 (...) @COND_LS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
int get_XMapEvent_send_event(void *_p) {
  return (int)((XMapEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMapEvent_send_event(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_XMapEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
const char *dhcp_version() { return "1.1.0"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.1.0\00"
define i8* @dhcp_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void RunRobotStart(struct Robot *robot) {}


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

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

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

LLVM IR (-O2):
%struct.Robot = type opaque
define void @RunRobotStart(%struct.Robot* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fake_acquire_cpu(int /*<<< orphan*/);
int /*<<< orphan*/ fake_release_cpu(int /*<<< orphan*/);
int /*<<< orphan*/ get_cpu();
int /*<<< orphan*/ rcu_qsctr_inc(int /*<<< orphan*/);
int cond_resched(void) {
  rcu_qsctr_inc(get_cpu());
  fake_release_cpu(get_cpu());
  fake_acquire_cpu(get_cpu());
  return 0;
}


x86 assembly (clang, -O0):
<cond_resched>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1030 <rcu_qsctr_inc@plt>
mov    $0x0,%al
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1040 <fake_release_cpu@plt>
mov    $0x0,%al
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1050 <fake_acquire_cpu@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_resched>:
push   %rax
xor    %eax,%eax
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1030 <rcu_qsctr_inc@plt>
xor    %eax,%eax
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1040 <fake_release_cpu@plt>
xor    %eax,%eax
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1050 <fake_acquire_cpu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cond_resched() {
%1 = call i32 (...) @get_cpu()
%2 = call i32 @rcu_qsctr_inc(i32 %1)
%3 = call i32 (...) @get_cpu()
%4 = call i32 @fake_release_cpu(i32 %3)
%5 = call i32 (...) @get_cpu()
%6 = call i32 @fake_acquire_cpu(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @cond_resched() {
%1 = tail call i32 (...) @get_cpu()
%2 = tail call i32 @rcu_qsctr_inc(i32 %1)
%3 = tail call i32 (...) @get_cpu()
%4 = tail call i32 @fake_release_cpu(i32 %3)
%5 = tail call i32 (...) @get_cpu()
%6 = tail call i32 @fake_acquire_cpu(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("unbini"
         " "
         "2.4"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"unbini 2.4\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"unbini 2.4\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xvp_alloc(scalar_t__);
char *xvp_strdup(char *s) {
  char *p = xvp_alloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<xvp_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xvp_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xvp_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xvp_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xvp_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xvp_alloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xvp_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xvp_alloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL_INFO;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_INFO_it;
X509_CRL_INFO *X509_CRL_INFO_new(void) {
  return (X509_CRL_INFO *)ASN1_item_new(&X509_CRL_INFO_it);
}


x86 assembly (clang, -O0):
<X509_CRL_INFO_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_CRL_INFO_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_CRL_INFO_it = global i32 0
define i32* @X509_CRL_INFO_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_CRL_INFO_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_CRL_INFO_it = global i32 0
define i32* @X509_CRL_INFO_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_CRL_INFO_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ CAN3_DriverIRQHandler();
__attribute__((weak)) void CAN3_IRQHandler(void) { CAN3_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @CAN3_IRQHandler() {
%1 = call i32 (...) @CAN3_DriverIRQHandler()
ret void
}

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

/* Variables and functions */
int getopt_long_only(int, char **, char const *, struct option const *, int *);
int do_getopt_long_only(int argc, const char **argv, const char *shortopts,
                        const struct option *longopts, int *longind) {
  return getopt_long_only(argc, (char **)argv, shortopts, longopts, longind);
}


x86 assembly (clang, -O0):
<do_getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <getopt_long_only@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_getopt_long_only>:
jmp    1030 <getopt_long_only@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @do_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @getopt_long_only(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @do_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void _Jv_ThrowAbstractMethodError(void) {
  fprintf(stderr, "panic: abstract method called\n");
  abort();
}


x86 assembly (clang, -O0):
<_Jv_ThrowAbstractMethodError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"panic: abstract method called\0A\00"
define void @_Jv_ThrowAbstractMethodError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"panic: abstract method called\0A\00"
define void @_Jv_ThrowAbstractMethodError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void gtk_combo_box_set_row_span_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_set_row_span_column() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("No external preprocessor!\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"No external preprocessor!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"No external preprocessor!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_CALL();
void do0xFD() { _I8080_CALL(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fdelete_rsp *);
void stor_fdelete_rsp_free(struct _stor_fdelete_rsp *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<stor_fdelete_rsp_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):
<stor_fdelete_rsp_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._stor_fdelete_rsp = type { i32 }
define void @stor_fdelete_rsp_free(%struct._stor_fdelete_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fdelete_rsp* %0)
ret void
}
/* Variables and functions */
char *emalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *estrdup(const char *oldstring) {
  char *s;
  s = emalloc(strlen(oldstring) + 1);
  strcpy(s, oldstring);
  return s;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <emalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @emalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @estrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @emalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ bubble();
int /*<<< orphan*/ createll();
int /*<<< orphan*/ display();
int /*<<< orphan*/ printf(char *);
void main() {
  createll();
  printf("\nBefore Sorting: ");
  display();
  bubble();
  printf("\nAfter Sorting: ");
  display();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <createll@plt>
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1040 <bubble@plt>
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <createll@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1040 <bubble@plt>
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <display@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0ABefore Sorting: \00"
@.str.1 = [17 x i8] c"\0AAfter Sorting: \00"
define void @main() {
%1 = call i32 (...) @createll()
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @display()
%4 = call i32 (...) @bubble()
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @display()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0ABefore Sorting: \00"
@.str.1 = [17 x i8] c"\0AAfter Sorting: \00"
define void @main() {
%1 = tail call i32 (...) @createll()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @display()
%4 = tail call i32 (...) @bubble()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @display()
ret void
}
/* Variables and functions */
int vhangup();
int main(void) { return vhangup(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <vhangup@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @vhangup()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vhangup()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void set_PAN_ID(short int *address) {
  write_ZIGBEE_short(0x01, address[0]);
  write_ZIGBEE_short(0x02, address[1]);
}


x86 assembly (clang, -O0):
<set_PAN_ID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1,%edi
movswl (%rax),%esi
call   1030 <write_ZIGBEE_short@plt>
mov    -0x8(%rbp),%rax
mov    $0x2,%edi
movswl 0x2(%rax),%esi
call   1030 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PAN_ID>:
push   %rbx
mov    %rdi,%rbx
movswl (%rdi),%esi
mov    $0x1,%edi
call   1030 <write_ZIGBEE_short@plt>
movswl 0x2(%rbx),%esi
mov    $0x2,%edi
pop    %rbx
jmp    1030 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @set_PAN_ID(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 0
%5 = load i16, i16* %4
%6 = call i32 @write_ZIGBEE_short(i32 1, i16 signext %5)
%7 = load i16*, i16** %2
%8 = getelementptr inbounds i16, i16* %7, i64 1
%9 = load i16, i16* %8
%10 = call i32 @write_ZIGBEE_short(i32 2, i16 signext %9)
ret void
}

LLVM IR (-O2):
define void @set_PAN_ID(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call i32 @write_ZIGBEE_short(i32 1, i16 signext %2)
%4 = getelementptr inbounds i16, i16* %0, i64 1
%5 = load i16, i16* %4
%6 = tail call i32 @write_ZIGBEE_short(i32 2, i16 signext %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ st2;
typedef int /*<<< orphan*/ st1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  struct foo {
    short f1;
    int f2;
    char f3;
  } __attribute__((packed));
  struct foo2 {
    int f2;
    short f1;
    char f3;
  };
  struct foo st1;
  struct foo2 st2;
  printf("st1=%d, st2=%d\n", sizeof(st1), sizeof(st2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.foo = type <{ i16, i32, i8 }>
%struct.foo2 = type { i32, i16, i8 }
@.str = [16 x i8] c"st1=%d, st2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.foo
%3 = alloca %struct.foo2
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7, i32 8)
ret i32 0
}

LLVM IR (-O2):
%struct.foo = type <{ i16, i32, i8 }>
%struct.foo2 = type { i32, i16, i8 }
@.str = [16 x i8] c"st1=%d, st2=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int squareOf(int);
int main(int argc, const char *argv[]) {
  int number = 5;
  int squared = squareOf(5);
  printf("\"%d\" squared is \"%d\".\n", number, squared);
  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)
movl   $0x5,-0x14(%rbp)
mov    $0x5,%edi
call   1040 <squareOf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"\22%d\22 squared is \22%d\22.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
%8 = call i32 @squareOf(i32 5)
store i32 %8, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\22%d\22 squared is \22%d\22.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @squareOf(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5, i32 %3)
ret i32 0
}
/* Variables and functions */
int main_cm3();
int main(void) { return main_cm3(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <main_cm3@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main_cm3()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_cm3()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int wait(int /*<<< orphan*/ *);
int main(void) {
  if (wait(NULL) == -1) {
    perror("wait");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
cmp    $0xffffffff,%eax
jne    114d <main+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <wait@plt>
cmp    $0xffffffff,%eax
je     1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1030 <perror@plt>
jmp    112d <main+0xd>

LLVM IR (-O0):
@.str = [5 x i8] c"wait\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @wait(i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"wait\00"
define i32 @main() {
%1 = tail call i32 @wait(i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
void no_dh_support(void) { return; }


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

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

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

LLVM IR (-O2):
define void @no_dh_support() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ceil(const uint64_t x, const uint64_t y) {
  if (x == 0 || y == 0) {
    return 0;
  }
  return ((x - 1) / y) + 1;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <ceil+0x1e>
cmpl   $0x0,-0xc(%rbp)
jne    112a <ceil+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    113a <ceil+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
xor    %eax,%eax
test   %edi,%edi
je     1115 <ceil+0x15>
test   %esi,%esi
je     1115 <ceil+0x15>
add    $0xffffffff,%edi
mov    %edi,%eax
cltd
idiv   %esi
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ceil(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = sdiv i32 %7, %1
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}