xunge/DecIR huggingface dataset:
/* Variables and functions */
double fabs(double);
double get_epsilon(double x) {
  double epsilon = (1e-6);
  x = fabs(x);
  if (x <= 1.0)
    epsilon = x * (1e-6);
  return epsilon;
}


x86 assembly (clang, -O0):
<get_epsilon>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeee(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xecd(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1150 <get_epsilon+0x50>
movsd  0xec2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_epsilon>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
movapd %xmm0,%xmm2
cmpnlesd 0xefb(%rip),%xmm0
mulsd  %xmm1,%xmm2
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @get_epsilon(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x3EB0C6F7A0B5ED8D, double* %3
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
store double %5, double* %2
%6 = load double, double* %2
%7 = fcmp ole double %6, 1.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = fmul double %9, 0x3EB0C6F7A0B5ED8D
store double %10, double* %3
br label %11
11: ; preds = %8, %1
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @get_epsilon(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp ugt double %2, 1.000000e+00
%4 = fmul double %2, 0x3EB0C6F7A0B5ED8D
%5 = select i1 %3, double 0x3EB0C6F7A0B5ED8D, double %4
ret double %5
}
__typeof__(alloca((void *)1)) test_alloca_87(void) { return alloca((void *)1); }


x86 assembly (clang, -O0):
<test_alloca_87>:
push   %rbp
mov    %rsp,%rbp
lea    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alloca_87>:
lea    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @test_alloca_87() {
%1 = alloca i8, i64 1
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_alloca_87() {
%1 = alloca i8
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
unsigned long long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
unsigned long long get_file_size_by_fp(FILE *fp) {
  unsigned long long size;
  if (!fp || fp == stderr) {
    return 0;
  }
  fseek(fp, 0L, SEEK_END);
  size = ftell(fp);
  return size;
}


x86 assembly (clang, -O0):
<get_file_size_by_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <get_file_size_by_fp+0x2b>
mov    -0x10(%rbp),%rax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%rax
jne    1158 <get_file_size_by_fp+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1183 <get_file_size_by_fp+0x63>
mov    -0x10(%rbp),%rdi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size_by_fp>:
push   %rbx
test   %rdi,%rdi
je     1151 <get_file_size_by_fp+0x31>
mov    %rdi,%rbx
mov    0x2ea8(%rip),%rax
cmp    %rdi,(%rax)
je     1151 <get_file_size_by_fp+0x31>
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32* null
@SEEK_END = global i32 0
define i64 @get_file_size_by_fp(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32*, i32** @stderr
%10 = icmp eq i32* %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i64 0, i64* %2
br label %19
12: ; preds = %7
%13 = load i32*, i32** %3
%14 = load i32, i32* @SEEK_END
%15 = call i32 @fseek(i32* %13, i64 0, i32 %14)
%16 = load i32*, i32** %3
%17 = call i64 @ftell(i32* %16)
store i64 %17, i64* %4
%18 = load i64, i64* %4
store i64 %18, i64* %2
br label %19
19: ; preds = %12, %11
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
@stderr = global i32* null
@SEEK_END = global i32 0
define i64 @get_file_size_by_fp(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = load i32*, i32** @stderr
%4 = icmp eq i32* %3, %0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @SEEK_END
%8 = tail call i32 @fseek(i32* %0, i64 0, i32 %7)
%9 = tail call i64 @ftell(i32* %0)
br label %10
10: ; preds = %1, %6
%11 = phi i64 [ %9, %6 ], [ 0, %1 ]
ret i64 %11
}
/* Variables and functions */
int dwarf_get_DS_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_DS_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_DS_name(val_in, &v);
  return ellipname(res, val_in, v, "DS", printonerr);
}


x86 assembly (clang, -O0):
<get_DS_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_DS_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_DS_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_DS_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"DS\00"
define i8* @get_DS_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_DS_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"DS\00"
define i8* @get_DS_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_DS_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash_64(uint64_t key) {
  key += ~(key << 32);
  key ^= (key >> 22);
  key += ~(key << 13);
  key ^= (key >> 8);
  key += (key << 3);
  key ^= (key >> 15);
  key += ~(key << 27);
  key ^= (key >> 31);
  return key;
}


x86 assembly (clang, -O0):
<hash_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x16,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xf,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1b,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 32
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 22
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 %12, 13
%14 = xor i32 %13, -1
%15 = load i32, i32* %2
%16 = add nsw i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = xor i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = shl i32 %21, 3
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 15
%27 = load i32, i32* %2
%28 = xor i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = shl i32 %29, 27
%31 = xor i32 %30, -1
%32 = load i32, i32* %2
%33 = add nsw i32 %32, %31
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = ashr i32 %34, 31
%36 = load i32, i32* %2
%37 = xor i32 %36, %35
store i32 %37, i32* %2
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @hash_64(i32 %0) {
ret i32 poison
}
void subtract3f(float *first, float *second, float *whereto) {
  *whereto = *first - *second;
  *(whereto + 1) = *(first + 1) - *(second + 1);
  *(whereto + 2) = *(first + 2) - *(second + 2);
}


x86 assembly (clang, -O0):
<subtract3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract3f>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

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

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


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @test100_Test_targetInit__I() {
ret void
}
/* Variables and functions */
int ERANGE;
int lookup_symbol_name(unsigned long addr, char *symname) { return -ERANGE; }


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

x86 assembly (clang, -O2):
<lookup_symbol_name>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ERANGE = global i32 0
define i32 @lookup_symbol_name(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ERANGE
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ERANGE = global i32 0
define i32 @lookup_symbol_name(i64 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ERANGE
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ S_ends_with(char *, char *);
int S_core_dir_filter(const char *dir, char *file, void *context) {
  (void)dir;
  (void)context;
  return !S_ends_with(file, "JsonParser.c");
}


x86 assembly (clang, -O0):
<S_core_dir_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <S_ends_with@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_core_dir_filter>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
call   1030 <S_ends_with@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"JsonParser.c\00"
define i32 @S_core_dir_filter(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @S_ends_with(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"JsonParser.c\00"
define i32 @S_core_dir_filter(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @S_ends_with(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_MULTICAST_LOOP;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int socket_mcloop4(int s, char loop) {
  return (setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof loop));
}


x86 assembly (clang, -O0):
<socket_mcloop4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
lea    -0x5(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_mcloop4>:
push   %rax
mov    %sil,0x7(%rsp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edx
lea    0x7(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@IP_MULTICAST_LOOP = global i32 0
define i32 @socket_mcloop4(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @IPPROTO_IP
%7 = load i32, i32* @IP_MULTICAST_LOOP
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %4, i32 1)
ret i32 %8
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@IP_MULTICAST_LOOP = global i32 0
define i32 @socket_mcloop4(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = load i32, i32* @IPPROTO_IP
%5 = load i32, i32* @IP_MULTICAST_LOOP
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 1)
ret i32 %6
}
void local_irq_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @local_irq_enable() {
ret void
}
void dummy(float *a, float *b, float *c, float *d) {}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dummy(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
ret void
}
int test_imm_69uint8_reg(unsigned char val) {
  return ((val) & (-0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69uint8_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, -105
%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_69uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -105
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_opp_ps_usage(void) {
  printf("Usage : wifidirect_cfg_opp_ps <enable|disable> [<CTWindow>]\n");
  printf("For 'set', both enable flag and CTWindow should be provided.\n");
  printf("If no parameter is specified,'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_cfg_opp_ps_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage : wifidirect_cfg_opp_ps <enable|disable> [<CTWindow>]\0A\00"
@.str.1 = [62 x i8] c"For 'set', both enable flag and CTWindow should be provided.\0A\00"
@.str.2 = [50 x i8] c"If no parameter is specified,'get' is performed.\0A\00"
define void @print_wifidirect_cfg_opp_ps_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"Usage : wifidirect_cfg_opp_ps <enable|disable> [<CTWindow>]\00"
@str.3 = [61 x i8] c"For 'set', both enable flag and CTWindow should be provided.\00"
@str.4 = [49 x i8] c"If no parameter is specified,'get' is performed.\00"
define void @print_wifidirect_cfg_opp_ps_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
ret void
}
int fail_ono_purpose(const char *msg) { return 1; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_get_bytes_per_sample() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLvoid;
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
void TexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width,
                GLsizei height, GLint border, GLenum format, GLenum type,
                GLvoid *pixels) {
  glTexImage2D(target, level, internalFormat, width, height, border, format,
               type, pixels);
}


x86 assembly (clang, -O0):
<TexImage2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <glTexImage2D@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexImage2D>:
jmp    1030 <glTexImage2D@plt>

LLVM IR (-O0):
define void @TexImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32*
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32* %8, i32** %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = load i32, i32* %17
%27 = load i32*, i32** %18
%28 = call i32 @glTexImage2D(i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32* %27)
ret void
}

LLVM IR (-O2):
define void @TexImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8) {
%10 = tail call i32 @glTexImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basename_get_base_name(char *, int);
int /*<<< orphan*/ right_trim_session(char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *get_select_statement_title(char *input_filename) {
  static char statement_title[256];
  strcpy(statement_title, basename_get_base_name(input_filename, 1));
  right_trim_session(statement_title);
  return statement_title;
}


x86 assembly (clang, -O0):
<get_select_statement_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <basename_get_base_name@plt>
mov    %eax,%esi
lea    0x2efd(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2ef1(%rip),%rdi
call   1050 <right_trim_session@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_select_statement_title>:
push   %rbx
mov    $0x1,%esi
call   1040 <basename_get_base_name@plt>
lea    0x2f0e(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <right_trim_session@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_select_statement_title.statement_title = internal global [256 x i8] zeroinitializer
define i8* @get_select_statement_title(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @basename_get_base_name(i8* %3, i32 1)
%5 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0), i32 %4)
%6 = call i32 @right_trim_session(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0)
}

LLVM IR (-O2):
@get_select_statement_title.statement_title = internal global [256 x i8] zeroinitializer
define i8* @get_select_statement_title(i8* %0) {
%2 = tail call i32 @basename_get_base_name(i8* %0, i32 1)
%3 = tail call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0), i32 %2)
%4 = tail call i32 @right_trim_session(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_select_statement_title.statement_title, i64 0, i64 0)
}
int write(int fd, char *data, int nbytes) { return nbytes; }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void restore_locale(char *old_locale) {
  setlocale(LC_ALL, old_locale);
  free(old_locale);
}


x86 assembly (clang, -O0):
<restore_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_locale>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <setlocale@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
define void @restore_locale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LC_ALL
%4 = load i8*, i8** %2
%5 = call i32 @setlocale(i32 %3, i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
define void @restore_locale(i8* %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* %0)
%4 = tail call i32 @free(i8* %0)
ret void
}
int cmd_powerswitch(struct sigma_dut *dut, struct sigma_conn *conn,
                    struct sigma_cmd *cmd) {
  return 1;
}


x86 assembly (clang, -O0):
<cmd_powerswitch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sigma_dut = type opaque
%struct.sigma_conn = type opaque
%struct.sigma_cmd = type opaque
define i32 @cmd_powerswitch(%struct.sigma_dut* %0, %struct.sigma_conn* %1, %struct.sigma_cmd* %2) {
%4 = alloca %struct.sigma_dut*
%5 = alloca %struct.sigma_conn*
%6 = alloca %struct.sigma_cmd*
store %struct.sigma_dut* %0, %struct.sigma_dut** %4
store %struct.sigma_conn* %1, %struct.sigma_conn** %5
store %struct.sigma_cmd* %2, %struct.sigma_cmd** %6
ret i32 1
}

LLVM IR (-O2):
%struct.sigma_dut = type opaque
%struct.sigma_conn = type opaque
%struct.sigma_cmd = type opaque
define i32 @cmd_powerswitch(%struct.sigma_dut* nocapture readnone %0, %struct.sigma_conn* nocapture readnone %1, %struct.sigma_cmd* nocapture readnone %2) {
ret i32 1
}
const char *fpp_config_get_plugin_file_name(void) {
  return "libppGoogleNaClPluginChrome.so";
}


x86 assembly (clang, -O0):
<fpp_config_get_plugin_file_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_config_get_plugin_file_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"libppGoogleNaClPluginChrome.so\00"
define i8* @fpp_config_get_plugin_file_name() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"libppGoogleNaClPluginChrome.so\00"
define i8* @fpp_config_get_plugin_file_name() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void ivory_hw_io_write_u32(uint32_t addr, uint32_t value) {
  *((volatile uint32_t *)addr) = value;
}


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

x86 assembly (clang, -O2):
<ivory_hw_io_write_u32>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @ivory_hw_io_write_u32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @ivory_hw_io_write_u32(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int __infer_nondet_int();
int iswcntrl(wint_t wc) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @iswcntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @iswcntrl(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
signed int PutString(char *pStr, const char *pSource) {
  signed int num = 0;
  while (*pSource != 0) {
    *pStr++ = *pSource++;
    num++;
  }
  return (num);
}


x86 assembly (clang, -O0):
<PutString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <PutString+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <PutString+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutString>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <PutString+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <PutString+0x10>
ret

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

LLVM IR (-O2):
define i32 @PutString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %6, i8* %9
%12 = add nuw nsw i32 %7, 1
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ show(int);
int main(void) {
  show(0xabcd);
  show(0xab01);
  show(0xab00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xabcd,%edi
call   1030 <show@plt>
mov    $0xab01,%edi
call   1030 <show@plt>
mov    $0xab00,%edi
call   1030 <show@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @show(i32 43981)
%3 = call i32 @show(i32 43777)
%4 = call i32 @show(i32 43776)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @show(i32 43981)
%2 = tail call i32 @show(i32 43777)
%3 = tail call i32 @show(i32 43776)
ret i32 0
}
/* Variables and functions */
char *lib_stralloc(char const *);
int /*<<< orphan*/ util_add_extension(char **, char const *);
char *util_add_extension_const(const char *filename, const char *extension) {
  char *ext_filename;
  ext_filename = lib_stralloc(filename);
  util_add_extension(&ext_filename, extension);
  return ext_filename;
}


x86 assembly (clang, -O0):
<util_add_extension_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lib_stralloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1040 <util_add_extension@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_add_extension_const>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <lib_stralloc@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <util_add_extension@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @util_add_extension_const(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @lib_stralloc(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @util_add_extension(i8** %5, i8* %8)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define i8* @util_add_extension_const(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* @lib_stralloc(i8* %0)
store i8* %5, i8** %3
%6 = call i32 @util_add_extension(i8** %3, i8* %1)
%7 = load i8*, i8** %3
ret i8* %7
}
char foo(char **ppc, char a, char b) {
  char *pc = *ppc;
  char c = pc[1];
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
mov    0x1(%rax),%al
ret

LLVM IR (-O0):
define signext i8 @foo(i8** %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8
store i8** %0, i8*** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
store i8 %13, i8* %8
%14 = load i8, i8* %8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @foo(i8** nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ bbstart();
int main(void) {
  bbstart();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bbstart()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int size_of_string(char *);
void concat_strings_created_with_malloc(char *input_string,
                                        char *string_to_concat) {
  int input_str_size = size_of_string(input_string);
  int to_concat_str_size = size_of_string(string_to_concat);
  memcpy(input_string + input_str_size, string_to_concat,
         (to_concat_str_size + 1) * sizeof(char));
}


x86 assembly (clang, -O0):
<concat_strings_created_with_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <size_of_string@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <size_of_string@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_strings_created_with_malloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <size_of_string@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <size_of_string@plt>
movslq %ebp,%rdi
add    %rbx,%rdi
lea    0x1(%rax),%edx
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @concat_strings_created_with_malloc(i8* %0, i8* %1) {
%3 = tail call i32 @size_of_string(i8* %0)
%4 = tail call i32 @size_of_string(i8* %1)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = add nsw i32 %4, 1
%8 = tail call i32 @memcpy(i8* %6, i8* %1, i32 %7)
ret void
}
void g_list_nth_prev() {}


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

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

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

LLVM IR (-O2):
define void @g_list_nth_prev() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findCommon(char *, int, char *, int);
int main(void) {
  char *a = "abcijfghij klmn";
  char *b = "ghij kl";
  int an = 15;
  int bn = 7;
  findCommon(a, an, b, bn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedf(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
movl   $0x7,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
call   1030 <findCommon@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"abcijfghij klmn\00"
@.str.1 = [8 x i8] c"ghij kl\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i32 15, i32* %4
store i32 7, i32* %5
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @findCommon(i8* %6, i32 %7, i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"abcijfghij klmn\00"
@.str.1 = [8 x i8] c"ghij kl\00"
define i32 @main() {
%1 = tail call i32 @findCommon(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ User_ID_Packet(int);
int /*<<< orphan*/ printf(char *);
extern void signer_user_id(int len) {
  printf("\t");
  User_ID_Packet(len);
}


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

x86 assembly (clang, -O2):
<signer_user_id>:
push   %rbx
mov    %edi,%ebx
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <User_ID_Packet@plt>

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

LLVM IR (-O2):
define void @signer_user_id(i32 %0) {
%2 = tail call i32 @putchar(i32 9)
%3 = tail call i32 @User_ID_Packet(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ check_ack();
int /*<<< orphan*/ error(char *);
scalar_t__ stm_cmd(int);
int /*<<< orphan*/ write_addr(unsigned int);
void stm_go(unsigned int addr) {
  if (stm_cmd(0x21) == 0)
    error("GO command rejected");
  write_addr(addr);
  if (check_ack() == 0)
    error("GO address rejected");
}


x86 assembly (clang, -O0):
<stm_go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x21,%edi
call   1030 <stm_cmd@plt>
cmp    $0x0,%rax
jne    116b <stm_go+0x2b>
lea    0xe9a(%rip),%rdi
call   1060 <error@plt>
mov    -0x4(%rbp),%edi
call   1050 <write_addr@plt>
mov    $0x0,%al
call   1040 <check_ack@plt>
cmp    $0x0,%rax
jne    1190 <stm_go+0x50>
lea    0xe89(%rip),%rdi
call   1060 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stm_go>:
push   %rbx
mov    %edi,%ebx
mov    $0x21,%edi
call   1030 <stm_cmd@plt>
test   %rax,%rax
jne    115e <stm_go+0x1e>
lea    0xea7(%rip),%rdi
call   1060 <error@plt>
mov    %ebx,%edi
call   1050 <write_addr@plt>
xor    %eax,%eax
call   1040 <check_ack@plt>
test   %rax,%rax
je     1173 <stm_go+0x33>
pop    %rbx
ret
lea    0xe9a(%rip),%rdi
pop    %rbx
jmp    1060 <error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"GO command rejected\00"
@.str.1 = [20 x i8] c"GO address rejected\00"
define void @stm_go(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @stm_cmd(i32 33)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @write_addr(i32 %8)
%10 = call i64 (...) @check_ack()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"GO command rejected\00"
@.str.1 = [20 x i8] c"GO address rejected\00"
define void @stm_go(i32 %0) {
%2 = tail call i64 @stm_cmd(i32 33)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @write_addr(i32 %0)
%8 = tail call i64 (...) @check_ack()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
unsigned simpleInstruction(const char *name, unsigned offset) {
  printf("%s\n", name);
  return offset + 1;
}


x86 assembly (clang, -O0):
<simpleInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleInstruction>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @simpleInstruction(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = add i32 %1, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
int32_t generate_random_number() {
  int32_t number = rand();
  return number;
}


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

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

LLVM IR (-O0):
define i32 @generate_random_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @generate_random_number() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}