xunge/DecIR huggingface dataset:
void HFlush() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __be32_to_cpu(int /*<<< orphan*/ const);
uint32_t get32_be(const uint32_t *p) { return __be32_to_cpu(*p); }


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

x86 assembly (clang, -O2):
<get32_be>:
mov    (%rdi),%edi
jmp    1030 <__be32_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @get32_be(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__be32_to_cpu(i32 %2)
ret i32 %3
}
IR0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     113b <IR0RX1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <IR0RX1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
mov    (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = icmp ule i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x24() {
  Assert_real((isalpha(36) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              185, ("isalpha should be 0 for $"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for $\00"
define void @t_isalpha_0x24() {
%1 = tail call i64 @isalpha(i32 36)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool nrf51_errata_34(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_34() {
ret i32 0
}
int main(int argc, char *argv[]) {
  int word[4] = {65};
  char *to_letter = &word;
  printf("%c\n", *to_letter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 65)
ret i32 0
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_del(struct event *);
int /*<<< orphan*/ free(struct event *);
void rdns_libevent_del_timer(void *priv_data, void *ev_data) {
  struct event *ev = ev_data;
  if (ev != NULL) {
    event_del(ev);
    free(ev);
  }
}


x86 assembly (clang, -O0):
<rdns_libevent_del_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <rdns_libevent_del_timer+0x35>
mov    -0x18(%rbp),%rdi
call   1040 <event_del@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdns_libevent_del_timer>:
test   %rsi,%rsi
je     113a <rdns_libevent_del_timer+0x1a>
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <event_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.event = type { i32 }
define void @rdns_libevent_del_timer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.event*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.event*
store %struct.event* %7, %struct.event** %5
%8 = load %struct.event*, %struct.event** %5
%9 = icmp ne %struct.event* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load %struct.event*, %struct.event** %5
%12 = call i32 @event_del(%struct.event* %11)
%13 = load %struct.event*, %struct.event** %5
%14 = call i32 @free(%struct.event* %13)
br label %15
15: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
define void @rdns_libevent_del_timer(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.event*
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @event_del(%struct.event* %3)
%7 = tail call i32 @free(%struct.event* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ xchg_u32(void *, unsigned long);
extern void *xchg_ptr(void *m, void *val) {
  return (void *)xchg_u32(m, (unsigned long)val);
}


x86 assembly (clang, -O0):
<xchg_ptr>:
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 <xchg_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xchg_ptr>:
jmp    1030 <xchg_u32@plt>

LLVM IR (-O0):
define i8* @xchg_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i64 @xchg_u32(i8* %5, i64 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @xchg_ptr(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i64 @xchg_u32(i8* %0, i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
int prim(int x) {
  int i;
  for (i = 2; i <= x / 2; i++)
    if (x % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115b <prim+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <prim+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <prim+0x62>
jmp    114d <prim+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <prim+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <prim+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <prim+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <prim+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @prim(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Type definitions */
struct sdesc {
  int dummy;
};

/* Variables and functions */
unsigned int sdesc_arity(struct sdesc const *);
unsigned int sdesc_fsize(struct sdesc const *);
unsigned int nstack_walk_frame_size(const struct sdesc *sdesc) {
  return sdesc_fsize(sdesc) + 1 + sdesc_arity(sdesc);
}


x86 assembly (clang, -O0):
<nstack_walk_frame_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sdesc_fsize@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sdesc_arity@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nstack_walk_frame_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <sdesc_fsize@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1040 <sdesc_arity@plt>
add    %r14d,%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sdesc = type { i32 }
define i32 @nstack_walk_frame_size(%struct.sdesc* %0) {
%2 = alloca %struct.sdesc*
store %struct.sdesc* %0, %struct.sdesc** %2
%3 = load %struct.sdesc*, %struct.sdesc** %2
%4 = call i32 @sdesc_fsize(%struct.sdesc* %3)
%5 = add i32 %4, 1
%6 = load %struct.sdesc*, %struct.sdesc** %2
%7 = call i32 @sdesc_arity(%struct.sdesc* %6)
%8 = add i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.sdesc = type { i32 }
define i32 @nstack_walk_frame_size(%struct.sdesc* %0) {
%2 = tail call i32 @sdesc_fsize(%struct.sdesc* %0)
%3 = add i32 %2, 1
%4 = tail call i32 @sdesc_arity(%struct.sdesc* %0)
%5 = add i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_add9() { CALC_appendString("9"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"9\00"
define void @CALC_add9() {
%1 = call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"9\00"
define void @CALC_add9() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 2;
  int i2 = ((i) ? -1 : 0) * i;
  printf("%d", i2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -2)
ret i32 0
}
char *rindex(s, c)
register char *s, c;
{ return 0; }


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

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

LLVM IR (-O0):
define i8* @rindex(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @rindex(i8* nocapture readnone %0, i8 signext %1) {
ret i8* null
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_)) __attribute__((const)) uint16_t bswap_16(uint16_t x) {
  x = (x >> 8) | (x << 8);
  return x;
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
__attribute__((no, noclone)) int foo(char *p) {
  p = (char *)__builtin_assume_aligned(p, __alignof__(int));
  int *q = (int *)p;
  return *q;
}


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

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

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int ocl_hw_atomic16_get(int index) {}


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

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

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

LLVM IR (-O2):
define i32 @ocl_hw_atomic16_get(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (int i = 0; i <= 10; i++)
    printf("*");
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 42)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @putchar(i32 42)
%11 = tail call i32 @putchar(i32 42)
%12 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ geteuid();
int check_for_root(void) {
  if (geteuid() != 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_for_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
je     1135 <check_for_root+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <check_for_root+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_root>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_for_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int LOGIN_NAME_MAX;
int getlogin_r(char *, int);
int test(void) {
  char loginnamebuffer[LOGIN_NAME_MAX];
  int result;
  result = getlogin_r(loginnamebuffer, LOGIN_NAME_MAX);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <getlogin_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <getlogin_r@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@LOGIN_NAME_MAX = global i32 0
define i32 @test() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i32
%4 = load i32, i32* @LOGIN_NAME_MAX
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %1
%7 = alloca i8, i64 %5
store i64 %5, i64* %2
%8 = load i32, i32* @LOGIN_NAME_MAX
%9 = call i32 @getlogin_r(i8* %7, i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i8*, i8** %1
ret i32 %10
}

LLVM IR (-O2):
@LOGIN_NAME_MAX = global i32 0
define i32 @test() {
%1 = load i32, i32* @LOGIN_NAME_MAX
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @getlogin_r(i8* %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  setvbuf(stdout, NULL, _IONBF, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_command_1D(int, short);
void LCD_data_write_up(short data) { LCD_command_1D(0xC0, data); }


x86 assembly (clang, -O0):
<LCD_data_write_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xc0,%edi
movswl -0x2(%rbp),%esi
call   1030 <LCD_command_1D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_data_write_up>:
mov    %edi,%esi
mov    $0xc0,%edi
jmp    1030 <LCD_command_1D@plt>

LLVM IR (-O0):
define void @LCD_data_write_up(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @LCD_command_1D(i32 192, i16 signext %3)
ret void
}

LLVM IR (-O2):
define void @LCD_data_write_up(i16 signext %0) {
%2 = tail call i32 @LCD_command_1D(i32 192, i16 signext %0)
ret void
}
void av_packet_from_data() {}


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

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

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

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

/* Variables and functions */
char *GetPath();
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
void UnlockSession(const char *session_name) {
  const char *path;
  char lock_file[1024];
  path = GetPath();
  snprintf(lock_file, sizeof(lock_file), "%s/.XSMlock-%s", path, session_name);
  remove(lock_file);
}


x86 assembly (clang, -O0):
<UnlockSession>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <GetPath@plt>
mov    %rax,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x400,%esi
lea    0xe9b(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <remove@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnlockSession>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <GetPath@plt>
lea    0xeb5(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rax,%rcx
mov    %rbx,%r8
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <remove@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s/.XSMlock-%s\00"
define void @UnlockSession(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
%5 = call i8* (...) @GetPath()
store i8* %5, i8** %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @remove(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s/.XSMlock-%s\00"
define void @UnlockSession(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* (...) @GetPath()
%5 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%6 = call i32 @remove(i8* %3)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_head(struct list *, struct list *);
int /*<<< orphan*/ list_del_element(struct list *);
void list_move_head(struct list *dest, struct list *src) {
  list_del_element(src);
  list_add_head(dest, src);
}


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

x86 assembly (clang, -O2):
<list_move_head>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <list_del_element@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add_head@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_move_head(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %4
%6 = call i32 @list_del_element(%struct.list* %5)
%7 = load %struct.list*, %struct.list** %3
%8 = load %struct.list*, %struct.list** %4
%9 = call i32 @list_add_head(%struct.list* %7, %struct.list* %8)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_move_head(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_del_element(%struct.list* %1)
%4 = tail call i32 @list_add_head(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
unsigned long ntohl(unsigned long);
unsigned long anp_sys_ntohl(unsigned long l) { return ntohl(l); }


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

x86 assembly (clang, -O2):
<anp_sys_ntohl>:
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i64 @anp_sys_ntohl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @ntohl(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @anp_sys_ntohl(i64 %0) {
%2 = tail call i64 @ntohl(i64 %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ declare_arrayNnomemset(int, int, int, int);
short **declare_short_nomemset(int first, int second) {
  return (short **)declare_arrayNnomemset(2, sizeof(short), first, second);
}


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

x86 assembly (clang, -O2):
<declare_short_nomemset>:
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x2,%esi
jmp    1030 <declare_arrayNnomemset@plt>

LLVM IR (-O0):
define i16** @declare_short_nomemset(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 = call i64 @declare_arrayNnomemset(i32 2, i32 2, i32 %5, i32 %6)
%8 = inttoptr i64 %7 to i16**
ret i16** %8
}

LLVM IR (-O2):
define i16** @declare_short_nomemset(i32 %0, i32 %1) {
%3 = tail call i64 @declare_arrayNnomemset(i32 2, i32 2, i32 %0, i32 %1)
%4 = inttoptr i64 %3 to i16**
ret i16** %4
}
/* Variables and functions */
int pow(int, double);
int /*<<< orphan*/ printf(char *, double);
void PrintGoldenRatio(void) {
  double g;
  g = 0.5 * (1 + pow(5, 0.5));
  printf("%lf\n", g);
}


x86 assembly (clang, -O0):
<PrintGoldenRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
movsd  0xecb(%rip),%xmm0
call   1040 <pow@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintGoldenRatio>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xebb(%rip),%xmm0
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define void @PrintGoldenRatio() {
%1 = alloca double
%2 = call i32 @pow(i32 5, double 5.000000e-01)
%3 = add nsw i32 1, %2
%4 = sitofp i32 %3 to double
%5 = fmul double 5.000000e-01, %4
store double %5, double* %1
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @PrintGoldenRatio() {
%1 = tail call i32 @pow(i32 5, double 5.000000e-01)
%2 = add nsw i32 %1, 1
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 5.000000e-01
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}
void fc88(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
  a : {
    typedef int(*d)[n];
    0;
  }
    goto a;
    ;
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc88(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %7
10: ; No predecessors!
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc88(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
char *itoa(int);
int /*<<< orphan*/ write_on_console(int /*<<< orphan*/);
int /*<<< orphan*/ write_str_on_console(char *);
void print_num(int a) {
  if (a == 0) {
    write_on_console('0');
    return;
  }
  char *num_str = itoa(a);
  write_str_on_console(num_str);
}


x86 assembly (clang, -O0):
<print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1154 <print_num+0x24>
mov    $0x30,%edi
call   1040 <write_on_console@plt>
jmp    1169 <print_num+0x39>
mov    -0x4(%rbp),%edi
call   1050 <itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <write_str_on_console@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num>:
test   %edi,%edi
je     1143 <print_num+0x13>
push   %rax
call   1050 <itoa@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <write_str_on_console@plt>
mov    $0x30,%edi
jmp    1040 <write_on_console@plt>

LLVM IR (-O0):
define void @print_num(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @write_on_console(i32 48)
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i8* @itoa(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @write_str_on_console(i8* %11)
br label %13
13: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @print_num(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @write_on_console(i32 48)
br label %8
5: ; preds = %1
%6 = tail call i8* @itoa(i32 %0)
%7 = tail call i32 @write_str_on_console(i8* %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int __real__xlsmp_DynamicChunkCall(long, long, long, long, long);
int __wrap__xlsmp_DynamicChunkCall(long a1, long a2, long a3, long a4,
                                   long a5) {
  int ret;
  ret = __real__xlsmp_DynamicChunkCall(a1, a2, a3, a4, a5);
  return ret;
}


x86 assembly (clang, -O0):
<__wrap__xlsmp_DynamicChunkCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <__real__xlsmp_DynamicChunkCall@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap__xlsmp_DynamicChunkCall>:
jmp    1030 <__real__xlsmp_DynamicChunkCall@plt>

LLVM IR (-O0):
define i32 @__wrap__xlsmp_DynamicChunkCall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = call i32 @__real__xlsmp_DynamicChunkCall(i64 %12, i64 %13, i64 %14, i64 %15, i64 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @__wrap__xlsmp_DynamicChunkCall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @__real__xlsmp_DynamicChunkCall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i32 %6
}
int mul_s(int a, int b, int c) {
  if (a * b + c > 9)
    return (a * b + c) % 10;
  return a * b + c;
}


x86 assembly (clang, -O0):
<mul_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x9,%eax
jle    113a <mul_s+0x3a>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1147 <mul_s+0x47>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_s>:
mov    %edi,%eax
imul   %esi,%eax
add    %edx,%eax
cmp    $0xa,%eax
jl     112a <mul_s+0x2a>
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mul_s(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
%13 = icmp sgt i32 %12, 9
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
%20 = srem i32 %19, 10
store i32 %20, i32* %4
br label %27
21: ; preds = %3
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
store i32 %26, i32* %4
br label %27
27: ; preds = %21, %14
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @mul_s(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = icmp sgt i32 %5, 9
%7 = srem i32 %5, 10
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
void foo(int **p, int *q) { *(*p++)++ = *q++; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rdx
mov    %rdx,%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x4,%rsi
mov    %rsi,(%rdx)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rsi),%eax
mov    (%rdi),%rcx
lea    0x4(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @foo(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32*, i32** %0
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %0
store i32 %3, i32* %4
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ printf(char *, int *, int);
int main(int argc, char **argv) {
  pid_t pid;
  pid = fork();
  printf("%p - %d\n", &pid, pid);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
lea    0xea6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,0x4(%rsp)
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%p - %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @fork()
store i32 %5, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}
char *strspl(left, right)
char *left, *right;
{
  char *res = (char *)malloc(strlen(left) + strlen(right) + 1);
  strcpy(res, left);
  strcat(res, right);
  return (res);
}


x86 assembly (clang, -O0):
<strspl>:
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    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
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):
<strspl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @strspl(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 i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i8* @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i8* @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @strspl(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* dereferenceable(1) %0)
%9 = tail call i8* @strcat(i8* dereferenceable(1) %7, i8* dereferenceable(1) %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(const char *message) {
  fputs(message, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ merge2i(int *, int, int *, int, int *);
void mergei(int arr[], int lb, int mid, int ub, int output[]) {
  merge2i(arr + lb, mid - lb, arr + mid, ub - mid, output + lb);
}


x86 assembly (clang, -O0):
<mergei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%r8
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
call   1030 <merge2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergei>:
movslq %esi,%rsi
lea    (%rdi,%rsi,4),%r9
movslq %edx,%rax
sub    %esi,%edx
lea    (%rdi,%rax,4),%r10
sub    %eax,%ecx
lea    (%r8,%rsi,4),%r8
mov    %r9,%rdi
mov    %edx,%esi
mov    %r10,%rdx
jmp    1030 <merge2i@plt>

LLVM IR (-O0):
define void @mergei(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %9
%23 = load i32, i32* %8
%24 = sub nsw i32 %22, %23
%25 = load i32*, i32** %10
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = call i32 @merge2i(i32* %14, i32 %17, i32* %21, i32 %24, i32* %28)
ret void
}

LLVM IR (-O2):
define void @mergei(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = sub nsw i32 %2, %1
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = sub nsw i32 %3, %2
%12 = getelementptr inbounds i32, i32* %4, i64 %6
%13 = tail call i32 @merge2i(i32* %7, i32 %8, i32* %10, i32 %11, i32* %12)
ret void
}