xunge/DecIR huggingface dataset:
long long r13(void *x) { return *(long long *)(x + 32755); }


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

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

LLVM IR (-O0):
define i64 @r13(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32755
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r13(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32755
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ LEDOutput(int);
int MAX7219WriteByte(int devFD, unsigned char address, unsigned char data) {
  uint8_t i;
  uint32_t x = 0x0000;
  x = (0x000f & address) << 8;
  x |= (0x00ff & data);
  LEDOutput(x);
  return 0;
}


x86 assembly (clang, -O0):
<MAX7219WriteByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movl   $0x0,-0x10(%rbp)
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
movzbl -0x6(%rbp),%eax
and    $0xff,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <LEDOutput@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX7219WriteByte>:
push   %rax
and    $0xf,%esi
shl    $0x8,%esi
lea    (%rsi,%rdx,1),%edi
call   1030 <LEDOutput@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MAX7219WriteByte(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i32 0, i32* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 15, %10
%12 = shl i32 %11, 8
store i32 %12, i32* %8
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = and i32 255, %14
%16 = load i32, i32* %8
%17 = or i32 %16, %15
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = call i32 @LEDOutput(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @MAX7219WriteByte(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %1, 15
%5 = zext i8 %4 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = zext i8 %2 to i32
%8 = or i32 %6, %7
%9 = tail call i32 @LEDOutput(i32 %8)
ret i32 0
}
int main() {
  int arg1 = -105;
  int shr = 0;
  __asm__("shrl $4, %%eax;" : "=a"(shr) : "a"(arg1));
  if (shr != 268435449) {
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff97,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xffffff9,-0xc(%rbp)
je     1148 <main+0x38>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffff97,%eax
shr    $0x4,%eax
cmp    $0xffffff9,%eax
jne    1122 <main+0x12>
xor    %eax,%eax
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -105, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "shrl $$4, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 268435449
br i1 %7, label %8, label %9
8: ; preds = %0
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "shrl $$4, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 -105)
%2 = icmp eq i32 %1, 268435449
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by(int /*<<< orphan*/);
int /*<<< orphan*/ shl();
void shl_by(uint32_t x) {
  by(x);
  shl();
}


x86 assembly (clang, -O0):
<shl_by>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <by@plt>
mov    $0x0,%al
call   1040 <shl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_by>:
push   %rax
call   1030 <by@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <shl@plt>

LLVM IR (-O0):
define void @shl_by(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by(i32 %3)
%5 = call i32 (...) @shl()
ret void
}

LLVM IR (-O2):
define void @shl_by(i32 %0) {
%2 = tail call i32 @by(i32 %0)
%3 = tail call i32 (...) @shl()
ret void
}
int min(int x, int y) { return (x < y ? x : y); }


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

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

LLVM IR (-O0):
define i32 @min(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 slt 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 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void d_alloc_root(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<d_alloc_root>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_alloc_root>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.d_alloc_root = [13 x i8] c"d_alloc_root\00"
define void @d_alloc_root() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.d_alloc_root, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.d_alloc_root = [13 x i8] c"d_alloc_root\00"
define void @d_alloc_root() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.d_alloc_root, i64 0, i64 0))
ret void
}
void pos_table_zero_stats(void) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @pos_table_zero_stats() {
ret void
}
void *vrelptr(void *ptr) { return (void *)((unsigned int)ptr & ~0x04000000); }


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

x86 assembly (clang, -O2):
<vrelptr>:
mov    %rdi,%rax
and    $0xfbffffff,%eax
ret

LLVM IR (-O0):
define i8* @vrelptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = and i32 %4, -67108865
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @vrelptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 4227858431
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void exynos_unconfigure_iommu(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @exynos_unconfigure_iommu(%struct.device* nocapture %0) {
ret void
}
int is_machine_little_endian() {
  union {
    int i;
    char c[sizeof(int)];
  } u;
  u.i = 1;
  return (u.c[0] == 1);
}


x86 assembly (clang, -O0):
<is_machine_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @is_machine_little_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_machine_little_endian() {
ret i32 1
}
int main() {
  unsigned char *Iterator = "\x6\x8";
  switch (*(Iterator++)) {
  case (0x03):
  case (0x04):
    return 0x1;
  case (0x08):
    return 0x2;
  case (0x06):
  case (0x07):
    return 0x3;
  default:
    return 0x4;
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     1161 <main+0x61>
jmp    113c <main+0x3c>
mov    -0x14(%rbp),%eax
add    $0xfffffffa,%eax
sub    $0x2,%eax
jb     1179 <main+0x79>
jmp    1150 <main+0x50>
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
je     116d <main+0x6d>
jmp    1185 <main+0x85>
movl   $0x1,-0x4(%rbp)
jmp    118c <main+0x8c>
movl   $0x2,-0x4(%rbp)
jmp    118c <main+0x8c>
movl   $0x3,-0x4(%rbp)
jmp    118c <main+0x8c>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int tolower(int);
int __tolower_l(int c, locale_t l) { return tolower(c); }


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

x86 assembly (clang, -O2):
<__tolower_l>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @__tolower_l(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 = call i32 @tolower(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__tolower_l(i32 %0, i32 %1) {
%3 = tail call i32 @tolower(i32 %0)
ret i32 %3
}
/* Variables and functions */
int test_fifo(int, int, int);
int test_fifo_7_5_5(int argc, const char **argv) { return test_fifo(7, 5, 5); }


x86 assembly (clang, -O0):
<test_fifo_7_5_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7,%edi
mov    $0x5,%edx
mov    %edx,%esi
call   1030 <test_fifo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fifo_7_5_5>:
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x5,%edx
jmp    1030 <test_fifo@plt>

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

LLVM IR (-O2):
define i32 @test_fifo_7_5_5(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_fifo(i32 7, i32 5, i32 5)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_WARNING;
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int get_monotonic(struct timeval *tp) {
  static int posix_clock_set = 0;
  if (!posix_clock_set) {
    syslog(LOG_WARNING,
           "host does not support a monotonic clock - timing can skew");
    posix_clock_set = 1;
  }
  return gettimeofday(tp, NULL);
}


x86 assembly (clang, -O0):
<get_monotonic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2f01(%rip)
jne    1158 <get_monotonic+0x38>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <syslog@plt>
movl   $0x1,0x2edc(%rip)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_monotonic>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x2f09(%rip)
jne    1149 <get_monotonic+0x29>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1040 <syslog@plt>
movb   $0x1,0x2eeb(%rip)
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@get_monotonic.posix_clock_set = internal global i32 0
@LOG_WARNING = global i32 0
@.str = [58 x i8] c"host does not support a monotonic clock - timing can skew\00"
define i32 @get_monotonic(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load i32, i32* @get_monotonic.posix_clock_set
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @LOG_WARNING
%7 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* @get_monotonic.posix_clock_set
br label %8
8: ; preds = %5, %1
%9 = load %struct.timeval*, %struct.timeval** %2
%10 = call i32 @gettimeofday(%struct.timeval* %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@get_monotonic.posix_clock_set = internal unnamed_addr global i1 false
@LOG_WARNING = global i32 0
@.str = [58 x i8] c"host does not support a monotonic clock - timing can skew\00"
define i32 @get_monotonic(%struct.timeval* nocapture %0) {
%2 = load i1, i1* @get_monotonic.posix_clock_set
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @LOG_WARNING
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
store i1 true, i1* @get_monotonic.posix_clock_set
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret i32 %7
}
/* Variables and functions */
bool uniq(unsigned *ib, unsigned s, unsigned i) {
  unsigned j;
  for (j = s + 1; j < i; j++)
    if (ib[s] == ib[j])
      return false;
  return true;
}


x86 assembly (clang, -O0):
<uniq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    115c <uniq+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
cmp    (%rcx,%rdx,4),%eax
jne    1149 <uniq+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1163 <uniq+0x63>
jmp    114e <uniq+0x4e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <uniq+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniq>:
mov    %esi,%r8d
add    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
cmp    %edx,%esi
jae    1125 <uniq+0x25>
mov    (%rdi,%r8,4),%ecx
mov    %esi,%eax
add    $0x1,%esi
cmp    (%rdi,%rax,4),%ecx
jne    1110 <uniq+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @uniq(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
br label %6
6: ; preds = %10, %3
%7 = phi i32 [ %1, %3 ], [ %8, %10 ]
%8 = add i32 %7, 1
%9 = icmp ult i32 %8, %2
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %5
%12 = zext i32 %8 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %10
%17 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %17
}
/* Variables and functions */
bool nc_uninitialize(void) { return true; }


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

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

LLVM IR (-O0):
define i32 @nc_uninitialize() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nc_uninitialize() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
int main(void) {
  setup();
  while (true)
    loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @loop()
br label %2
}
void postMessage(unsigned int ldest, unsigned int lcommand,
                 unsigned int lpayload) {}


x86 assembly (clang, -O0):
<postMessage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @postMessage(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
ret void
}

LLVM IR (-O2):
define void @postMessage(i32 %0, i32 %1, i32 %2) {
ret void
}
int tolower(int c) {
  if ((c >= 'A') && (c <= 'Z'))
    return (c - 'A' + 'a');
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <tolower+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int getValue2();
int /*<<< orphan*/ use(int);
void foo2() {
  int x = getValue2();
  int y = x;
  use(5 / x);
  if (y == 0) {
  }
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getValue2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x5,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edi
call   1030 <use@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1157 <foo2+0x37>
jmp    1157 <foo2+0x37>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
xor    %eax,%eax
call   1040 <getValue2@plt>
mov    %eax,%ecx
mov    $0x5,%eax
xor    %edx,%edx
idiv   %ecx
mov    %eax,%edi
pop    %rax
jmp    1030 <use@plt>

LLVM IR (-O0):
define void @foo2() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getValue2()
store i32 %3, i32* %1
%4 = load i32, i32* %1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = sdiv i32 5, %5
%7 = call i32 @use(i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @foo2() {
%1 = tail call i32 (...) @getValue2()
%2 = sdiv i32 5, %1
%3 = tail call i32 @use(i32 %2)
ret void
}
double calculate_feet_per_second(double time_in_seconds) {
  double feet_per_second = 0.0;
  feet_per_second = 5280.0 / time_in_seconds;
  return feet_per_second;
}


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

x86 assembly (clang, -O2):
<calculate_feet_per_second>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_feet_per_second(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fdiv double 5.280000e+03, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @calculate_feet_per_second(double %0) {
%2 = fdiv double 5.280000e+03, %0
ret double %2
}
unsigned int PCGetSystemUpdateID() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PCGetSystemUpdateID() {
ret i32 0
}
void testClosureDIrV(void (*closure)(double, int), double a1, int a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDIrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureDIrV(void (double, i32)* %0, double %1, i32 %2) {
%4 = alloca void (double, i32)*
%5 = alloca double
%6 = alloca i32
store void (double, i32)* %0, void (double, i32)** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load void (double, i32)*, void (double, i32)** %4
%8 = load double, double* %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @testClosureDIrV(void (double, i32)* nocapture %0, double %1, i32 %2) {
tail call void %0(double %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void ADCIntRegister(unsigned long ulBase, unsigned long ulSequenceNum,
                    void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ;
  ulInt = 30 + ulSequenceNum;
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<ADCIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x20(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntRegister>:
push   %rbx
lea    0x1e(%rsi),%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @ADCIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca void ()*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store void ()* %2, void ()** %6
%8 = load i64, i64* %5
%9 = add i64 30, %8
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load void ()*, void ()** %6
%12 = bitcast void ()* %11 to void (...)*
%13 = call i32 @IntRegister(i64 %10, void (...)* %12)
%14 = load i64, i64* %7
%15 = call i32 @IntEnable(i64 %14)
ret void
}

LLVM IR (-O2):
define void @ADCIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = add i64 %1, 30
%5 = bitcast void ()* %2 to void (...)*
%6 = tail call i32 @IntRegister(i64 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convertToMorse(char *);
int /*<<< orphan*/ getLine(char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  char toCode[90];
  printf("Enter line to code: ");
  getLine(toCode, 90 + 1);
  convertToMorse(toCode);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x5b,%esi
call   1040 <getLine@plt>
lea    -0x60(%rbp),%rdi
call   1050 <convertToMorse@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5b,%esi
call   1040 <getLine@plt>
mov    %rbx,%rdi
call   1050 <convertToMorse@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter line to code: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [90 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%5 = call i32 @getLine(i8* %4, i32 91)
%6 = getelementptr inbounds [90 x i8], [90 x i8]* %2, i64 0, i64 0
%7 = call i32 @convertToMorse(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter line to code: \00"
define i32 @main() {
%1 = alloca [90 x i8]
%2 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getLine(i8* %2, i32 91)
%5 = call i32 @convertToMorse(i8* %2)
ret i32 0
}
/* Variables and functions */
double __infer_nondet_double();
double scalbln(double x, long int n) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @scalbln(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @scalbln(double %0, i64 %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
float clamp(float value, float min, float max) {
  if (value < min)
    return min;
  if (value > max)
    return max;
  return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clamp+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clamp+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <clamp+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clamp+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ DecodeAAs_xxxxdddxssxxxrrr();
int /*<<< orphan*/ DoBinOpSubX(int /*<<< orphan*/);
void DoCodeSubXm(void) { DoBinOpSubX(DecodeAAs_xxxxdddxssxxxrrr()); }


x86 assembly (clang, -O0):
<DoCodeSubXm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DecodeAAs_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpSubX@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeSubXm>:
push   %rax
xor    %eax,%eax
call   1040 <DecodeAAs_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpSubX@plt>

LLVM IR (-O0):
define void @DoCodeSubXm() {
%1 = call i32 (...) @DecodeAAs_xxxxdddxssxxxrrr()
%2 = call i32 @DoBinOpSubX(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeSubXm() {
%1 = tail call i32 (...) @DecodeAAs_xxxxdddxssxxxrrr()
%2 = tail call i32 @DoBinOpSubX(i32 %1)
ret void
}
int isprint(int c) {
  if (c <= 0x1f || c == 0x7f) {
    return 0;
  } else {
    return 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    111b <isprint+0x1b>
cmpl   $0x7f,-0x8(%rbp)
jne    1127 <isprint+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isprint+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
cmp    $0x20,%edi
setge  %al
cmp    $0x7f,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = icmp sgt i32 %0, 31
%3 = icmp ne i32 %0, 127
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ core1_print(char *, char const *);
void U_EMRPOLYBEZIER_print(const char *contents) {
  core1_print("U_EMRPOLYBEZIER", contents);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"U_EMRPOLYBEZIER\00"
define void @U_EMRPOLYBEZIER_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core1_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"U_EMRPOLYBEZIER\00"
define void @U_EMRPOLYBEZIER_print(i8* %0) {
%2 = tail call i32 @core1_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_ldx();
int /*<<< orphan*/ e_zpy();
void e_ldx_zpy() {
  e_zpy();
  e_ldx();
}


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

x86 assembly (clang, -O2):
<e_ldx_zpy>:
push   %rax
xor    %eax,%eax
call   1040 <e_zpy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_ldx@plt>

LLVM IR (-O0):
define void @e_ldx_zpy() {
%1 = call i32 (...) @e_zpy()
%2 = call i32 (...) @e_ldx()
ret void
}

LLVM IR (-O2):
define void @e_ldx_zpy() {
%1 = tail call i32 (...) @e_zpy()
%2 = tail call i32 (...) @e_ldx()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ setgid(int);
int /*<<< orphan*/ setuid(int);
void group_test_1() {
  DIR *dirp = NULL;
  do {
    setgid((100) + 1);
    setuid(101);
  } while (0);
  dirp = opendir("DIR_046");
  exit(dirp != NULL);
}


x86 assembly (clang, -O0):
<group_test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x65,%edi
call   1040 <setgid@plt>
mov    $0x65,%edi
call   1060 <setuid@plt>
lea    0xe95(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<group_test_1>:
push   %rax
mov    $0x65,%edi
call   1040 <setgid@plt>
mov    $0x65,%edi
call   1060 <setuid@plt>
lea    0xea4(%rip),%rdi
call   1030 <opendir@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"DIR_046\00"
define void @group_test_1() {
%1 = alloca i32*
store i32* null, i32** %1
br label %2
2: ; preds = %0
%3 = call i32 @setgid(i32 101)
%4 = call i32 @setuid(i32 101)
br label %5
5: ; preds = %2
%6 = call i32* @opendir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"DIR_046\00"
define void @group_test_1() {
%1 = tail call i32 @setgid(i32 101)
%2 = tail call i32 @setuid(i32 101)
%3 = tail call i32* @opendir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ baz(int, int);
void bar(int i) { baz(i, i); }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%esi
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @baz(i32 %0, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  int *p;
  a = 0;
  p = &b;
  *p = 1;
  p = &c;
  *p = 3;
  a = b + c;
  b = 3;
  c = 5;
  test_assert(a == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32* %3, i32** %5
%6 = load i32*, i32** %5
store i32 1, i32* %6
store i32* %4, i32** %5
%7 = load i32*, i32** %5
store i32 3, i32* %7
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 4
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int __int32_t_clone_array(const int32_t *p, int32_t *q, int elements) {
  memcpy(q, p, elements * sizeof(int32_t));
  return 0;
}


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

x86 assembly (clang, -O2):
<__int32_t_clone_array>:
push   %rax
mov    %rdi,%rax
shl    $0x2,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__int32_t_clone_array(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** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i32* %7, i32* %8, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @__int32_t_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %4)
ret i32 0
}
int next_fibonacci_number(int p, int q) { return (p + q); }


x86 assembly (clang, -O0):
<next_fibonacci_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_fibonacci_number>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @next_fibonacci_number(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @next_fibonacci_number(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
float foo(void) { return 1.f; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo() {
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @foo() {
ret float 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ screenshot(char *);
int main(int argc, char **argv) {
  if (argc < 2 || argc > 2) {
    printf("usage: screenshot filename\n");
    exit(1);
  }
  screenshot(argv[1]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     115a <main+0x2a>
cmpl   $0x2,-0x8(%rbp)
jle    1170 <main+0x40>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <screenshot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1030 <screenshot@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"usage: screenshot filename\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @screenshot(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"usage: screenshot filename\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @screenshot(i8* %9)
ret i32 0
}
void rsr() {
  asm volatile("popq %%rax\n\t"
               "popq %%rbx\n\t"
               "popq %%rcx\n\t"
               "pushq %%rax\n\t"
               "subq $0x8, 0x18(%%rbp)\n\t"
               "movq 0x18(%%rbp), %%rax\n\t"
               "movq 0x8(%%rax), %%rax\n\t"
               "movq %%rax, 0x10(%%rbp)\n\t"
               "jmp *%%rcx\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<rsr>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
pop    %rbx
pop    %rcx
push   %rax
subq   $0x8,0x18(%rbp)
mov    0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,0x10(%rbp)
jmp    *%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsr>:
pop    %rax
pop    %rbx
pop    %rcx
push   %rax
subq   $0x8,0x18(%rbp)
mov    0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,0x10(%rbp)
jmp    *%rcx
ret

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

LLVM IR (-O2):
define void @rsr() {
tail call void asm sideeffect "popq %rax\0A\09popq %rbx\0A\09popq %rcx\0A\09pushq %rax\0A\09subq $$0x8, 0x18(%rbp)\0A\09movq 0x18(%rbp), %rax\0A\09movq 0x8(%rax), %rax\0A\09movq %rax, 0x10(%rbp)\0A\09jmp *%rcx\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("Enter Two no.s\n");
  scanf("%d%d", &a, &b);
  int c = a + b;
  printf("total is %d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter Two no.s\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [13 x i8] c"total is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [13 x i8] c"total is %d\0A\00"
@str = [15 x i8] c"Enter Two no.s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}