xunge/DecIR huggingface dataset:
unsigned int read_dword(unsigned char *addr) { return *(unsigned int *)addr; }


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

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

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

LLVM IR (-O2):
define i32 @read_dword(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ myfree(int *);
void int_destroy(void *a) { myfree((int *)a); }


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

x86 assembly (clang, -O2):
<int_destroy>:
jmp    1030 <myfree@plt>

LLVM IR (-O0):
define void @int_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @myfree(i32* %4)
ret void
}

LLVM IR (-O2):
define void @int_destroy(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @myfree(i32* %2)
ret void
}
/* Type definitions */
struct backoff_timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct backoff_timer *);
void bt_free(struct backoff_timer *bt) { free(bt); }


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

x86 assembly (clang, -O2):
<bt_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.backoff_timer = type { i32 }
define void @bt_free(%struct.backoff_timer* nocapture %0) {
%2 = tail call i32 @free(%struct.backoff_timer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", argv[0]);
  execlp("ls", "ls", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}
unsigned long MPURegionCountGet(void) {
  return (((*((volatile unsigned long *)(0xE000ED90))) & 0x0000FF00) >> 8);
}


x86 assembly (clang, -O0):
<MPURegionCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed90,%eax
mov    (%rax),%rax
and    $0xff00,%rax
shr    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionCountGet>:
mov    $0xe000ed90,%eax
mov    (%rax),%rax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i64 @MPURegionCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758157200 to i64*)
%2 = and i64 %1, 65280
%3 = lshr i64 %2, 8
ret i64 %3
}

LLVM IR (-O2):
define i64 @MPURegionCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758157200 to i64*)
%2 = lshr i64 %1, 8
%3 = and i64 %2, 255
ret i64 %3
}
void kmemcheck_hide(struct pt_regs *regs) {}


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @kmemcheck_hide(%struct.pt_regs* nocapture %0) {
ret void
}
void PDO_DBG_ERR(char *msg) {}


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

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

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

