xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  float a[10];
  float *b;
  printf("%d %d %d\n", sizeof(a), sizeof(*a), sizeof(a[0]));
  printf("%d %d\n", sizeof(b), sizeof(*b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rdi
mov    $0x28,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 40, i32 4, i64 4)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ fact(int);
int64_t do_it() { return fact(10); }


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

x86 assembly (clang, -O2):
<do_it>:
mov    $0xa,%edi
jmp    1030 <fact@plt>

LLVM IR (-O0):
define i32 @do_it() {
%1 = call i32 @fact(i32 10)
ret i32 %1
}

LLVM IR (-O2):
define i32 @do_it() {
%1 = tail call i32 @fact(i32 10)
ret i32 %1
}
void zpodd_init(struct ata_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define void @zpodd_init(%struct.ata_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char *string = NULL;
  printf("Start\n");
  if (1 == argc)
    string = "_skip_\n";
  else
    string = "FAILURE\n";
  printf("%s", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    115a <main+0x4a>
lea    0xeb6(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <main+0x55>
lea    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebx
lea    0xec7(%rip),%rax
lea    0xec8(%rip),%rsi
cmove  %rax,%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"_skip_\0A\00"
@.str.2 = [9 x i8] c"FAILURE\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@str = [6 x i8] c"Start\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret i32 0
}
int main() {
  char *z = "dfdfsdfasfdasf";
  int k = 34;
  __asm__("movl $10, %eax;"
          "movl $20, %ebx;"
          "addl %ebx, %eax;");
  asm("movl $10, %eax;"
      "movl $20, %ebx;"
      "subl %ebx, %eax;");
  __asm("movl $10, %eax;"
        "movl $20, %ebx;"
        "imull %ebx, %eax;");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x22,-0x14(%rbp)
mov    $0xa,%eax
mov    $0x14,%ebx
add    %ebx,%eax
mov    $0xa,%eax
mov    $0x14,%ebx
sub    %ebx,%eax
mov    $0xa,%eax
mov    $0x14,%ebx
imul   %ebx,%eax
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xa,%eax
mov    $0x14,%ebx
add    %ebx,%eax
mov    $0xa,%eax
mov    $0x14,%ebx
sub    %ebx,%eax
mov    $0xa,%eax
mov    $0x14,%ebx
imul   %ebx,%eax
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "movl $$10, %eax;movl $$20, %ebx;addl %ebx, %eax;", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "movl $$10, %eax;movl $$20, %ebx;subl %ebx, %eax;", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "movl $$10, %eax;movl $$20, %ebx;imull %ebx, %eax;", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
struct timeval GetTimeStamp() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv;
}


x86 assembly (clang, -O0):
<GetTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimeStamp>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @GetTimeStamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @GetTimeStamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxint(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x10));
}


x86 assembly (clang, -O0):
<write_pxint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x10,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxint>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010010,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxint(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 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 16
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxint(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 16
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Type definitions */
typedef scalar_t__ __u64;

/* Variables and functions */
unsigned int tc_core_time2tick(int);
unsigned int tc_calc_xmittime(__u64 rate, unsigned int size) {
  return tc_core_time2tick(1000000 * ((double)size / (double)rate));
}


x86 assembly (clang, -O0):
<tc_calc_xmittime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm1
cvtsi2sdq -0x8(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <tc_core_time2tick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc_calc_xmittime>:
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
cvtsi2sd %rdi,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed8(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <tc_core_time2tick@plt>

LLVM IR (-O0):
define i32 @tc_calc_xmittime(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = uitofp i32 %5 to double
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = fmul double 1.000000e+06, %9
%11 = fptosi double %10 to i32
%12 = call i32 @tc_core_time2tick(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @tc_calc_xmittime(i64 %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i32
%8 = tail call i32 @tc_core_time2tick(i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCaptureFrame(char byBoardNum, long hWindow, long dwMsg, long bUseBoolPtr,
                   long dwPhysAddr, long dwLinaddr) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCaptureFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrame(i8 signext %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i8 %0, i8* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrame(i8 signext %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x4e() {
  Assert_real((ispunct(78) == 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_ispunct.c",
              395, ("ispunct should be 0 for N"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x4e>:
push   %rax
mov    $0x4e,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x18b,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for N\00"
define void @t_ispunct_0x4e() {
%1 = call i64 @ispunct(i32 78)
%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 395, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for N\00"
define void @t_ispunct_0x4e() {
%1 = tail call i64 @ispunct(i32 78)
%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 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo(int **__restrict p, int **__restrict q) {
  *p[0] = 1;
  *q[0] = 2;
  if (*p[0] != 2)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x2,(%rax)
je     1151 <foo+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    (%rdi),%rax
movl   $0x1,(%rax)
mov    (%rsi),%rcx
movl   $0x2,(%rcx)
cmpl   $0x2,(%rax)
jne    112a <foo+0x1a>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32** noalias %0, i32** noalias %1) {
%3 = alloca i32**
%4 = alloca i32**
store i32** %0, i32*** %3
store i32** %1, i32*** %4
%5 = load i32**, i32*** %3
%6 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
store i32 1, i32* %7
%8 = load i32**, i32*** %4
%9 = getelementptr inbounds i32*, i32** %8, i64 0
%10 = load i32*, i32** %9
store i32 2, i32* %10
%11 = load i32**, i32*** %3
%12 = getelementptr inbounds i32*, i32** %11, i64 0
%13 = load i32*, i32** %12
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo(i32** noalias nocapture %0, i32** noalias nocapture %1) {
%3 = load i32*, i32** %0
store i32 1, i32* %3
%4 = load i32*, i32** %1
store i32 2, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
char _getch();
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) {
  int x = 0;
  char c;
  while (1) {
    c = _getch();
    printf("%c", c);
  }
}


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   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <_getch@plt>
mov    %al,-0x15(%rbp)
lea    0xeb2(%rip),%rdi
movsbl -0x15(%rbp),%esi
call   1030 <printf@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <_getch@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 (...) @_getch()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %3
}
int in_opcode_range(const int opcode) {
  return ((opcode > -1) && (opcode < 50));
}


x86 assembly (clang, -O0):
<in_opcode_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <in_opcode_range+0x20>
cmpl   $0x32,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_opcode_range>:
xor    %eax,%eax
cmp    $0x32,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @in_opcode_range(i32 %0) {
%2 = icmp ult i32 %0, 50
%3 = zext i1 %2 to i32
ret i32 %3
}
abs(num) int num;
{
  if (num < 0)
    return (-num);
  else
    return (num);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_select();
int main(void) {
  runAllTests_select();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_select()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ itoa(unsigned int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[30];
  itoa(-((unsigned int)~0 >> 1) - 1, s, 25);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x80000000,%edi
mov    $0x19,%edx
call   1040 <itoa@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    $0x80000000,%edi
mov    %rbx,%rsi
mov    $0x19,%edx
call   1040 <itoa@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 -2147483648, i8* %3, i32 25)
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -2147483648, i8* %2, i32 25)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *strcasestr(char *, char *);
int main(int argc, char **argv) {
  char *r = 0;
  char s1[] = "ab";
  char s2[] = {'c'};
  char s3 = 0;
  r = strcasestr(s1, s2);
  assert(r == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x19(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
lea    -0x1b(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <strcasestr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
movb   $0x63,0x3(%rsp)
lea    0x4(%rsp),%rdi
lea    0x3(%rsp),%rsi
call   1040 <strcasestr@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s1 = [3 x i8] c"ab\00"
@__const.main.s2 = [1 x i8] c"c"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [3 x i8]
%8 = alloca [1 x i8]
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%10 = bitcast [3 x i8]* %7 to i8*
%11 = bitcast [1 x i8]* %8 to i8*
store i8 0, i8* %9
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
%14 = call i8* @strcasestr(i8* %12, i8* %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = icmp eq i8* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [3 x i8] c"ab\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = alloca [1 x i8]
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
store i8 99, i8* %6
%7 = call i8* @strcasestr(i8* %5, i8* %6)
%8 = icmp eq i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, float *, int);
void floatToFP32(float floatValue, char *fp32Pixel) {
  memcpy(fp32Pixel, &floatValue, sizeof(float));
}


x86 assembly (clang, -O0):
<floatToFP32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToFP32>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @floatToFP32(float %0, i8* %1) {
%3 = alloca float
store float %0, float* %3
%4 = call i32 @memcpy(i8* %1, float* %3, i32 4)
ret void
}
/* Type definitions */
struct copy_cmdline_parser_params {
  int dummy;
};
struct copy_args_info {
  int dummy;
};

/* Variables and functions */
int copy_cmdline_parser_internal(int, char **, struct copy_args_info *,
                                 struct copy_cmdline_parser_params *,
                                 int /*<<< orphan*/);
int copy_cmdline_parser_ext(int argc, char **argv,
                            struct copy_args_info *args_info,
                            struct copy_cmdline_parser_params *params) {
  int result;
  result = copy_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<copy_cmdline_parser_ext>:
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    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <copy_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <copy_cmdline_parser_internal@plt>

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

LLVM IR (-O2):
%struct.copy_args_info = type { i32 }
%struct.copy_cmdline_parser_params = type { i32 }
define i32 @copy_cmdline_parser_ext(i32 %0, i8** %1, %struct.copy_args_info* %2, %struct.copy_cmdline_parser_params* %3) {
%5 = tail call i32 @copy_cmdline_parser_internal(i32 %0, i8** %1, %struct.copy_args_info* %2, %struct.copy_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
char *bar_create(char *, char *, int);
char *navbar_create(char *inpath, char *baseurl) {
  return bar_create(inpath, baseurl, 1);
}


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

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

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

LLVM IR (-O2):
define i8* @navbar_create(i8* %0, i8* %1) {
%3 = tail call i8* @bar_create(i8* %0, i8* %1, i32 1)
ret i8* %3
}
void CMovableBrushEntity_OnEndClass(void) {}


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

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

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

LLVM IR (-O2):
define void @CMovableBrushEntity_OnEndClass() {
ret void
}
/* Variables and functions */
int alloc(int);
__attribute__((always_)) int fun_d(int argd) {
  static int locd = 0;
  if (argd > 0)
    locd += argd;
  return alloc(locd);
}


x86 assembly (clang, -O0):
<fun_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <fun_d+0x24>
mov    -0x4(%rbp),%eax
add    0x2efe(%rip),%eax
mov    %eax,0x2ef8(%rip)
mov    0x2ef2(%rip),%edi
call   1030 <alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_d>:
mov    %edi,%eax
mov    0x2f14(%rip),%edi
test   %eax,%eax
jle    1124 <fun_d+0x14>
add    %eax,%edi
mov    %edi,0x2f08(%rip)
jmp    1030 <alloc@plt>

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

LLVM IR (-O2):
@fun_d.locd = internal unnamed_addr global i32 0
define i32 @fun_d(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @fun_d.locd
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %3, %0
store i32 %5, i32* @fun_d.locd
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %3, %1 ]
%8 = tail call i32 @alloc(i32 %7)
ret i32 %8
}
void *mwsync_pbdhook_copy(void *chook) { return chook; }


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

x86 assembly (clang, -O2):
<mwsync_pbdhook_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @mwsync_pbdhook_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
double exp(double);
double df_gau(double x) { return exp(-16.0 * x * x); }


x86 assembly (clang, -O0):
<df_gau>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<df_gau>:
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @df_gau(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.600000e+01, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
define double @df_gau(double %0) {
%2 = fmul double %0, -1.600000e+01
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a, b;
  a = 10;
  b = 20;
  swap(&a, &b);
  printf("%d, %d%c", a, b, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea9(%rip),%rdi
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d, %d%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %1
store i32 20, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 10)
ret i32 0
}
int test_imm_50uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x50,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50uint64_midword_mem>:
testb  $0x50,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_50uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 80
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_50uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5242880
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ECAPAPWMShadowCaptureConfig(unsigned int baseAdd, unsigned int compareVal,
                                 unsigned int periodVal) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) = periodVal;
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = compareVal;
}


x86 assembly (clang, -O0):
<ECAPAPWMShadowCaptureConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPAPWMShadowCaptureConfig>:
lea    0x8(%rdi),%eax
mov    %edx,(%rax)
add    $0xc,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPAPWMShadowCaptureConfig(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = add i32 %8, 8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %7, i32* %11
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = add i32 %13, 12
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @ECAPAPWMShadowCaptureConfig(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %2, i32* %6
%7 = add i32 %0, 12
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %1, i32* %9
ret void
}
void av_log2() {}


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

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

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

LLVM IR (-O2):
define void @av_log2() {
ret void
}
/* Variables and functions */
int *extractSetFromBitVector(unsigned int *, int *, unsigned int);
int *mergeSets(int *, int *);
int *extractSetsFromBitVector(unsigned int *bitvector, unsigned int *bitvector2,
                              int *smallTreeTaxa, unsigned int vLength) {
  int *set1;
  int *set2;
  int *set;
  set1 = extractSetFromBitVector(bitvector, smallTreeTaxa, vLength);
  set2 = extractSetFromBitVector(bitvector2, smallTreeTaxa, vLength);
  set = mergeSets(set1, set2);
  return set;
}


x86 assembly (clang, -O0):
<extractSetsFromBitVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <extractSetFromBitVector@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <extractSetFromBitVector@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <mergeSets@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractSetsFromBitVector>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <extractSetFromBitVector@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <extractSetFromBitVector@plt>
mov    %r15,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mergeSets@plt>

LLVM IR (-O0):
define i32* @extractSetsFromBitVector(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%12 = load i32*, i32** %5
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32* @extractSetFromBitVector(i32* %12, i32* %13, i32 %14)
store i32* %15, i32** %9
%16 = load i32*, i32** %6
%17 = load i32*, i32** %7
%18 = load i32, i32* %8
%19 = call i32* @extractSetFromBitVector(i32* %16, i32* %17, i32 %18)
store i32* %19, i32** %10
%20 = load i32*, i32** %9
%21 = load i32*, i32** %10
%22 = call i32* @mergeSets(i32* %20, i32* %21)
store i32* %22, i32** %11
%23 = load i32*, i32** %11
ret i32* %23
}

LLVM IR (-O2):
define i32* @extractSetsFromBitVector(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32* @extractSetFromBitVector(i32* %0, i32* %2, i32 %3)
%6 = tail call i32* @extractSetFromBitVector(i32* %1, i32* %2, i32 %3)
%7 = tail call i32* @mergeSets(i32* %5, i32* %6)
ret i32* %7
}
int filter_close(struct filter *filter) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.filter = type opaque
define i32 @filter_close(%struct.filter* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
char hex(u_int8_t value) {
  if (value < 10)
    return '0' + (char)value;
  return 'a' + (char)(value - 10);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1122 <hex+0x22>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1131 <hex+0x31>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
movsbl %al,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @hex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *str_dup(const char *str) {
  char *copy;
  copy = (char *)malloc(strlen(str) + 1);
  if (!copy)
    return 0;
  strcpy(copy, str);
  return copy;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <str_dup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <str_dup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <str_dup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <str_dup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ padd(int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ swap32(size_t);
int /*<<< orphan*/ swap64(size_t);
void place_length(uint8_t *buffer, size_t bufsize, size_t length) {
  if (sizeof(size_t) == 4) {
    *(uint32_t *)padd(buffer, bufsize - 4) = swap32(length);
  } else {
    *(uint64_t *)padd(buffer, bufsize - 8) = swap64(length);
  }
}


x86 assembly (clang, -O0):
<place_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <swap64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
sub    $0x8,%rsi
call   1030 <padd@plt>
mov    -0x1c(%rbp),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_length>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
call   1040 <swap64@plt>
mov    %eax,%ebp
add    $0xfffffffffffffff8,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <padd@plt>
mov    %ebp,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @place_length(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = call i32 @swap64(i64 %7)
%9 = load i32*, i32** %4
%10 = load i64, i64* %5
%11 = sub i64 %10, 8
%12 = call i64 @padd(i32* %9, i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32 %8, i32* %13
ret void
}

LLVM IR (-O2):
define void @place_length(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @swap64(i64 %2)
%5 = add i64 %1, -8
%6 = tail call i64 @padd(i32* %0, i64 %5)
%7 = inttoptr i64 %6 to i32*
store i32 %4, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void data_abort_handler(void) { printf("DATA ABORT HANDLER\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"DATA ABORT HANDLER\00"
define void @data_abort_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ get_interval(double *, int const, double);
int test4() {
  const int nt = 3;
  double t[] = {0.0, 1.0, 2.0};
  double treq = -0.9;
  int i = -2;
  i = (int)get_interval(t, nt, treq);
  return (i == -1);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0x4(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x10(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0xfffffffe,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
mov    $0x3,%esi
call   1030 <get_interval@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
sub    $0x18,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
movsd  0xeca(%rip),%xmm0
mov    $0x3,%esi
call   1030 <get_interval@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test4.t = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test4() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca double
%4 = alloca i32
store i32 3, i32* %1
%5 = bitcast [3 x double]* %2 to i8*
store double -9.000000e-01, double* %3
store i32 -2, i32* %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = load double, double* %3
%8 = call i64 @get_interval(double* %6, i32 3, double %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test4.t = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00]
define i32 @test4() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = call i64 @get_interval(double* %3, i32 3, double -9.000000e-01)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}