xunge/DecIR huggingface dataset:
void nand_cmd(unsigned char cmd) {
  (*((volatile unsigned char *)0x70200008)) = cmd;
}


x86 assembly (clang, -O0):
<nand_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x70200008,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_cmd>:
mov    %dil,0x70200008
70
ret

LLVM IR (-O0):
define void @nand_cmd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 1881145352 to i8*)
ret void
}

LLVM IR (-O2):
define void @nand_cmd(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 1881145352 to i8*)
ret void
}
unsigned long long __atomic_fetch_or_8(volatile void *atom,
                                       unsigned long long value, int memorder) {
  unsigned long long xchg;
  unsigned long long cmp;
  __atomic_load((unsigned long long *)atom, (unsigned long long *)&cmp, 0);
  do {
    xchg = ((cmp | value));
  } while (!__atomic_compare_exchange((unsigned long long *)atom, &cmp, &xchg,
                                      1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_or_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
mov    %al,-0x39(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1154 <__atomic_fetch_or_8+0x54>
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x39(%rbp),%al
and    $0x1,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_fetch_or_8+0x1a>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_or_8>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
mov    %rax,%rdx
or     %rsi,%rdx
lock cmpxchg %rdx,(%rdi)
jne    1110 <__atomic_fetch_or_8+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__atomic_fetch_or_8(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load atomic i64, i64* %11 monotonic
store i64 %12, i64* %8
br label %13
13: ; preds = %26, %3
%14 = load i64, i64* %8
%15 = load i64, i64* %5
%16 = or i64 %14, %15
store i64 %16, i64* %7
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %8
%21 = load i64, i64* %7
%22 = cmpxchg weak i64* %19, i64 %20, i64 %21 seq_cst seq_cst
%23 = extractvalue { i64, i1 } %22, 0
%24 = extractvalue { i64, i1 } %22, 1
br i1 %24, label %26, label %25
25: ; preds = %17
store i64 %23, i64* %8
br label %26
26: ; preds = %25, %17
%27 = zext i1 %24 to i8
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = trunc i8 %28 to i1
%30 = xor i1 %29, true
br i1 %30, label %13, label %31
31: ; preds = %26
%32 = load i64, i64* %8
ret i64 %32
}

LLVM IR (-O2):
define i64 @__atomic_fetch_or_8(i8* nocapture %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i64*
%5 = load atomic i64, i64* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %5, %3 ], [ %11, %6 ]
%8 = or i64 %7, %1
%9 = cmpxchg weak i64* %4, i64 %7, i64 %8 seq_cst seq_cst
%10 = extractvalue { i64, i1 } %9, 1
%11 = extractvalue { i64, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *hlr_mallocs(size_t size) {
  void *p = malloc(size);
  if (!p)
    die("hlr_mallocs(%d)", size);
  return p;
}


x86 assembly (clang, -O0):
<hlr_mallocs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <hlr_mallocs+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlr_mallocs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <hlr_mallocs+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hlr_mallocs(%d)\00"
define i8* @hlr_mallocs(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"hlr_mallocs(%d)\00"
define noalias i8* @hlr_mallocs(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int cut_dyn(int *, int, int);
int cut_rec(int *, int, int);
int test_cut() {
  int prices[] = {0, 1, 5, 8, 9, 10, 17, 17, 20};
  return 22 == cut_rec(prices, 9, 8) && 22 == cut_dyn(prices, 9, 8);
}


x86 assembly (clang, -O0):
<test_cut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
mov    $0x8,%edx
call   1040 <cut_rec@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x16,%ecx
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
jne    1196 <test_cut+0x66>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
mov    $0x8,%edx
call   1050 <cut_dyn@plt>
mov    %eax,%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cut>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
mov    $0x8,%edx
call   1030 <cut_rec@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x16,%ecx
jne    117c <test_cut+0x5c>
mov    %rsp,%rdi
mov    $0x9,%esi
mov    $0x8,%edx
call   1040 <cut_dyn@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x16,%ecx
sete   %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_cut.prices = [9 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20]
define i32 @test_cut() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @cut_rec(i32* %3, i32 9, i32 8)
%5 = icmp eq i32 22, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = call i32 @cut_dyn(i32* %7, i32 9, i32 8)
%9 = icmp eq i32 22, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_cut.prices = [9 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20]
define i32 @test_cut() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @cut_rec(i32* %3, i32 9, i32 8)
%5 = icmp eq i32 %4, 22
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @cut_dyn(i32* %3, i32 9, i32 8)
%8 = icmp eq i32 %7, 22
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ msgBlank(int *);
void msg_blank_(int *const STATUS) {
  int status;
  status = *STATUS;
  msgBlank(&status);
  *STATUS = status;
}


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

x86 assembly (clang, -O2):
<msg_blank_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <msgBlank@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @msg_blank_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = call i32 @msgBlank(i32* %3)
%7 = load i32, i32* %3
%8 = load i32*, i32** %2
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @msg_blank_(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @msgBlank(i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void no_check_for_null_after_malloc() {
  int *p;
  p = (int *)malloc(sizeof(int));
  *p = 42;
  free(p);
}


x86 assembly (clang, -O0):
<no_check_for_null_after_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_check_for_null_after_malloc>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movl   $0x2a,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @no_check_for_null_after_malloc() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 42, i32* %4
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @no_check_for_null_after_malloc() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 42, i32* %2
%3 = tail call i32 @free(i32* %2)
ret void
}
void setVec3f(float *out, float x, float y, float z) {
  out[0] = x;
  out[1] = y;
  out[2] = z;
}


x86 assembly (clang, -O0):
<setVec3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setVec3f>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @setVec3f(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %7
%13 = load float*, float** %5
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float, float* %8
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
ret void
}

LLVM IR (-O2):
define void @setVec3f(float* nocapture writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _static(int);
int /*<<< orphan*/ dim(int);
int /*<<< orphan*/ eon(int);
int /*<<< orphan*/ on(int);
int power(int i) {
  if (i) {
    eon(0);
    _static(1);
    on(1);
    dim(150);
  } else {
    dim(0);
    eon(1);
    _static(0);
    on(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     117f <power+0x3f>
xor    %edi,%edi
call   1050 <eon@plt>
mov    $0x1,%edi
call   1030 <_static@plt>
mov    $0x1,%edi
call   1040 <on@plt>
mov    $0x96,%edi
call   1060 <dim@plt>
jmp    119e <power+0x5e>
xor    %edi,%edi
call   1060 <dim@plt>
mov    $0x1,%edi
call   1050 <eon@plt>
xor    %edi,%edi
call   1030 <_static@plt>
xor    %edi,%edi
call   1040 <on@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rax
test   %edi,%edi
je     116c <power+0x2c>
xor    %edi,%edi
call   1050 <eon@plt>
mov    $0x1,%edi
call   1030 <_static@plt>
mov    $0x1,%edi
call   1040 <on@plt>
mov    $0x96,%edi
call   1060 <dim@plt>
jmp    118b <power+0x4b>
xor    %edi,%edi
call   1060 <dim@plt>
mov    $0x1,%edi
call   1050 <eon@plt>
xor    %edi,%edi
call   1030 <_static@plt>
xor    %edi,%edi
call   1040 <on@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @eon(i32 0)
%5 = tail call i32 @_static(i32 1)
%6 = tail call i32 @on(i32 1)
%7 = tail call i32 @dim(i32 150)
br label %13
8: ; preds = %1
%9 = tail call i32 @dim(i32 0)
%10 = tail call i32 @eon(i32 1)
%11 = tail call i32 @_static(i32 0)
%12 = tail call i32 @on(i32 0)
br label %13
13: ; preds = %8, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *smb___renew(void *ptr, size_t newsize) {
  void *result = realloc(ptr, newsize);
  if (!result) {
    fprintf(stderr, "smb_renew: allocation error\n");
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<smb___renew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <smb___renew+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smb___renew>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <smb___renew+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"smb_renew: allocation error\0A\00"
define i8* @smb___renew(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"smb_renew: allocation error\0A\00"
define noalias i8* @smb___renew(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
int f5(volatile int *a) {
  int b = a[3];
  int c = a[2];
  return b + c;
}


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

x86 assembly (clang, -O2):
<f5>:
mov    0xc(%rdi),%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f5(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load volatile i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load volatile i32, i32* %9
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f5(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load volatile i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load volatile i32, i32* %4
%6 = add nsw i32 %5, %3
ret i32 %6
}
int aaa() { return 33; }


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

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

LLVM IR (-O0):
define i32 @aaa() {
ret i32 33
}

LLVM IR (-O2):
define i32 @aaa() {
ret i32 33
}
extern long double shmem_longdouble_g(long double *addr, int pe) {
  return *addr;
}


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

x86 assembly (clang, -O2):
<shmem_longdouble_g>:
fldt   (%rdi)
ret

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

LLVM IR (-O2):
define x86_fp80 @shmem_longdouble_g(x86_fp80* nocapture %0, i32 %1) {
%3 = load x86_fp80, x86_fp80* %0
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEifnonnull(int, int /*<<< orphan*/ *);
void code_ifnonnull(int label) { appendCODE(makeCODEifnonnull(label, NULL)); }


x86 assembly (clang, -O0):
<code_ifnonnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <makeCODEifnonnull@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ifnonnull>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEifnonnull@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

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

LLVM IR (-O2):
define void @code_ifnonnull(i32 %0) {
%2 = tail call i32 @makeCODEifnonnull(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
void mbed_trace_include_filters_set(char *filters) {}


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

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

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

LLVM IR (-O2):
define void @mbed_trace_include_filters_set(i8* nocapture %0) {
ret void
}
void remove2(void) { __asm__ __volatile__("" : : :); }


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

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

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

LLVM IR (-O2):
define void @remove2() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int setup_tty() { return !system("stty -icanon") && !system("stty -echo"); }


x86 assembly (clang, -O0):
<setup_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    114b <setup_tty+0x3b>
lea    0xed2(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_tty>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1127 <setup_tty+0x17>
pop    %rcx
ret
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"stty -icanon\00"
@.str.1 = [11 x i8] c"stty -echo\00"
define i32 @setup_tty() {
%1 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"stty -icanon\00"
@.str.1 = [11 x i8] c"stty -echo\00"
define i32 @setup_tty() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct common {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
int shmget(int, int /*<<< orphan*/, int /*<<< orphan*/);
struct common *get_shared() {
  int shmid;
  shmid = shmget(255, 0, 0);
  if (shmid < 0) {
    perror("Could not get shared memory");
    exit(EXIT_FAILURE);
  }
  return (struct common *)shmat(shmid, 0, 0);
}


x86 assembly (clang, -O0):
<get_shared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <shmget@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117d <get_shared+0x3d>
lea    0xe96(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <shmat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shared>:
push   %rax
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <shmget@plt>
test   %eax,%eax
js     115f <get_shared+0x1f>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <shmat@plt>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.common = type { i32 }
@.str = [28 x i8] c"Could not get shared memory\00"
@EXIT_FAILURE = global i32 0
define %struct.common* @get_shared() {
%1 = alloca i32
%2 = call i32 @shmget(i32 255, i32 0, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i64 @shmat(i32 %10, i32 0, i32 0)
%12 = inttoptr i64 %11 to %struct.common*
ret %struct.common* %12
}

LLVM IR (-O2):
%struct.common = type { i32 }
@.str = [28 x i8] c"Could not get shared memory\00"
@EXIT_FAILURE = global i32 0
define %struct.common* @get_shared() {
%1 = tail call i32 @shmget(i32 255, i32 0, i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
%8 = tail call i64 @shmat(i32 %1, i32 0, i32 0)
%9 = inttoptr i64 %8 to %struct.common*
ret %struct.common* %9
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
size_t wcsnlen(const wchar_t *s, size_t maxlen) {
  size_t n;
  for (n = 0; n < maxlen; ++n) {
    if (s[n] == L'\0')
      break;
  }
  return n;
}


x86 assembly (clang, -O0):
<wcsnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114f <wcsnlen+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1139 <wcsnlen+0x39>
jmp    114f <wcsnlen+0x4f>
jmp    113e <wcsnlen+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <wcsnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <wcsnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rax,4)
je     1122 <wcsnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <wcsnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @wcsnlen(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %9, %4, %2
%13 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %13
}
void foo139(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo139(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_pwr(int sig) { printf("PWR\n"); }


x86 assembly (clang, -O0):
<catch_pwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"PWR\0A\00"
define void @catch_pwr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"PWR\00"
define void @catch_pwr(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fb_fix_screeninfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_FSCREENINFO;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_fix_screeninfo *);
int /*<<< orphan*/ print_strerror_and_exit(char *);
void tfbm_get_fix_screen_info(int fh, struct fb_fix_screeninfo *fix) {
  if (ioctl(fh, FBIOGET_FSCREENINFO, fix)) {
    print_strerror_and_exit("ioctl FBIOGET_FSCREENINFO");
  }
}


x86 assembly (clang, -O0):
<tfbm_get_fix_screen_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
je     115a <tfbm_get_fix_screen_info+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <print_strerror_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfbm_get_fix_screen_info>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
je     1144 <tfbm_get_fix_screen_info+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <print_strerror_and_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.fb_fix_screeninfo = type { i32 }
@FBIOGET_FSCREENINFO = global i32 0
@.str = [26 x i8] c"ioctl FBIOGET_FSCREENINFO\00"
define void @tfbm_get_fix_screen_info(i32 %0, %struct.fb_fix_screeninfo* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_fix_screeninfo*
store i32 %0, i32* %3
store %struct.fb_fix_screeninfo* %1, %struct.fb_fix_screeninfo** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOGET_FSCREENINFO
%7 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_fix_screeninfo* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.fb_fix_screeninfo = type { i32 }
@FBIOGET_FSCREENINFO = global i32 0
@.str = [26 x i8] c"ioctl FBIOGET_FSCREENINFO\00"
define void @tfbm_get_fix_screen_info(i32 %0, %struct.fb_fix_screeninfo* %1) {
%3 = load i32, i32* @FBIOGET_FSCREENINFO
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_fix_screeninfo* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_node_data_struct(char *, char *, char *, char *,
                                             char *, char *);
void fgmvwrite_node_data_struct_(char *nxv, char *nyv, char *nzv, char *x,
                                 char *y, char *z) {
  gmvwrite_node_data_struct(nxv, nyv, nzv, x, y, z);
}


x86 assembly (clang, -O0):
<fgmvwrite_node_data_struct_>:
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    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <gmvwrite_node_data_struct@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_node_data_struct_>:
jmp    1030 <gmvwrite_node_data_struct@plt>

LLVM IR (-O0):
define void @fgmvwrite_node_data_struct_(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @gmvwrite_node_data_struct(i8* %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_node_data_struct_(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @gmvwrite_node_data_struct(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}
int test_imm_23uint8_reg(unsigned char val) {
  return ((val) & (-0x23 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_23uint8_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, -35
%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_23uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void montgomery_deinit(void *a) { free(a); }


x86 assembly (clang, -O0):
<montgomery_deinit>:
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):
<montgomery_deinit>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @montgomery_deinit(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *Dao_GetSymbolAddress(void *handle, const char *name) {
  void *sym = NULL;
  return sym;
}


x86 assembly (clang, -O0):
<Dao_GetSymbolAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_msat(uintptr_t);
void fiat_p256_msat(uint32_t out1[9]) {
  internal_fiat_p256_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_msat>:
jmp    1030 <internal_fiat_p256_msat@plt>

LLVM IR (-O0):
define void @fiat_p256_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p256_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p256_msat(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qbyte(char);
void out52(char c) {
  qbyte('\x1b');
  qbyte(c);
}


x86 assembly (clang, -O0):
<out52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
call   1030 <qbyte@plt>
movsbl -0x1(%rbp),%edi
call   1030 <qbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out52>:
push   %rbx
mov    %edi,%ebx
mov    $0x1b,%edi
call   1030 <qbyte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <qbyte@plt>

LLVM IR (-O0):
define void @out52(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @qbyte(i8 signext 27)
%4 = load i8, i8* %2
%5 = call i32 @qbyte(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @out52(i8 signext %0) {
%2 = tail call i32 @qbyte(i8 signext 27)
%3 = tail call i32 @qbyte(i8 signext %0)
ret void
}
double PathLength(long cols, long rows, long target_panel_size) {
  double path_length;
  path_length = 3 * (cols * rows - cols * (cols - 1) / 2);
  path_length *= target_panel_size;
  return (path_length);
}


x86 assembly (clang, -O0):
<PathLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
imul   $0x3,%rax,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathLength>:
imul   %rdi,%rsi
lea    -0x1(%rdi),%rax
imul   %rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
add    %rax,%rcx
sar    %rcx
sub    %rcx,%rsi
lea    (%rsi,%rsi,2),%rax
cvtsi2sd %rax,%xmm1
cvtsi2sd %rdx,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @PathLength(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = mul nsw i64 %8, %9
%11 = load i64, i64* %4
%12 = load i64, i64* %4
%13 = sub nsw i64 %12, 1
%14 = mul nsw i64 %11, %13
%15 = sdiv i64 %14, 2
%16 = sub nsw i64 %10, %15
%17 = mul nsw i64 3, %16
%18 = sitofp i64 %17 to double
store double %18, double* %7
%19 = load i64, i64* %6
%20 = sitofp i64 %19 to double
%21 = load double, double* %7
%22 = fmul double %21, %20
store double %22, double* %7
%23 = load double, double* %7
ret double %23
}

LLVM IR (-O2):
define double @PathLength(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %1, %0
%5 = add nsw i64 %0, -1
%6 = mul nsw i64 %5, %0
%7 = sdiv i64 %6, -2
%8 = add i64 %7, %4
%9 = mul nsw i64 %8, 3
%10 = sitofp i64 %9 to double
%11 = sitofp i64 %2 to double
%12 = fmul double %11, %10
ret double %12
}
void swap(int *a, int x, int y) {
  int t;
  t = a[x];
  a[x] = a[y];
  a[y] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int proc1(int a, int b) { return a + b; }


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

LLVM IR (-O0):
define i32 @proc1(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 @proc1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void kbd_uninit(void) {}


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

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

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

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

/* Variables and functions */
void plat_midi_play_sysex(uint8_t *sysex, unsigned int len) {}


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

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

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

LLVM IR (-O2):
define void @plat_midi_play_sysex(i32* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *pvalloc(size_t);
void *_pvalloc_r(struct _reent *ptr, size_t bytes) { return pvalloc(bytes); }


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

x86 assembly (clang, -O2):
<_pvalloc_r>:
mov    %rsi,%rdi
jmp    1030 <pvalloc@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_pvalloc_r(%struct._reent* %0, i64 %1) {
%3 = alloca %struct._reent*
%4 = alloca i64
store %struct._reent* %0, %struct._reent** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @pvalloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i8* @_pvalloc_r(%struct._reent* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @pvalloc(i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_write_dword(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeprom_update_float(float *addr, float value) {
  union {
    float f;
    uint32_t u32;
  } u;
  u.f = value;
  eeprom_write_dword((uint32_t *)addr, u.u32);
}


x86 assembly (clang, -O0):
<eeprom_update_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <eeprom_write_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_update_float>:
movd   %xmm0,%esi
jmp    1030 <eeprom_write_dword@plt>

LLVM IR (-O0):
%union.anon = type { float }
define void @eeprom_update_float(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca %union.anon
store float* %0, float** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = bitcast %union.anon* %5 to float*
store float %6, float* %7
%8 = load float*, float** %3
%9 = bitcast float* %8 to i32*
%10 = bitcast %union.anon* %5 to i32*
%11 = load i32, i32* %10
%12 = call i32 @eeprom_write_dword(i32* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @eeprom_update_float(float* %0, float %1) {
%3 = bitcast float* %0 to i32*
%4 = bitcast float %1 to i32
%5 = tail call i32 @eeprom_write_dword(i32* %3, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void librpipVersionInt(uint8_t *maj, uint8_t *min, uint8_t *sub) {
  *maj = 0;
  *min = 4;
  *sub = 1;
}


x86 assembly (clang, -O0):
<librpipVersionInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<librpipVersionInt>:
movl   $0x0,(%rdi)
movl   $0x4,(%rsi)
movl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @librpipVersionInt(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 4, i32* %1
store i32 1, i32* %2
ret void
}
void HardFault_Handler(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

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

LLVM IR (-O0):
define void @HardFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef scalar_t__ bp;

/* Variables and functions */
int /*<<< orphan*/ coalesce(void *);
void mm_free(void *bp) {
  size_t size = ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7);
  (*(unsigned int *)(((char *)(bp)-4)) = (((size) | (0))));
  (*(unsigned int *)(((char *)(bp) +
                      ((*(unsigned int *)(((char *)(bp)-4))) & ~0x7) - 8)) =
       (((size) | (0))));
  coalesce(bp);
}


x86 assembly (clang, -O0):
<mm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%eax
and    $0xfffffff8,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x0,%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,-0x4(%rax)
mov    -0x10(%rbp),%rax
or     $0x0,%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x4(%rcx),%ecx
and    $0xfffffff8,%ecx
mov    %ecx,%ecx
mov    %edx,-0x8(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <coalesce@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_free>:
mov    -0x4(%rdi),%eax
and    $0xfffffff8,%eax
mov    %eax,-0x4(%rdi)
mov    %eax,-0x8(%rdi,%rax,1)
jmp    1030 <coalesce@plt>

LLVM IR (-O0):
define void @mm_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, -8
%9 = zext i32 %8 to i64
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = or i64 %10, 0
%12 = trunc i64 %11 to i32
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 -4
%15 = bitcast i8* %14 to i32*
store i32 %12, i32* %15
%16 = load i64, i64* %3
%17 = or i64 %16, 0
%18 = trunc i64 %17 to i32
%19 = load i8*, i8** %2
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 -4
%22 = bitcast i8* %21 to i32*
%23 = load i32, i32* %22
%24 = and i32 %23, -8
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %19, i64 %25
%27 = getelementptr inbounds i8, i8* %26, i64 -8
%28 = bitcast i8* %27 to i32*
store i32 %18, i32* %28
%29 = load i8*, i8** %2
%30 = call i32 @coalesce(i8* %29)
ret void
}

LLVM IR (-O2):
define void @mm_free(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, -8
%6 = zext i32 %5 to i64
store i32 %5, i32* %3
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -8
%9 = bitcast i8* %8 to i32*
store i32 %5, i32* %9
%10 = tail call i32 @coalesce(i8* %0)
ret void
}