LLVM IR (-O2):
define void @PDO_DBG_ERR(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astG3DFlush(void) {
  Report("astG3DFlush");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"astG3DFlush\00"
define i32 @astG3DFlush() {
%1 = tail call i32 @Report(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void zylonite_pxa300_init(void) {
  if (cpu_is_pxa300() || cpu_is_pxa310()) {
    panic("%s: PXA300/PXA310 not supported\n", __func__);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cpu_is_pxa300@plt>
cmp    $0x0,%eax
jne    1154 <zylonite_pxa300_init+0x24>
mov    $0x0,%al
call   1040 <cpu_is_pxa310@plt>
cmp    $0x0,%eax
je     1169 <zylonite_pxa300_init+0x39>
lea    0xea5(%rip),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1050 <cpu_is_pxa300@plt>
test   %eax,%eax
jne    1147 <zylonite_pxa300_init+0x17>
xor    %eax,%eax
call   1040 <cpu_is_pxa310@plt>
test   %eax,%eax
je     115d <zylonite_pxa300_init+0x2d>
lea    0xeb2(%rip),%rdi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <panic@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"%s: PXA300/PXA310 not supported\0A\00"
@__func__.zylonite_pxa300_init = [21 x i8] c"zylonite_pxa300_init\00"
define void @zylonite_pxa300_init() {
%1 = call i32 (...) @cpu_is_pxa300()
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (...) @cpu_is_pxa310()
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.zylonite_pxa300_init, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s: PXA300/PXA310 not supported\0A\00"
@__func__.zylonite_pxa300_init = [21 x i8] c"zylonite_pxa300_init\00"
define void @zylonite_pxa300_init() {
%1 = tail call i32 (...) @cpu_is_pxa300()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @cpu_is_pxa310()
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.zylonite_pxa300_init, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
double ruspma_rand_decimal();
double arm1(void) { return ruspma_rand_decimal() / 0.002; }


x86 assembly (clang, -O0):
<arm1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ruspma_rand_decimal@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm1>:
push   %rax
xor    %eax,%eax
call   1030 <ruspma_rand_decimal@plt>
divsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @arm1() {
%1 = call double (...) @ruspma_rand_decimal()
%2 = fdiv double %1, 2.000000e-03
ret double %2
}

LLVM IR (-O2):
define double @arm1() {
%1 = tail call double (...) @ruspma_rand_decimal()
%2 = fdiv double %1, 2.000000e-03
ret double %2
}
int test_imm_05uint8_reg(unsigned char val) {
  return ((val) & (0x05 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_05uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 5
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void _usb_debug_init_trace_log(void) {}


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

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

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

LLVM IR (-O2):
define void @_usb_debug_init_trace_log() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OpcodeArgumentMustBeDefinition(long p_position) {
  _Error(
      p_position,
      "Opcode argument must be a module variable, constant id or handler id");
}


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

x86 assembly (clang, -O2):
<Error_OpcodeArgumentMustBeDefinition>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"Opcode argument must be a module variable, constant id or handler id\00"
define void @Error_OpcodeArgumentMustBeDefinition(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"Opcode argument must be a module variable, constant id or handler id\00"
define void @Error_OpcodeArgumentMustBeDefinition(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}
void fild_WakeLock(void) {}


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

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

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

LLVM IR (-O2):
define void @fild_WakeLock() {
ret void
}
void dr1061(void *pv, int i) {
  *pv;
  i ? *pv : *pv;
  *pv, *pv;
}


x86 assembly (clang, -O0):
<dr1061>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111e <dr1061+0x1e>
mov    -0x8(%rbp),%rax
jmp    1122 <dr1061+0x22>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dr1061(i8* nocapture %0, i32 %1) {
ret void
}
free(p) char *p;
{ bZf(p); }


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

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

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

LLVM IR (-O2):
define i32 @free(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bZf to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
int mc_isprime(int x) {
  int i;
  if ((0 == (x & 1)) || (1 == x)) {
    return 0;
  }
  for (i = 3; (i * i) <= x; i += 2) {
    if (0 == (x % i)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<mc_isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1125 <mc_isprime+0x25>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1131 <mc_isprime+0x31>
movl   $0x0,-0x4(%rbp)
jmp    117f <mc_isprime+0x7f>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1178 <mc_isprime+0x78>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    1165 <mc_isprime+0x65>
movl   $0x0,-0x4(%rbp)
jmp    117f <mc_isprime+0x7f>
jmp    116a <mc_isprime+0x6a>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <mc_isprime+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_isprime>:
xor    %ecx,%ecx
cmp    $0x1,%edi
je     113b <mc_isprime+0x3b>
mov    %edi,%eax
and    $0x1,%eax
je     113b <mc_isprime+0x3b>
cmp    $0x9,%edi
jge    1119 <mc_isprime+0x19>
mov    $0x1,%eax
ret
mov    $0x3,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     113b <mc_isprime+0x3b>
add    $0x2,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1120 <mc_isprime+0x20>
mov    $0x1,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mc_isprime(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = icmp eq i32 %0, 1
%5 = or i1 %4, %3
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = icmp slt i32 %0, 9
br i1 %7, label %16, label %11
8: ; preds = %11
%9 = mul nsw i32 %15, %15
%10 = icmp sgt i32 %9, %0
br i1 %10, label %16, label %11
11: ; preds = %6, %8
%12 = phi i32 [ %15, %8 ], [ 3, %6 ]
%13 = srem i32 %0, %12
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i32 %12, 2
br i1 %14, label %16, label %8
16: ; preds = %11, %8, %6, %1
%17 = phi i32 [ 0, %1 ], [ 1, %6 ], [ 0, %11 ], [ 1, %8 ]
ret i32 %17
}
void v_result(const double *A, const double *B, double *C) {
  C[0] = B[0] - A[0];
  C[1] = B[1] - A[1];
  C[2] = B[2] - A[2];
}


x86 assembly (clang, -O0):
<v_result>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_result>:
movsd  (%rsi),%xmm0
subsd  (%rdi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @v_result(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @v_result(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = load double, double* %0
%6 = fsub double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
void AddPolyn(struct node *head1, struct node *head2) {}


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define void @AddPolyn(%struct.node* nocapture %0, %struct.node* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_shld(int, int, int);
void test_shld(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_shld(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_shld(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_shld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_shld+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_shld@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_shld+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_shld+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_shld@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_shld+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shld>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_shld@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_shld+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_shld@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_shld+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_shld() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_shld(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_shld(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_shld() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_shld(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_shld(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
int func(int x, int y) { return (x + y); }


x86 assembly (clang, -O0):
<func>:
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):
<func>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @func(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 @func(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void test1() {
  extern volatile _Complex float test1_v;
  test1_v = test1_v;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
movss  (%rax),%xmm1
mov    0x2ee2(%rip),%rax
movss  0x4(%rax),%xmm0
mov    0x2ed6(%rip),%rax
movss  %xmm1,(%rax)
mov    0x2ecb(%rip),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    0x2ef1(%rip),%rax
movss  (%rax),%xmm0
movss  0x4(%rax),%xmm1
movss  %xmm0,(%rax)
movss  %xmm1,0x4(%rax)
ret

LLVM IR (-O0):
@test1_v = external global { float, float }
define void @test1() {
%1 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i32 0, i32 0)
%2 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i32 0, i32 1)
store volatile float %1, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i32 0, i32 0)
store volatile float %2, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@test1_v = external global { float, float }
define void @test1() {
%1 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i64 0, i32 0)
%2 = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i64 0, i32 1)
store volatile float %1, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i64 0, i32 0)
store volatile float %2, float* getelementptr inbounds ({ float, float }, { float, float }* @test1_v, i64 0, i32 1)
ret void
}
int fun_2_in_so(int x, int y) { return 20 + x + y; }


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

x86 assembly (clang, -O2):
<fun_2_in_so>:
lea    (%rdi,%rsi,1),%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_2_in_so(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 = add nsw i32 20, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fun_2_in_so(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 20
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cls();
int /*<<< orphan*/ lcd_goto(int);
int /*<<< orphan*/ lcd_putch(char);
int /*<<< orphan*/ lcd_putstr(char const *);
void lcd_disp(const char *s) {
  lcd_cls();
  lcd_goto(0x00);
  lcd_putstr(s);
  lcd_putch('\n');
}


x86 assembly (clang, -O0):
<lcd_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <lcd_cls@plt>
xor    %edi,%edi
call   1030 <lcd_goto@plt>
mov    -0x8(%rbp),%rdi
call   1040 <lcd_putstr@plt>
mov    $0xa,%edi
call   1050 <lcd_putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_disp>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <lcd_cls@plt>
xor    %edi,%edi
call   1030 <lcd_goto@plt>
mov    %rbx,%rdi
call   1040 <lcd_putstr@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1050 <lcd_putch@plt>

LLVM IR (-O0):
define void @lcd_disp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @lcd_cls()
%4 = call i32 @lcd_goto(i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @lcd_putstr(i8* %5)
%7 = call i32 @lcd_putch(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @lcd_disp(i8* %0) {
%2 = tail call i32 (...) @lcd_cls()
%3 = tail call i32 @lcd_goto(i32 0)
%4 = tail call i32 @lcd_putstr(i8* %0)
%5 = tail call i32 @lcd_putch(i8 signext 10)
ret void
}
int test_imm_EEint8_mem(signed char *val) {
  return ((*val) & (0xEE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EEint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xee,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -18
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello world.This is \0 a test!");
  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)
lea    0xed3(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello world.This is \00 a test!\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 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello world.This is \00 a test!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void cmp(p, a, s) struct h8_opcode *p;
char *a;
int s;
{
  decode(p, 1, s);
  printf("srca = -srca;\n");
  printf("dst = srca + srcb;\n");
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <decode@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %rax
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <decode@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [15 x i8] c"srca = -srca;\0A\00"
@.str.1 = [20 x i8] c"dst = srca + srcb;\0A\00"
define void @cmp(%struct.h8_opcode* %0, i8* %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i8*
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.h8_opcode*, %struct.h8_opcode** %4
%8 = load i32, i32* %6
%9 = call i32 (%struct.h8_opcode*, i32, i32, ...) bitcast (i32 (...)* @decode to i32 (%struct.h8_opcode*, i32, i32, ...)*)(%struct.h8_opcode* %7, i32 1, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@str = [14 x i8] c"srca = -srca;\00"
@str.2 = [19 x i8] c"dst = srca + srcb;\00"
define void @cmp(%struct.h8_opcode* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (%struct.h8_opcode*, i32, i32, ...) bitcast (i32 (...)* @decode to i32 (%struct.h8_opcode*, i32, i32, ...)*)(%struct.h8_opcode* %0, i32 1, i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
void gfxEnd() {
  curs_set(1);
  echo();
  endwin();
}


x86 assembly (clang, -O0):
<gfxEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfxEnd>:
push   %rax
mov    $0x1,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @gfxEnd() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 (...) @echo()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @gfxEnd() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 (...) @echo()
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ font_file_read(char *);
int /*<<< orphan*/ font_file_write(char *);
int /*<<< orphan*/ font_rename(char *);
int /*<<< orphan*/ font_scale_height(int);
int main(int argc, char *argv[]) {
  font_file_read(argv[1]);
  font_scale_height(2);
  font_rename("test");
  font_file_write("");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <font_file_read@plt>
mov    $0x2,%edi
call   1040 <font_scale_height@plt>
lea    0xe8c(%rip),%rdi
call   1050 <font_rename@plt>
lea    0xe84(%rip),%rdi
call   1060 <font_file_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <font_file_read@plt>
mov    $0x2,%edi
call   1040 <font_scale_height@plt>
lea    0xea5(%rip),%rdi
call   1050 <font_rename@plt>
lea    0xe9d(%rip),%rdi
call   1060 <font_file_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [1 x i8] zeroinitializer
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @font_file_read(i8* %8)
%10 = call i32 @font_scale_height(i32 2)
%11 = call i32 @font_rename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @font_file_write(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @font_file_read(i8* %4)
%6 = tail call i32 @font_scale_height(i32 2)
%7 = tail call i32 @font_rename(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @font_file_write(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
float builtin_fmaf(float b, float c, float d) {
  return __builtin_fmaf(b, c, d);
}


x86 assembly (clang, -O0):
<builtin_fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fmaf>:
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @builtin_fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @builtin_fmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ MUD_closeRead(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void field_error(int i_fh, char *Name) {
  MUD_closeRead(i_fh);
  fprintf(stderr, "Error processing %s.\n", Name);
}


x86 assembly (clang, -O0):
<field_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <MUD_closeRead@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<field_error>:
push   %rbx
mov    %rsi,%rbx
call   1030 <MUD_closeRead@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Error processing %s.\0A\00"
define void @field_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @MUD_closeRead(i32 %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Error processing %s.\0A\00"
define void @field_error(i32 %0, i8* %1) {
%3 = tail call i32 @MUD_closeRead(i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MEM_SetByte(unsigned int, unsigned int);
void m68k_write_memory_32(unsigned int addr, unsigned int val) {
  MEM_SetByte(addr + 3, val);
  MEM_SetByte(addr + 2, val >> 8);
  MEM_SetByte(addr + 1, val >> 16);
  MEM_SetByte(addr + 0, val >> 24);
}


x86 assembly (clang, -O0):
<m68k_write_memory_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
call   1030 <MEM_SetByte@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
shr    $0x8,%esi
call   1030 <MEM_SetByte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
shr    $0x10,%esi
call   1030 <MEM_SetByte@plt>
mov    -0x4(%rbp),%edi
add    $0x0,%edi
mov    -0x8(%rbp),%esi
shr    $0x18,%esi
call   1030 <MEM_SetByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_write_memory_32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0x3(%r14),%edi
call   1030 <MEM_SetByte@plt>
lea    0x2(%r14),%edi
mov    %ebx,%esi
shr    $0x8,%esi
call   1030 <MEM_SetByte@plt>
lea    0x1(%r14),%edi
mov    %ebx,%esi
shr    $0x10,%esi
call   1030 <MEM_SetByte@plt>
shr    $0x18,%ebx
mov    %r14d,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <MEM_SetByte@plt>

LLVM IR (-O0):
define void @m68k_write_memory_32(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 = add i32 %5, 3
%7 = load i32, i32* %4
%8 = call i32 @MEM_SetByte(i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = add i32 %9, 2
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = call i32 @MEM_SetByte(i32 %10, i32 %12)
%14 = load i32, i32* %3
%15 = add i32 %14, 1
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = call i32 @MEM_SetByte(i32 %15, i32 %17)
%19 = load i32, i32* %3
%20 = add i32 %19, 0
%21 = load i32, i32* %4
%22 = lshr i32 %21, 24
%23 = call i32 @MEM_SetByte(i32 %20, i32 %22)
ret void
}

LLVM IR (-O2):
define void @m68k_write_memory_32(i32 %0, i32 %1) {
%3 = add i32 %0, 3
%4 = tail call i32 @MEM_SetByte(i32 %3, i32 %1)
%5 = add i32 %0, 2
%6 = lshr i32 %1, 8
%7 = tail call i32 @MEM_SetByte(i32 %5, i32 %6)
%8 = add i32 %0, 1
%9 = lshr i32 %1, 16
%10 = tail call i32 @MEM_SetByte(i32 %8, i32 %9)
%11 = lshr i32 %1, 24
%12 = tail call i32 @MEM_SetByte(i32 %0, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_kill;
int /*<<< orphan*/ syscall_2(int /*<<< orphan*/, int, int);
void kill(int pid, int sig) { syscall_2(SYS_kill, pid, sig); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_2@plt>

LLVM IR (-O0):
@SYS_kill = global i32 0
define void @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_kill
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall_2(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SYS_kill = global i32 0
define void @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_kill
%4 = tail call i32 @syscall_2(i32 %3, i32 %0, i32 %1)
ret void
}
int negationValue(int x) {
  if (x == 1) {
    return 0;
    ;
  } else
    return 1;
  ;
}


x86 assembly (clang, -O0):
<negationValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <negationValue+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <negationValue+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negationValue>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @negationValue(i32 %0) {
%2 = icmp ne i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void test_non_identifiers() {
  int i, x;
#pragma omp target teams distribute parallel for simd;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute parallel for simd private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute parallel for simd, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
double bar(double a) { return __builtin_pow(a, 1.0 + 0.00390625); }


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

x86 assembly (clang, -O2):
<bar>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @bar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FF0100000000000)
ret double %4
}

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double @pow(double %0, double 0x3FF0100000000000)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
__attribute__((visibility("default"))) int
inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy(val, (u_int8_t *)databuf + offset, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_get_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rsi
mov    %rdx,%rdi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i8* %9, i32* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i8* %2, i32* %7, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire2() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE2"
                                             : "INPUT_KEYB_FIRE2");
}


x86 assembly (clang, -O0):
<f_input_fire2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire2>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE2\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE2\00"
define i8* @f_input_fire2() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE2\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE2\00"
define i8* @f_input_fire2() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}