xunge/DecIR huggingface dataset:
unsigned gcd(unsigned a, unsigned b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <gcd+0x30>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_spi_mma7455_accelrometer();
int iotbus_spi_test() {
  test_spi_mma7455_accelrometer();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @iotbus_spi_test() {
%1 = call i32 (...) @test_spi_mma7455_accelrometer()
ret i32 0
}

LLVM IR (-O2):
define i32 @iotbus_spi_test() {
%1 = tail call i32 (...) @test_spi_mma7455_accelrometer()
ret i32 0
}
/* Variables and functions */
int SIZE_MAX;
size_t wmath_npow2(size_t n) {
  size_t next = 1;
  if (n >= SIZE_MAX / 2) {
    next = SIZE_MAX;
  } else {
    while (next < n)
      next <<= 1;
  }
  return next;
}


x86 assembly (clang, -O0):
<wmath_npow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
jb     114e <wmath_npow2+0x4e>
mov    0x2e96(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <wmath_npow2+0x77>
jmp    1153 <wmath_npow2+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1172 <wmath_npow2+0x72>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <wmath_npow2+0x53>
jmp    1177 <wmath_npow2+0x77>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmath_npow2>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rcx
cmp    %rdi,%rcx
jbe    112b <wmath_npow2+0x2b>
mov    $0x1,%ecx
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1120 <wmath_npow2+0x20>
ret

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i64 @wmath_npow2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = load i32, i32* @SIZE_MAX
%6 = sdiv i32 %5, 2
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %4, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @SIZE_MAX
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
br label %21
12: ; preds = %1
br label %13
13: ; preds = %17, %12
%14 = load i64, i64* %3
%15 = load i64, i64* %2
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i64, i64* %3
%19 = shl i64 %18, 1
store i64 %19, i64* %3
br label %13
20: ; preds = %13
br label %21
21: ; preds = %20, %9
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i64 @wmath_npow2(i64 %0) {
%2 = load i32, i32* @SIZE_MAX
%3 = sdiv i32 %2, 2
%4 = sext i32 %3 to i64
%5 = icmp ugt i64 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = sext i32 %2 to i64
br label %12
8: ; preds = %1, %8
%9 = phi i64 [ %11, %8 ], [ 1, %1 ]
%10 = icmp ult i64 %9, %0
%11 = shl i64 %9, 1
br i1 %10, label %8, label %12
12: ; preds = %8, %6
%13 = phi i64 [ %7, %6 ], [ %9, %8 ]
ret i64 %13
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; i++) {
    int num = atoi(argv[i]);
    printf("%02x ", num);
  }
}


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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117a <main+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     115c <main+0x3c>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rdi
call   1040 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \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 1, i32* %6
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %8
24: ; preds = %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long time_in_milliseconds(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (((long long)tv.tv_sec) * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<time_in_milliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_in_milliseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @time_in_milliseconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @time_in_milliseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
const char *get_replays_path() { return "./replays"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"./replays\00"
define i8* @get_replays_path() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
unsigned char inportb(unsigned short _port) {
  unsigned char c;
  __asm__ __volatile__("inb %1, %0" : "=a"(c) : "dN"(_port));
  return c;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
void X509_SIG_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_SIG_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void s_intclr(int *ip1, int cnt) { memset(ip1, 0, cnt * sizeof(*ip1)); }


x86 assembly (clang, -O0):
<s_intclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_intclr>:
lea    0x0(,%rsi,4),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @s_intclr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i32* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @s_intclr(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void xmodem_send(uint8_t *addr_mem, uint32_t nb_bytes_to_send) {}


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

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

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

LLVM IR (-O2):
define void @xmodem_send(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xxcalloc(size_t nmemb, size_t size) { return (calloc(nmemb, size)); }


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

x86 assembly (clang, -O2):
<xxcalloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xxcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void dunno() {
  printf("I don't know about that\n");
  exit(0);
}


x86 assembly (clang, -O0):
<dunno>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dunno>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"I don't know about that\0A\00"
define void @dunno() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"I don't know about that\00"
define void @dunno() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_val(void *arg) {
  int val = *(int *)arg;
  printf("val = %d\n", val);
}


x86 assembly (clang, -O0):
<print_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_val>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"val = %d\0A\00"
define void @print_val(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int max(int a, int b) { return ((a > b) ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puti(long);
void putsi(short int x) { puti((long int)x); }


x86 assembly (clang, -O0):
<putsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rdi
call   1030 <puti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putsi>:
movslq %edi,%rdi
jmp    1030 <puti@plt>

LLVM IR (-O0):
define void @putsi(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
%5 = call i32 @puti(i64 %4)
ret void
}

LLVM IR (-O2):
define void @putsi(i16 signext %0) {
%2 = sext i16 %0 to i64
%3 = tail call i32 @puti(i64 %2)
ret void
}
void i2cSetMode(unsigned char __Mode) {
  if (__Mode == 0) {
  } else {
  }
}


x86 assembly (clang, -O0):
<i2cSetMode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    111c <i2cSetMode+0x1c>
jmp    1121 <i2cSetMode+0x21>
jmp    1121 <i2cSetMode+0x21>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @i2cSetMode(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @i2cSetMode(i8 zeroext %0) {
ret void
}
void caller_2_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_2_2_1_1() {
ret void
}
long double velocity_metresTime(long double M, long double T) { return M / T; }


x86 assembly (clang, -O0):
<velocity_metresTime>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<velocity_metresTime>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fdivp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @velocity_metresTime(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fdiv x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @velocity_metresTime(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
void priv_vm_mlock_cleanup(int asroot, int injail, struct test *test) {}


x86 assembly (clang, -O0):
<priv_vm_mlock_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define void @priv_vm_mlock_cleanup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
define void @priv_vm_mlock_cleanup(i32 %0, i32 %1, %struct.test* nocapture %2) {
ret void
}
int evt_upcall_creator() {}


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

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

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

LLVM IR (-O2):
define i32 @evt_upcall_creator() {
ret i32 undef
}
int rl_init_socket(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rl_init_socket() {
ret i32 0
}
/* Variables and functions */
double __dsign(double, double);
double intr_wrap_463(double p1, double p2) { return __dsign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_463>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__dsign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_463>:
jmp    1030 <__dsign@plt>

LLVM IR (-O0):
define double @intr_wrap_463(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__dsign(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @intr_wrap_463(double %0, double %1) {
%3 = tail call double @__dsign(double %0, double %1)
ret double %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char const *const);
int /*<<< orphan*/ strcpy(char *, char const *const);
int strlen(char const *const);
char *concat(const char *const a, const char *const b) {
  char *concat = malloc(sizeof(char) * (strlen(a) + strlen(b)));
  strcpy(concat, a);
  strcat(concat, b);
  return concat;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = mul i64 1, %11
%13 = trunc i64 %12 to i32
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
%8 = tail call i32 @strcat(i8* %6, i8* %1)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ draw();
int /*<<< orphan*/ init_lib(float, float);
int /*<<< orphan*/ input();
int /*<<< orphan*/ put(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ update();
int /*<<< orphan*/ wait();
int main() {
  init_lib(400.0f, 400.0f);
  put(0, 0, 0);
  for (;;) {
    input();
    update();
    draw();
    wait();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xe89(%rip),%xmm1
movaps %xmm1,%xmm0
call   1070 <init_lib@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1060 <put@plt>
mov    $0x0,%al
call   1040 <input@plt>
mov    $0x0,%al
call   1030 <update@plt>
mov    $0x0,%al
call   1050 <draw@plt>
mov    $0x0,%al
call   1080 <wait@plt>
jmp    118a <main+0x2a>

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xe97(%rip),%xmm0
movaps %xmm0,%xmm1
call   1070 <init_lib@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <put@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <input@plt>
xor    %eax,%eax
call   1030 <update@plt>
xor    %eax,%eax
call   1050 <draw@plt>
xor    %eax,%eax
call   1080 <wait@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init_lib(float 4.000000e+02, float 4.000000e+02)
%3 = call i32 @put(i32 0, i32 0, i32 0)
br label %4
4: ; preds = %4, %0
%5 = call i32 (...) @input()
%6 = call i32 (...) @update()
%7 = call i32 (...) @draw()
%8 = call i32 (...) @wait()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init_lib(float 4.000000e+02, float 4.000000e+02)
%2 = tail call i32 @put(i32 0, i32 0, i32 0)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @input()
%5 = tail call i32 (...) @update()
%6 = tail call i32 (...) @draw()
%7 = tail call i32 (...) @wait()
br label %3
}
void g_stpcpy() {}


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

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

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

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

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_it;
PKCS12 *d2i_PKCS12(PKCS12 **a, const unsigned char **in, long len) {
  return (PKCS12 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PKCS12_it);
}


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

x86 assembly (clang, -O2):
<d2i_PKCS12>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PKCS12_it = global i32 0
define i32* @d2i_PKCS12(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PKCS12_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PKCS12_it = global i32 0
define i32* @d2i_PKCS12(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PKCS12_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void sllp_client_stub() { return; }


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

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

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

LLVM IR (-O2):
define void @sllp_client_stub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay();
int /*<<< orphan*/ DisplayColourArea(unsigned char, unsigned char,
                                     int /*<<< orphan*/, int);
void DisplayColour(unsigned char BackgroundColour,
                   unsigned char ForegroundColour) {
  DisplayColourArea(BackgroundColour, ForegroundColour, 0, 2000);
  Delay();
}


x86 assembly (clang, -O0):
<DisplayColour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
xor    %edx,%edx
mov    $0x7d0,%ecx
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1040 <DisplayColourArea@plt>
mov    $0x0,%al
call   1030 <Delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayColour>:
push   %rax
xor    %edx,%edx
mov    $0x7d0,%ecx
call   1040 <DisplayColourArea@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Delay@plt>

LLVM IR (-O0):
define void @DisplayColour(i8 zeroext %0, i8 zeroext %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 i32 @DisplayColourArea(i8 zeroext %5, i8 zeroext %6, i32 0, i32 2000)
%8 = call i32 (...) @Delay()
ret void
}

LLVM IR (-O2):
define void @DisplayColour(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @DisplayColourArea(i8 zeroext %0, i8 zeroext %1, i32 0, i32 2000)
%4 = tail call i32 (...) @Delay()
ret void
}
void bgscan_notify_signal_change(struct wpa_supplicant *wpa_s, int above) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @bgscan_notify_signal_change(%struct.wpa_supplicant* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
bool getbit(int num, int i) { return ((num & (1 << i)) != 0); }


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @getbit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
int test_imm_80uint8_reg(unsigned char val) {
  return ((val) & (0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80uint8_reg>:
test   %dil,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80uint8_reg(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ BLAS_dload(int *, double *, double *, int *);
void dload(int n, double da, double *dx, int incx) {
  dx++;
  BLAS_dload(&n, &da, dx, &incx);
}


x86 assembly (clang, -O0):
<dload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <BLAS_dload@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dload>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
lea    0x8(%rsi),%rdx
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
call   1030 <BLAS_dload@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dload(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %7
%10 = getelementptr inbounds double, double* %9, i32 1
store double* %10, double** %7
%11 = load double*, double** %7
%12 = call i32 @BLAS_dload(i32* %5, double* %6, double* %11, i32* %8)
ret void
}

LLVM IR (-O2):
define void @dload(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %3, i32* %7
%8 = getelementptr inbounds double, double* %2, i64 1
%9 = call i32 @BLAS_dload(i32* %5, double* %6, double* %8, i32* %7)
ret void
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reset(struct terminal *);
void ris(struct terminal *term, void *arg) { reset(term); }


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

x86 assembly (clang, -O2):
<ris>:
jmp    1030 <reset@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @ris(%struct.terminal* %0, i8* %1) {
%3 = alloca %struct.terminal*
%4 = alloca i8*
store %struct.terminal* %0, %struct.terminal** %3
store i8* %1, i8** %4
%5 = load %struct.terminal*, %struct.terminal** %3
%6 = call i32 @reset(%struct.terminal* %5)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @ris(%struct.terminal* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @reset(%struct.terminal* %0)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ remove(char *);
int main() {
  if (remove(".")) {
    printf("%d\n", errno);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     115a <main+0x3a>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <remove@plt>
test   %rax,%rax
je     1147 <main+0x27>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @remove(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @errno
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i64 @remove(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stpcpy(char *, char *);
int strlen(char *);
void stpcpy_overflow(char *y) {
  char x[4];
  if (strlen(y) == 4)
    stpcpy(x, y);
}


x86 assembly (clang, -O0):
<stpcpy_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    114b <stpcpy_overflow+0x2b>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <stpcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    113f <stpcpy_overflow+0x1f>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <stpcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @stpcpy_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @stpcpy(i8* %8, i8* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @stpcpy_overflow(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @stpcpy(i8* %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
void __attribute__((__warning__("curl_easy_setopt expects a 'curl_mime *' "
                                "argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_curl_mimepost(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_curl_mimepost() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void exit_perror(int s, char *msg) {
  perror(msg);
  exit(s);
}


x86 assembly (clang, -O0):
<exit_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_perror>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_perror(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @exit_perror(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @perror(i8* %1)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_char(char *, struct char_data *);
void do_qui(struct char_data *ch, char *argument, int cmd) {
  send_to_char("You have to write quit - no less, to quit!\r\n", ch);
  return;
}


x86 assembly (clang, -O0):
<do_qui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <send_to_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.char_data = type { i32 }
@.str = [45 x i8] c"You have to write quit - no less, to quit!\0D\0A\00"
define void @do_qui(%struct.char_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.char_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.char_data* %0, %struct.char_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.char_data*, %struct.char_data** %4
%8 = call i32 @send_to_char(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), %struct.char_data* %7)
ret void
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
@.str = [45 x i8] c"You have to write quit - no less, to quit!\0D\0A\00"
define void @do_qui(%struct.char_data* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @send_to_char(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), %struct.char_data* %0)
ret void
}
char *replaceChars(char *str, char old, char new) {
  for (; *str; str++) {
    if (*str == old)
      *str = new;
  }
  return str;
}


x86 assembly (clang, -O0):
<replaceChars>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <replaceChars+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <replaceChars+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1141 <replaceChars+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <replaceChars+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceChars>:
mov    %rdi,%rax
mov    (%rdi),%cl
jmp    1118 <replaceChars+0x18>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1125 <replaceChars+0x25>
cmp    %sil,%cl
jne    1110 <replaceChars+0x10>
mov    %dl,(%rax)
jmp    1110 <replaceChars+0x10>
ret

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

LLVM IR (-O2):
define i8* @replaceChars(i8* %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
%16 = phi i8* [ %0, %3 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
char **malloc(int);
int /*<<< orphan*/ readText(char **, int *, int);
int main() {
  int columns = 2;
  int lines = 0;
  char **text = malloc(sizeof(char *));
  readText(text, &lines, columns);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x8,%edi
call   1030 <malloc@plt>
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
call   1040 <readText@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i8** @malloc(i32 8)
%4 = call i32 @readText(i8** %3, i32* %1, i32 2)
ret i32 0
}
unsigned long fib(x)
long x;
{
  if (x > 2)
    return (fib(x - 1) + fib(x - 2));
  else
    return (1);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jle    1158 <fib+0x48>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <fib+0x50>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%rdi
jl     114a <fib+0x3a>
mov    %rdi,%rbx
add    $0x2,%rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%rdi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x4,%rbx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -1
%7 = tail call i64 @fib(i64 %6)
%8 = add nsw i64 %4, -2
%9 = add i64 %7, %5
%10 = icmp ugt i64 %4, 4
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}