xunge/DecIR huggingface dataset:
/* Variables and functions */
char *DBfetch(char const *);
int DBstore(char const *, char const *);
int storeDB(const char *mid, const char *paths) {
  char *ptr;
  ptr = DBfetch(mid);
  if (ptr != NULL) {
    return 0;
  } else {
    return DBstore(mid, paths);
  }
}


x86 assembly (clang, -O0):
<storeDB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <DBfetch@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1154 <storeDB+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1164 <storeDB+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <DBstore@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<storeDB>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <DBfetch@plt>
test   %rax,%rax
je     113e <storeDB+0x1e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <DBstore@plt>

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

LLVM IR (-O2):
define i32 @storeDB(i8* %0, i8* %1) {
%3 = tail call i8* @DBfetch(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @DBstore(i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int digamma(double);
double d_alhood(double a, double ss, int D, int K) {
  return (D * (K * digamma(K * a) - K * digamma(a)) + ss);
}


x86 assembly (clang, -O0):
<d_alhood>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <digamma@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <digamma@plt>
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    %eax,%esi
mov    -0x1c(%rbp),%eax
imul   %esi,%edx
sub    %edx,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_alhood>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <digamma@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <digamma@plt>
sub    %eax,%ebx
imul   %r14d,%ebp
imul   %ebx,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define double @d_alhood(double %0, double %1, i32 %2, i32 %3) {
%5 = sitofp i32 %3 to double
%6 = fmul double %5, %0
%7 = tail call i32 @digamma(double %6)
%8 = tail call i32 @digamma(double %0)
%9 = sub i32 %7, %8
%10 = mul i32 %3, %2
%11 = mul i32 %10, %9
%12 = sitofp i32 %11 to double
%13 = fadd double %12, %1
ret double %13
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
scalar_t__ ASN1_STRING_get0_data(int /*<<< orphan*/ const *);
const char *print_time(const ASN1_TIME *t) {
  return t == NULL ? "<null>" : (char *)ASN1_STRING_get0_data(t);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1137 <print_time+0x27>
lea    0xed2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <print_time+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <ASN1_STRING_get0_data@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
test   %rdi,%rdi
je     1120 <print_time+0x10>
push   %rax
call   1030 <ASN1_STRING_get0_data@plt>
add    $0x8,%rsp
ret
lea    0xed9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"<null>\00"
define i8* @print_time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i64 @ASN1_STRING_get0_data(i32* %7)
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %6, %5
%11 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %5 ], [ %9, %6 ]
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"<null>\00"
define i8* @print_time(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @ASN1_STRING_get0_data(i32* %0)
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
unsigned long int getreg32(unsigned long int addr) {
  unsigned long int res = *((volatile unsigned long int *)addr);
  printf("Read full word at 0x%08lx = 0x%08lx.\n", addr, res);
  return res;
}


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

x86 assembly (clang, -O2):
<getreg32>:
push   %rbx
mov    %rdi,%rsi
mov    (%rdi),%rbx
lea    0xee2(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Read full word at 0x%08lx = 0x%08lx.\0A\00"
define i64 @getreg32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8)
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
@.str = [38 x i8] c"Read full word at 0x%08lx = 0x%08lx.\0A\00"
define i64 @getreg32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %3)
ret i64 %3
}
void raptor_user_ios_init(void) {}


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

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

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

LLVM IR (-O2):
define void @raptor_user_ios_init() {
ret void
}
/* Variables and functions */
char *libamg_comcerto_get_codec_passthrough_name(int codec_code) {
  switch (codec_code) {
  case 0x100:
    return "alaw";
    break;
  case 0x80:
    return "ulaw";
    break;
  default:
    return NULL;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<libamg_comcerto_get_codec_passthrough_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1140 <libamg_comcerto_get_codec_passthrough_name+0x40>
jmp    111d <libamg_comcerto_get_codec_passthrough_name+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x100,%eax
jne    1150 <libamg_comcerto_get_codec_passthrough_name+0x50>
jmp    1130 <libamg_comcerto_get_codec_passthrough_name+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <libamg_comcerto_get_codec_passthrough_name+0x58>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <libamg_comcerto_get_codec_passthrough_name+0x58>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_comcerto_get_codec_passthrough_name>:
xor    %ecx,%ecx
cmp    $0x80,%edi
lea    0xef6(%rip),%rax
cmove  %rax,%rcx
cmp    $0x100,%edi
lea    0xee0(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"alaw\00"
@.str.1 = [5 x i8] c"ulaw\00"
define i8* @libamg_comcerto_get_codec_passthrough_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 256, label %5
i32 128, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"alaw\00"
@.str.1 = [5 x i8] c"ulaw\00"
define i8* @libamg_comcerto_get_codec_passthrough_name(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 256
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void av_program_add_stream_index() {}


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

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

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

LLVM IR (-O2):
define void @av_program_add_stream_index() {
ret void
}
unsigned int PC2(int left, int right) {
  int leftSection = left & 0x7;
  int rightSection = right & 0x7;
  unsigned int combined = (leftSection << 3) | rightSection;
  return combined;
}


x86 assembly (clang, -O0):
<PC2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PC2>:
and    $0x7,%esi
and    $0x7,%edi
lea    (%rsi,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @PC2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %8, 7
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = and i32 %10, 7
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = shl i32 %12, 3
%14 = load i32, i32* %6
%15 = or i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @PC2(i32 %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl i32 %0, 3
%5 = and i32 %4, 56
%6 = or i32 %5, %3
ret i32 %6
}
int test_imm_EFuint8_reg(unsigned char val) {
  return ((val) & (-0xEF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EFuint8_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, -239
%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_EFuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 17
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long stop_watch() {
  struct timespec t;
  t.tv_sec = t.tv_nsec = 0;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return t.tv_sec * 1000000000ULL + t.tv_nsec;
}


x86 assembly (clang, -O0):
<stop_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_watch>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%rax
3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @stop_watch() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @stop_watch() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = bitcast %struct.timespec* %1 to i8*
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %1)
%8 = load i64, i64* %4
%9 = mul i64 %8, 1000000000
%10 = load i64, i64* %3
%11 = add i64 %9, %10
ret i64 %11
}
/* Variables and functions */
void for_each(void *begin, void *end, size_t sz, void (*fn)(void *a)) {
  char *ptr = begin;
  char *last = end;
  while (ptr < last) {
    fn(ptr);
    ptr += sz;
  }
}


x86 assembly (clang, -O0):
<for_each>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1151 <for_each+0x51>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdi
call   *%rax
mov    -0x18(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1128 <for_each+0x28>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_each>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rsi,%rdi
jae    112e <for_each+0x2e>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
add    %r15,%rbx
cmp    %r12,%rbx
jb     1120 <for_each+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @for_each(i8* %0, i8* readnone %1, i64 %2, void (i8*)* nocapture %3) {
%5 = icmp ult i8* %0, %1
br i1 %5, label %6, label %10
6: ; preds = %4, %6
%7 = phi i8* [ %8, %6 ], [ %0, %4 ]
tail call void %3(i8* %7)
%8 = getelementptr inbounds i8, i8* %7, i64 %2
%9 = icmp ult i8* %8, %1
br i1 %9, label %6, label %10
10: ; preds = %6, %4
ret void
}
int first_one2(unsigned int u2) { return __builtin_clz(u2) + 49; }


x86 assembly (clang, -O0):
<first_one2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
add    $0x31,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_one2>:
bsr    %edi,%eax
xor    $0x1f,%eax
add    $0x31,%eax
ret

LLVM IR (-O0):
define i32 @first_one2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = add nsw i32 %4, 49
ret i32 %5
}

LLVM IR (-O2):
define i32 @first_one2(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 49
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ microblaze_disable_exceptions();
int /*<<< orphan*/ microblaze_disable_interrupts();
void Xil_ExceptionDisable(void) {
  microblaze_disable_exceptions();
  microblaze_disable_interrupts();
}


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

x86 assembly (clang, -O2):
<Xil_ExceptionDisable>:
push   %rax
xor    %eax,%eax
call   1040 <microblaze_disable_exceptions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <microblaze_disable_interrupts@plt>

LLVM IR (-O0):
define void @Xil_ExceptionDisable() {
%1 = call i32 (...) @microblaze_disable_exceptions()
%2 = call i32 (...) @microblaze_disable_interrupts()
ret void
}

LLVM IR (-O2):
define void @Xil_ExceptionDisable() {
%1 = tail call i32 (...) @microblaze_disable_exceptions()
%2 = tail call i32 (...) @microblaze_disable_interrupts()
ret void
}
int main() {
  int *p = (int *)0x9;
  *p = 8;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
movl   $0x8,0x9
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* inttoptr (i64 9 to i32*), i32** %2
%3 = load i32*, i32** %2
store i32 8, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store i32 8, i32* inttoptr (i64 9 to i32*)
ret i32 0
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evbuffer_add(struct evbuffer *, char *, int);
int strlen(char *);
void irc_send_raw(struct evbuffer *out, char *str) {
  evbuffer_add(out, str, strlen(str));
  evbuffer_add(out, "\n", 1);
}


x86 assembly (clang, -O0):
<irc_send_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <evbuffer_add@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x1,%edx
call   1040 <evbuffer_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_send_raw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <evbuffer_add@plt>
lea    0xeba(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <evbuffer_add@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @irc_send_raw(%struct.evbuffer* %0, i8* %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i8*
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i8* %1, i8** %4
%5 = load %struct.evbuffer*, %struct.evbuffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @evbuffer_add(%struct.evbuffer* %5, i8* %6, i32 %8)
%10 = load %struct.evbuffer*, %struct.evbuffer** %3
%11 = call i32 @evbuffer_add(%struct.evbuffer* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @irc_send_raw(%struct.evbuffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @evbuffer_add(%struct.evbuffer* %0, i8* %1, i32 %3)
%5 = tail call i32 @evbuffer_add(%struct.evbuffer* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void av_encryption_init_info_get_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_init_info_get_side_data() {
ret void
}
void test_3(int *out, int a, int b, int c) {
  out[0] = a * b;
  out[1] = a * c;
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
imul   %esi,%edx
mov    %edx,(%rdi)
imul   %esi,%ecx
mov    %ecx,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @test_3(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %2, %1
store i32 %5, i32* %0
%6 = mul nsw i32 %3, %1
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int isEven(int);
int isOdd(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return isEven(n - 1);
  }
}


x86 assembly (clang, -O0):
<isOdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <isOdd+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1155 <isOdd+0x45>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <isOdd+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1155 <isOdd+0x45>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <isEven@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOdd>:
test   %edi,%edi
je     111e <isOdd+0xe>
cmp    $0x1,%edi
jne    1121 <isOdd+0x11>
mov    $0x1,%edi
mov    %edi,%eax
ret
add    $0xffffffff,%edi
jmp    1030 <isEven@plt>

LLVM IR (-O0):
define i32 @isOdd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @isEven(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %6
i32 1, label %2
]
2: ; preds = %1
br label %6
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @isEven(i32 %4)
br label %6
6: ; preds = %1, %3, %2
%7 = phi i32 [ 1, %2 ], [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
void timlib_remove_file(char *filename) {
  char sys_string[1024];
  sprintf(sys_string, "rm %s", filename);
  if (system(sys_string)) {
  }
}


x86 assembly (clang, -O0):
<timlib_remove_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1161 <timlib_remove_file+0x41>
jmp    1161 <timlib_remove_file+0x41>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_remove_file>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"rm %s\00"
define void @timlib_remove_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i64 @system(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"rm %s\00"
define void @timlib_remove_file(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t compute_island_count() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @compute_island_count() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ terminate(char *);
void sigabrt_handler(int sig) {
  (void)(sig);
  terminate("aborted");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigabrt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <terminate@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigabrt_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <terminate@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"aborted\00"
@EXIT_FAILURE = global i32 0
define void @sigabrt_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @terminate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"aborted\00"
@EXIT_FAILURE = global i32 0
define void @sigabrt_handler(i32 %0) {
%2 = tail call i32 @terminate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
scalar_t__ newval(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int ia[] = {12, 24, 45, 0};
  int i, sum = 0;
  for (i = 0; ia[i]; i++)
    sum += newval(ia[i]);
  printf("%d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmpl   $0x0,-0x10(%rbp,%rax,4)
je     1183 <main+0x63>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%edi
call   1040 <newval@plt>
mov    %rax,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x2c>
mov    -0x18(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
call   1040 <newval@plt>
mov    %rax,%rbx
mov    $0x18,%edi
call   1040 <newval@plt>
add    %eax,%ebx
mov    $0x2d,%edi
call   1040 <newval@plt>
add    %eax,%ebx
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.ia = [4 x i32] [i32 12, i32 24, i32 45, i32 0]
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [4 x i32]* %1 to i8*
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %5
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i64 @newval(i32 %15)
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %11
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %5
24: ; preds = %5
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i64 @newval(i32 12)
%2 = trunc i64 %1 to i32
%3 = tail call i64 @newval(i32 24)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
%6 = tail call i64 @newval(i32 45)
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
int test_imm_F0uint8_reg(unsigned char val) {
  return ((val) & (-0xF0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F0uint8_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, -240
%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_F0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 16
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void clear_buffer(int *sbuff) {
  int i = 0;
  for (i = 0; i < 10; ++i)
    sbuff[i] = 0;
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113d <clear_buffer+0x3d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_buffer+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_buffer(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ camc(int const, int const, int const, int const);
void camc_sn(const int c, const int n, const int a, const int f, const int r) {
  int i;
  for (i = 0; i < r; i++)
    camc(c, n + i, a, f);
}


x86 assembly (clang, -O0):
<camc_sn>:
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    %r8d,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115d <camc_sn+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x18(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <camc@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <camc_sn+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camc_sn>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %r8d,%r8d
jle    1148 <camc_sn+0x38>
mov    %r8d,%ebx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <camc@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <camc_sn+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @camc_sn(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %13
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ 0, %5 ]
%9 = add nsw i32 %8, %1
%10 = tail call i32 @camc(i32 %0, i32 %9, i32 %2, i32 %3)
%11 = add nuw nsw i32 %8, 1
%12 = icmp eq i32 %11, %4
br i1 %12, label %13, label %7
13: ; preds = %7, %5
ret void
}
/* Variables and functions */
int f2(int *, int *);
int f1(int *pf11, int *pf12) { return f2(pf11, pf12); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <f2@plt>

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

LLVM IR (-O2):
define i32 @f1(i32* %0, i32* %1) {
%3 = tail call i32 @f2(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ daemon_init();
int main(int argc, char *argv[]) {
  daemon_init();
  while (1)
    ;
  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   1030 <daemon_init@plt>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <daemon_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

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 (...) @daemon_init()
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @daemon_init()
br label %4
4: ; preds = %2, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ doCalculation();
int main(int argc, char **argv) {
  doCalculation();
  doCalculation();
  doCalculation();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @doCalculation()
%4 = tail call i32 (...) @doCalculation()
%5 = tail call i32 (...) @doCalculation()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LPUART6_DriverIRQHandler();
__attribute__((weak)) void LPUART6_IRQHandler(void) {
  LPUART6_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPUART6_IRQHandler() {
%1 = call i32 (...) @LPUART6_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPUART6_IRQHandler() {
%1 = tail call i32 (...) @LPUART6_DriverIRQHandler()
ret void
}
void UARTHalfDuplexDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~0x00000008;
}


x86 assembly (clang, -O0):
<UARTHalfDuplexDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xfffffffffffffff7,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTHalfDuplexDisable>:
andq   $0xfffffffffffffff7,0x14(%rdi)
ret

LLVM IR (-O0):
define void @UARTHalfDuplexDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -9
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTHalfDuplexDisable(i64 %0) {
%2 = add i64 %0, 20
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -9
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activate();
int /*<<< orphan*/ current();
int /*<<< orphan*/ focus();
int /*<<< orphan*/ map();
int /*<<< orphan*/ raise();
int show() {
  map();
  current();
  raise();
  activate();
  focus();
  return 0;
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <map@plt>
mov    $0x0,%al
call   1070 <current@plt>
mov    $0x0,%al
call   1030 <raise@plt>
mov    $0x0,%al
call   1050 <activate@plt>
mov    $0x0,%al
call   1040 <focus@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rax
xor    %eax,%eax
call   1060 <map@plt>
xor    %eax,%eax
call   1070 <current@plt>
xor    %eax,%eax
call   1030 <raise@plt>
xor    %eax,%eax
call   1050 <activate@plt>
xor    %eax,%eax
call   1040 <focus@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @show() {
%1 = call i32 (...) @map()
%2 = call i32 (...) @current()
%3 = call i32 (...) @raise()
%4 = call i32 (...) @activate()
%5 = call i32 (...) @focus()
ret i32 0
}

LLVM IR (-O2):
define i32 @show() {
%1 = tail call i32 (...) @map()
%2 = tail call i32 (...) @current()
%3 = tail call i32 (...) @raise()
%4 = tail call i32 (...) @activate()
%5 = tail call i32 (...) @focus()
ret i32 0
}
void yy_1_XmlEntityRefChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_XmlEntityRefChoice(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 @yy_1_XmlEntityRefChoice(i8* nocapture %0, i32 %1) {
ret void
}
void sys_putmidimess(int portno, int a, int b, int c) {}


x86 assembly (clang, -O0):
<sys_putmidimess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sys_putmidimess(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void __hv_cast_fi(float bIn, int *bOut) { *bOut = (int)bIn; }


x86 assembly (clang, -O0):
<__hv_cast_fi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__hv_cast_fi(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i32
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @__hv_cast_fi(float %0, i32* nocapture writeonly %1) {
%3 = fptosi float %0 to i32
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
short cos(short);
short sin(short);
short internal_cot_s(short value) { return cos(value) / sin(value); }


x86 assembly (clang, -O0):
<internal_cot_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
call   1040 <cos@plt>
cwtl
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
call   1030 <sin@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%eax
movswl %cx,%ecx
cltd
idiv   %ecx
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_cot_s>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <cos@plt>
movswl %ax,%ebp
mov    %ebx,%edi
call   1030 <sin@plt>
movswl %ax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @internal_cot_s(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call signext i16 @cos(i16 signext %3)
%5 = sext i16 %4 to i32
%6 = load i16, i16* %2
%7 = call signext i16 @sin(i16 signext %6)
%8 = sext i16 %7 to i32
%9 = sdiv i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @internal_cot_s(i16 signext %0) {
%2 = tail call signext i16 @cos(i16 signext %0)
%3 = sext i16 %2 to i32
%4 = tail call signext i16 @sin(i16 signext %0)
%5 = sext i16 %4 to i32
%6 = sdiv i32 %3, %5
%7 = trunc i32 %6 to i16
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ put_forks(long);
int /*<<< orphan*/ take_forks(long);
void *philosopher(void *arg) {
  long int i;
  i = (long int)arg;
  while (1) {
    printf("Philosopher %ld thinking.\n", i);
    take_forks(i);
    printf("Philosopher %ld eating.\n", i);
    put_forks(i);
  }
}


x86 assembly (clang, -O0):
<philosopher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <take_forks@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put_forks@plt>
jmp    1144 <philosopher+0x14>

x86 assembly (clang, -O2):
<philosopher>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec1(%rip),%r14
lea    0xed5(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <take_forks@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <put_forks@plt>
jmp    1150 <philosopher+0x20>

LLVM IR (-O0):
@.str = [27 x i8] c"Philosopher %ld thinking.\0A\00"
@.str.1 = [25 x i8] c"Philosopher %ld eating.\0A\00"
define i8* @philosopher(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
br label %6
6: ; preds = %1, %6
%7 = load i64, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %3
%10 = call i32 @take_forks(i64 %9)
%11 = load i64, i64* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = load i64, i64* %3
%14 = call i32 @put_forks(i64 %13)
br label %6
}

LLVM IR (-O2):
@.str = [27 x i8] c"Philosopher %ld thinking.\0A\00"
@.str.1 = [25 x i8] c"Philosopher %ld eating.\0A\00"
define noalias i8* @philosopher(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %2)
%5 = tail call i32 @take_forks(i64 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 %2)
%7 = tail call i32 @put_forks(i64 %2)
br label %3
}
void s5p6442_default_sdhci0(void) {}


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

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

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

LLVM IR (-O2):
define void @s5p6442_default_sdhci0() {
ret void
}