xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ splitpath(char *, char *, char *);
char *dirname(char *path) {
  static char bname[30];
  static char dname[256];
  splitpath(path, dname, bname);
  return (char *)dname;
}


x86 assembly (clang, -O0):
<dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f39(%rip),%rsi
lea    0x2f12(%rip),%rdx
call   1030 <splitpath@plt>
lea    0x2f26(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirname>:
push   %rbx
lea    0x2f48(%rip),%rbx
lea    0x2f21(%rip),%rdx
mov    %rbx,%rsi
call   1030 <splitpath@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@dirname.bname = internal global [30 x i8] zeroinitializer
@dirname.dname = internal global [256 x i8] zeroinitializer
define i8* @dirname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @splitpath(i8* %3, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dirname.dname, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @dirname.bname, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dirname.dname, i64 0, i64 0)
}

LLVM IR (-O2):
@dirname.bname = internal global [30 x i8] zeroinitializer
@dirname.dname = internal global [256 x i8] zeroinitializer
define i8* @dirname(i8* %0) {
%2 = tail call i32 @splitpath(i8* %0, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dirname.dname, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @dirname.bname, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dirname.dname, i64 0, i64 0)
}
int test_imm_52int32_reg(int val) { return ((val) & (0x52 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_52int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x52,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_52int32_reg(i32 %0) {
%2 = and i32 %0, 82
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double log(double);
double ccd_ad2c(unsigned int ad) {
  double r;
  if (ad == 0)
    return 1000;
  r = 10.0 / (4096.0 / (double)ad - 1.0);
  return 25.0 - 25.0 * (log(r / 3.0) / 0.94390589891);
}


x86 assembly (clang, -O0):
<ccd_ad2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1137 <ccd_ad2c+0x27>
movsd  0xf0b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a7 <ccd_ad2c+0x97>
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xee9(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccd_ad2c>:
push   %rax
test   %edi,%edi
je     1163 <ccd_ad2c+0x53>
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xed8(%rip),%xmm1
movsd  0xed8(%rip),%xmm0
divsd  %xmm1,%xmm0
divsd  0xed4(%rip),%xmm0
call   1030 <log@plt>
divsd  0xecf(%rip),%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  0xecf(%rip),%xmm0
pop    %rax
ret
movsd  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ccd_ad2c(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e+03, double* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = uitofp i32 %9 to double
%11 = fdiv double 4.096000e+03, %10
%12 = fsub double %11, 1.000000e+00
%13 = fdiv double 1.000000e+01, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = fdiv double %14, 3.000000e+00
%16 = call double @log(double %15)
%17 = fdiv double %16, 0x3FEE347A24CA3CE2
%18 = call double @llvm.fmuladd.f64(double -2.500000e+01, double %17, double 2.500000e+01)
store double %18, double* %2
br label %19
19: ; preds = %8, %7
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @ccd_ad2c(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = uitofp i32 %0 to double
%5 = fdiv double 4.096000e+03, %4
%6 = fadd double %5, -1.000000e+00
%7 = fdiv double 1.000000e+01, %6
%8 = fdiv double %7, 3.000000e+00
%9 = tail call double @log(double %8)
%10 = fdiv double %9, 0x3FEE347A24CA3CE2
%11 = tail call double @llvm.fmuladd.f64(double %10, double -2.500000e+01, double 2.500000e+01)
br label %12
12: ; preds = %1, %3
%13 = phi double [ %11, %3 ], [ 1.000000e+03, %1 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ msort(int *, int /*<<< orphan*/, int);
void sort(int a[], int len) {
  if (len > 1)
    msort(a, 0, len - 1);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113a <sort+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <msort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jl     1121 <sort+0x11>
mov    %esi,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <msort@plt>
ret

LLVM IR (-O0):
define void @sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @msort(i32* %8, i32 0, i32 %10)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @msort(i32* %0, i32 0, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}
int gpio_int_state_get(unsigned gpio) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_int_state_get(i32 %0) {
ret i32 -1
}
/* Type definitions */
typedef unsigned int __u8;

/* Variables and functions */
unsigned int get_hc_wp_grp_size(__u8 *ext_csd) { return ext_csd[221]; }


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

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

LLVM IR (-O0):
define i32 @get_hc_wp_grp_size(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 221
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_hc_wp_grp_size(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 221
%3 = load i32, i32* %2
ret i32 %3
}
double f(int b, int i) {
  double a[b];
  return a[i];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca double, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load i8*, i8** %5
ret double %14
}

LLVM IR (-O2):
define double @f(i32 %0, i32 %1) {
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ intif_guild_castle_datasave(int, int, int);
void guild_castledatasave(int castle_id, int idx, int value) {
  intif_guild_castle_datasave(castle_id, idx, value);
  return;
}


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

x86 assembly (clang, -O2):
<guild_castledatasave>:
jmp    1030 <intif_guild_castle_datasave@plt>

LLVM IR (-O0):
define void @guild_castledatasave(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @intif_guild_castle_datasave(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @guild_castledatasave(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @intif_guild_castle_datasave(i32 %0, i32 %1, i32 %2)
ret void
}
void I420Copy() {}


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

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

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

LLVM IR (-O2):
define void @I420Copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int);
int /*<<< orphan*/ NF_ADDR(int);
int /*<<< orphan*/ NF_CMD(int);
unsigned short NF_RDDATA();
int /*<<< orphan*/ NF_nFCE_H();
int /*<<< orphan*/ NF_nFCE_L();
unsigned short NF_CheckId(void) {
  unsigned short id;
  NF_nFCE_L();
  NF_CMD(0x90);
  NF_ADDR(0x0);
  Delay(1);
  id = NF_RDDATA() << 8;
  id |= NF_RDDATA();
  NF_nFCE_H();
  return id;
}


x86 assembly (clang, -O0):
<NF_CheckId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NF_nFCE_L@plt>
mov    $0x90,%edi
call   1070 <NF_CMD@plt>
xor    %edi,%edi
call   1080 <NF_ADDR@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
mov    $0x0,%al
call   1060 <NF_RDDATA@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1060 <NF_RDDATA@plt>
movzwl %ax,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <NF_nFCE_H@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NF_CheckId>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <NF_nFCE_L@plt>
mov    $0x90,%edi
call   1070 <NF_CMD@plt>
xor    %edi,%edi
call   1080 <NF_ADDR@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
xor    %eax,%eax
call   1060 <NF_RDDATA@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1060 <NF_RDDATA@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <NF_nFCE_H@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @NF_CheckId() {
%1 = alloca i16
%2 = call i32 (...) @NF_nFCE_L()
%3 = call i32 @NF_CMD(i32 144)
%4 = call i32 @NF_ADDR(i32 0)
%5 = call i32 @Delay(i32 1)
%6 = call zeroext i16 (...) @NF_RDDATA()
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = trunc i32 %8 to i16
store i16 %9, i16* %1
%10 = call zeroext i16 (...) @NF_RDDATA()
%11 = zext i16 %10 to i32
%12 = load i16, i16* %1
%13 = zext i16 %12 to i32
%14 = or i32 %13, %11
%15 = trunc i32 %14 to i16
store i16 %15, i16* %1
%16 = call i32 (...) @NF_nFCE_H()
%17 = load i16, i16* %1
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @NF_CheckId() {
%1 = tail call i32 (...) @NF_nFCE_L()
%2 = tail call i32 @NF_CMD(i32 144)
%3 = tail call i32 @NF_ADDR(i32 0)
%4 = tail call i32 @Delay(i32 1)
%5 = tail call zeroext i16 (...) @NF_RDDATA()
%6 = shl i16 %5, 8
%7 = tail call zeroext i16 (...) @NF_RDDATA()
%8 = or i16 %6, %7
%9 = tail call i32 (...) @NF_nFCE_H()
ret i16 %8
}
int main(int argc, char *argv[]) {
  int x;
  if (__alignof__(x) != __alignof__(int))
    abort();
  double y;
  if (__alignof__(y) != __alignof__(double))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void multimap_failed(char *, char *, int);
void *multimap_malloc(size_t size) {
  ((size) ? ((void)0)
          : multimap_failed("size",
                            "/scratch/repos/new/home/jordi_armengol_estape/"
                            "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                            "tregon/multimap/refs/heads/develop/src/malloc.c",
                            25));
  return malloc(size);
}


x86 assembly (clang, -O0):
<multimap_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <multimap_malloc+0x1c>
jmp    1154 <multimap_malloc+0x34>
lea    0xebd(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x19,%edx
call   1030 <multimap_failed@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimap_malloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1141 <multimap_malloc+0x21>
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x19,%edx
call   1030 <multimap_failed@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"size\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
define i8* @multimap_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = load i64, i64* %2
%9 = call i8* @malloc(i64 %8)
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"size\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
define noalias i8* @multimap_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void @multimap_failed(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 25)
br label %4
4: ; preds = %1, %3
%5 = tail call i8* @malloc(i64 %0)
ret i8* %5
}
int f3(const void *p, const void *q) { return __builtin_bcmp(p, q, 0); }


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

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

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

LLVM IR (-O2):
define i32 @f3(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AccelsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AccelsRequestUpdate() { UAVObjRequestUpdate(AccelsHandle()); }


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

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

LLVM IR (-O0):
define void @AccelsRequestUpdate() {
%1 = call i32 (...) @AccelsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelsRequestUpdate() {
%1 = tail call i32 (...) @AccelsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
int main() {
  char *ptr = (char *)malloc(1024);
  ptr[0] = 0;
  ptr[1024] = 0;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x400(%rax)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
movb   $0x0,0x400(%rax)
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1024
store i8 0, i8* %8
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 1024)
%2 = inttoptr i64 %1 to i8*
store i8 0, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1024
store i8 0, i8* %3
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void btor_catched_sig_msg(int sig) {
  printf("[btormain] CAUGHT SIGNAL %d\n", sig);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<btor_catched_sig_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_catched_sig_msg>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[btormain] CAUGHT SIGNAL %d\0A\00"
@stdout = global i32 0
define void @btor_catched_sig_msg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"[btormain] CAUGHT SIGNAL %d\0A\00"
@stdout = global i32 0
define void @btor_catched_sig_msg(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *listappend(struct node *, int /*<<< orphan*/);
int /*<<< orphan*/ listcopy(struct node const *);
struct node *listappendcopy(struct node *head, const struct node *tail) {
  return listappend(head, listcopy(tail));
}


x86 assembly (clang, -O0):
<listappendcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <listcopy@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <listappend@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listappendcopy>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <listcopy@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <listappend@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @listappendcopy(%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
%5 = load %struct.node*, %struct.node** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call i32 @listcopy(%struct.node* %6)
%8 = call %struct.node* @listappend(%struct.node* %5, i32 %7)
ret %struct.node* %8
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @listappendcopy(%struct.node* %0, %struct.node* %1) {
%3 = tail call i32 @listcopy(%struct.node* %1)
%4 = tail call %struct.node* @listappend(%struct.node* %0, i32 %3)
ret %struct.node* %4
}
/* Variables and functions */
int get_distance(int, int);
int get_distance_coords(int x1, int y1, int x2, int y2) {
  int a = get_distance(x1, x2);
  int b = get_distance(y1, y2);
  return (a * a + b * b);
}


x86 assembly (clang, -O0):
<get_distance_coords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_distance@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <get_distance@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_distance_coords>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %edx,%esi
call   1030 <get_distance@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <get_distance@plt>
imul   %ebx,%ebx
imul   %eax,%eax
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_distance_coords(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = call i32 @get_distance(i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = call i32 @get_distance(i32 %14, i32 %15)
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_distance_coords(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @get_distance(i32 %0, i32 %2)
%6 = tail call i32 @get_distance(i32 %1, i32 %3)
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
ret i32 %9
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_0() {
  char *x = "abc";
  char *y = "Abc";
  if (strcasecmp(x, y) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1145 <strcasecmp_0+0x35>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strcasecmp(i8* %3, i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_0() {
ret void
}
void set_pin_as_input(void) {
  unsigned tmp;
  tmp = (*(volatile unsigned long *)0xE0200C20);
  tmp &= ~(0XF << 8);
  (*(volatile unsigned long *)0xE0200C20) = tmp;
}


x86 assembly (clang, -O0):
<set_pin_as_input>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200c20,%eax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff0ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0xe0200c20,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pin_as_input>:
mov    $0xfffff0ff,%eax
mov    $0xe0200c20,%ecx
and    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_pin_as_input() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 3760196640 to i64*)
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, -3841
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 3760196640 to i64*)
ret void
}

LLVM IR (-O2):
define void @set_pin_as_input() {
%1 = load volatile i64, i64* inttoptr (i64 3760196640 to i64*)
%2 = and i64 %1, 4294963455
store volatile i64 %2, i64* inttoptr (i64 3760196640 to i64*)
ret void
}
/* Variables and functions */
int frame_2();
int recursive(int arg) {
  int v;
  if (arg < 2)
    v = recursive(arg + 1);
  else
    v = frame_2();
  return v;
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1148 <recursive+0x28>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <recursive@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <recursive+0x32>
mov    $0x0,%al
call   1030 <frame_2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @recursive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @recursive(i32 %8)
store i32 %9, i32* %3
br label %12
10: ; preds = %1
%11 = call i32 (...) @frame_2()
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @recursive(i32 %0) {
%2 = tail call i32 (...) @frame_2()
ret i32 %2
}
void XInitExtension() {}


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

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

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

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

/* Variables and functions */
int32_t sign_extend32(unsigned int bits, uint32_t value) {
  uint32_t C = (-1) << (bits - 1);
  return (int32_t)((value + C) ^ C);
}


x86 assembly (clang, -O0):
<sign_extend32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend32>:
lea    -0x1(%rdi),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
lea    (%rsi,%rdx,1),%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sign_extend32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sub i32 %6, 1
%8 = shl i32 -1, %7
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = xor i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign_extend32(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = shl nsw i32 -1, %3
%5 = add nsw i32 %4, %1
%6 = xor i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lib1_default();
int /*<<< orphan*/ lib2_default();
int /*<<< orphan*/ lib3_default();
int main(int argc __attribute__((unused)),
         char **argv __attribute__((unused))) {
  lib1_default();
  lib2_default();
  lib3_default();
  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    $0x0,%al
call   1050 <lib1_default@plt>
mov    $0x0,%al
call   1030 <lib2_default@plt>
mov    $0x0,%al
call   1040 <lib3_default@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <lib1_default@plt>
xor    %eax,%eax
call   1030 <lib2_default@plt>
xor    %eax,%eax
call   1040 <lib3_default@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @lib1_default()
%7 = call i32 (...) @lib2_default()
%8 = call i32 (...) @lib3_default()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lib1_default()
%4 = tail call i32 (...) @lib2_default()
%5 = tail call i32 (...) @lib3_default()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  fork();
  fork();
  fork();
  printf("process id: %d\n", getpid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1050 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"process id: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 (...) @fork()
%4 = call i32 (...) @fork()
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"process id: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 (...) @fork()
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_6;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_6() { return nl_langinfo(ABMON_6); }


x86 assembly (clang, -O0):
<langinfo_abmon_6>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_6>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_6 = global i32 0
define i8* @langinfo_abmon_6() {
%1 = load i32, i32* @ABMON_6
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_6 = global i32 0
define i8* @langinfo_abmon_6() {
%1 = load i32, i32* @ABMON_6
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void nomem(void) { fatal("Unable to allocate memory on the heap\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Unable to allocate memory on the heap\0A\00"
define void @nomem() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Unable to allocate memory on the heap\0A\00"
define void @nomem() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long umod64(unsigned long long, unsigned long long);
unsigned long long __umoddi3(unsigned long long n, unsigned long long d) {
  return umod64(n, d);
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
jmp    1030 <umod64@plt>

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

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @umod64(i64 %0, i64 %1)
ret i64 %3
}
void foo411() {}


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

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

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

LLVM IR (-O2):
define void @foo411() {
ret void
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Lex_wstrng_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_wstrng(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_Lex_wstrng_rec(lexbuf, 5); });
}


x86 assembly (clang, -O0):
<Cyc_Lex_wstrng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <Cyc_Lex_wstrng_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Lex_wstrng>:
mov    $0x5,%esi
jmp    1030 <Cyc_Lex_wstrng_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_wstrng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_wstrng_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 5)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_wstrng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_wstrng_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char test_pointer(char *str) {
  int c = 0;
  printf("1\n");
  c = *str;
  printf("in test_pointer c = %c; and * str = %c;\n", c, *str);
  printf("2\n");
  return c;
}


x86 assembly (clang, -O0):
<test_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pointer>:
push   %rbx
mov    %rdi,%rbx
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%al
movsbl %al,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [41 x i8] c"in test_pointer c = %c; and * str = %c;\0A\00"
@.str.2 = [3 x i8] c"2\0A\00"
define signext i8 @test_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"in test_pointer c = %c; and * str = %c;\0A\00"
@str = [2 x i8] c"1\00"
@str.3 = [2 x i8] c"2\00"
define signext i8 @test_pointer(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret i8 %3
}
/* Variables and functions */
int atoi(char *);
char *get_val_str(char *, int);
int get_val_int(char *name, int index) {
  char *ret = get_val_str(name, index);
  if (!ret)
    return -1;
  return atoi(ret);
}


x86 assembly (clang, -O0):
<get_val_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <get_val_str@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1156 <get_val_int+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <get_val_int+0x42>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val_int>:
push   %rax
call   1030 <get_val_str@plt>
test   %rax,%rax
je     1134 <get_val_int+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_val_int(i8* %0, i32 %1) {
%3 = tail call i8* @get_val_str(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
void PKEY_USAGE_PERIOD_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKEY_USAGE_PERIOD_free() {
ret void
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_in(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_bulk(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) {
  return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
}


x86 assembly (clang, -O0):
<usb_endpoint_is_bulk_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_xfer_bulk@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_bulk_in+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_dir_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_bulk_in>:
push   %rbx
mov    %rdi,%rbx
call   1030 <usb_endpoint_xfer_bulk@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_bulk_in+0x23>
mov    %rbx,%rdi
call   1040 <usb_endpoint_dir_in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_bulk_in(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_bulk(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_bulk_in(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_bulk(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void UARTEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x30)))) =
      ((0x00000001u) | (0x00002000u) | (0x00004000u));
}


x86 assembly (clang, -O0):
<UARTEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,%eax
movl   $0x6001,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnable>:
add    $0x30,%edi
movl   $0x6001,(%rdi)
ret

LLVM IR (-O0):
define void @UARTEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 48
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 24577, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTEnable(i32 %0) {
%2 = add i32 %0, 48
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 24577, i32* %4
ret void
}
int count_pipe(char *input) {
  int i = 0, count = 0;
  while (input[i] != '\0') {
    if (input[i] == '|')
      count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_pipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <count_pipe+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7c,%eax
jne    1149 <count_pipe+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <count_pipe+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_pipe>:
xor    %eax,%eax
jmp    1117 <count_pipe+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x7c,%cl
je     1110 <count_pipe+0x10>
test   %cl,%cl
jne    1113 <count_pipe+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_pipe(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 124, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
__attribute__((no, noclone)) int i0(int A, int B) {
  int C = A ^ B;
  return A | ~C;
}


x86 assembly (clang, -O0):
<i0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i0>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @i0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = xor i32 %10, -1
%12 = or i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @i0(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ refc_inc(void *);
void *refc_copy(void *handle) {
  refc_inc(handle);
  return handle;
}


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

x86 assembly (clang, -O2):
<refc_copy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <refc_inc@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @refc_copy(i8* returned %0) {
%2 = tail call i32 @refc_inc(i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ restart_windowing();
void restart_devices() { restart_windowing(); }


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

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

LLVM IR (-O0):
define void @restart_devices() {
%1 = call i32 (...) @restart_windowing()
ret void
}

LLVM IR (-O2):
define void @restart_devices() {
%1 = tail call i32 (...) @restart_windowing()
ret void
}
void page_put(__attribute__((unused)) void *addr,
              __attribute__((unused)) int nb_pages) {}


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

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

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

LLVM IR (-O2):
define void @page_put(i8* nocapture %0, i32 %1) {
ret void
}