xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ has_last_slash(char *);
int strlen(char *);
char *remove_last_slash(char *path) {
  if (has_last_slash(path))
    path[strlen(path) - 1] = 0;
  return path;
}


x86 assembly (clang, -O0):
<remove_last_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <has_last_slash@plt>
cmp    $0x0,%rax
je     1160 <remove_last_slash+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_last_slash>:
push   %rbx
mov    %rdi,%rbx
call   1040 <has_last_slash@plt>
test   %rax,%rax
je     113d <remove_last_slash+0x1d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @remove_last_slash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @has_last_slash(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %6, %1
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @remove_last_slash(i8* returned %0) {
%2 = tail call i64 @has_last_slash(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %4, %1
ret i8* %0
}
int starts_with(const char *big, const char *small) {
  while (*big != '\0' && *big == *small) {
    ++big;
    ++small;
  }
  return *small == 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <starts_with+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <starts_with+0x47>
jmp    1164 <starts_with+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <starts_with+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
mov    (%rdi),%al
test   %al,%al
je     1123 <starts_with+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1123 <starts_with+0x23>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <starts_with+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}
unsigned int ROTR(unsigned int a, unsigned int n) {
  return (((a) >> n) | ((a) << (32 - n)));
}


x86 assembly (clang, -O0):
<ROTR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTR>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROTR(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ROTR(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void prepare_irte(struct irte *irte, int vector, unsigned int dest) {}


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

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

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

LLVM IR (-O2):
%struct.irte = type opaque
define void @prepare_irte(%struct.irte* nocapture %0, i32 %1, i32 %2) {
ret void
}
int do_850() { return 850; }


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

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

LLVM IR (-O0):
define i32 @do_850() {
ret i32 850
}

LLVM IR (-O2):
define i32 @do_850() {
ret i32 850
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int testBit_fun_uint64_t(uint64_t x, uint32_t i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_uint64_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_uint64_t(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_uint64_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mbtowc(wchar_t *pwc, const char *s, size_t n) {
  printf("mbtowc STUB!\n");
  return -1;
}


x86 assembly (clang, -O0):
<mbtowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"mbtowc STUB!\0A\00"
define i32 @mbtowc(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [13 x i8] c"mbtowc STUB!\00"
define i32 @mbtowc(i32* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
int uECC_curve() { return 1; }


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

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

LLVM IR (-O0):
define i32 @uECC_curve() {
ret i32 1
}

LLVM IR (-O2):
define i32 @uECC_curve() {
ret i32 1
}
__attribute__((__always___)) void sx_compiler_write_barrier() {}


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

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

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

LLVM IR (-O2):
define void @sx_compiler_write_barrier() {
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double scalbn(double x, int n) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<scalbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @scalbn(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @scalbn(double %0, i32 %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *s, size_t maxlen) {
  const char *x = memchr(s, 0, maxlen);
  if (!x)
    x = s + maxlen;
  return x - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114a <strnlen+0x3a>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memchr@plt>
add    %r14,%rbx
test   %rax,%rax
cmove  %rbx,%rax
sub    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = select i1 %4, i8* %5, i8* %3
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, unsigned long,
                          int /*<<< orphan*/ *);
unsigned long write(FILE *fp, unsigned char *c, unsigned long len) {
  fwrite(c, 1, len, fp);
  return len;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @write(i32* nocapture %0, i8* nocapture %1, i64 returned %2) {
%4 = tail call i32 @fwrite(i8* %1, i32 1, i64 %2, i32* %0)
ret i64 %2
}
int probe3(int hashCode) {
  const long probeOffset = 0x1fd;
  long newHashCode = (hashCode + probeOffset) & 0xfff;
  return ((int)newHashCode);
}


x86 assembly (clang, -O0):
<probe3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1fd,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    $0x1fd,%rax
and    $0xfff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<probe3>:
lea    0x1fd(%rdi),%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @probe3(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
store i64 509, i64* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, 509
%8 = and i64 %7, 4095
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @probe3(i32 %0) {
%2 = add i32 %0, 509
%3 = and i32 %2, 4095
ret i32 %3
}
/* Variables and functions */
void *dasm_malloc(int);
int /*<<< orphan*/ dasm_mfree();
int main(int argc, char *argv[]) {
  void *ptr1;
  void *ptr2;
  void *ptr3;
  void *ptr4;
  ptr1 = dasm_malloc(23);
  ptr2 = dasm_malloc(24);
  ptr3 = dasm_malloc(25);
  ptr4 = dasm_malloc(26);
  dasm_mfree();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x17,%edi
call   1040 <dasm_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x18,%edi
call   1040 <dasm_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x19,%edi
call   1040 <dasm_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1a,%edi
call   1040 <dasm_malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1030 <dasm_mfree@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1040 <dasm_malloc@plt>
mov    $0x18,%edi
call   1040 <dasm_malloc@plt>
mov    $0x19,%edi
call   1040 <dasm_malloc@plt>
mov    $0x1a,%edi
call   1040 <dasm_malloc@plt>
xor    %eax,%eax
call   1030 <dasm_mfree@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i8* @dasm_malloc(i32 23)
store i8* %10, i8** %6
%11 = call i8* @dasm_malloc(i32 24)
store i8* %11, i8** %7
%12 = call i8* @dasm_malloc(i32 25)
store i8* %12, i8** %8
%13 = call i8* @dasm_malloc(i32 26)
store i8* %13, i8** %9
%14 = call i32 (...) @dasm_mfree()
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @dasm_malloc(i32 23)
%4 = tail call i8* @dasm_malloc(i32 24)
%5 = tail call i8* @dasm_malloc(i32 25)
%6 = tail call i8* @dasm_malloc(i32 26)
%7 = tail call i32 (...) @dasm_mfree()
ret i32 1
}
int do_185() { return 185; }


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

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

LLVM IR (-O0):
define i32 @do_185() {
ret i32 185
}

LLVM IR (-O2):
define i32 @do_185() {
ret i32 185
}
/* Variables and functions */
size_t String_count_char(const char *str, char character) {
  const char *pch = str;
  size_t count = 0;
  while (*pch != '\0') {
    if (*pch == character) {
      count++;
    }
    pch++;
  }
  return count;
}


x86 assembly (clang, -O0):
<String_count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <String_count_char+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <String_count_char+0x4d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <String_count_char+0x1e>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<String_count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <String_count_char+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <String_count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @String_count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%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 i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i64
%11 = add i64 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ pop();
void core_drop(void) { pop(); }


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

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

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

LLVM IR (-O2):
define void @core_drop() {
%1 = tail call i32 (...) @pop()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct nlattr {
  int dummy;
};

/* Variables and functions */
scalar_t__ libbpf_nla_data(struct nlattr const *);
uint32_t libbpf_nla_getattr_u32(const struct nlattr *nla) {
  return *(uint32_t *)libbpf_nla_data(nla);
}


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

x86 assembly (clang, -O2):
<libbpf_nla_getattr_u32>:
push   %rax
call   1030 <libbpf_nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @libbpf_nla_getattr_u32(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @libbpf_nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @libbpf_nla_getattr_u32(%struct.nlattr* %0) {
%2 = tail call i64 @libbpf_nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
unsigned cpu_uint8_make_uint8(unsigned v0) { return v0; }


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

x86 assembly (clang, -O2):
<cpu_uint8_make_uint8>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cpu_uint8_make_uint8(i32 returned %0) {
ret i32 %0
}
__typeof__(isalnum("")) test_isalnum_8(void) { return isalnum(""); }


x86 assembly (clang, -O0):
<test_isalnum_8>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isalnum@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalnum_8() {
%1 = call i32 @isalnum(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalnum_8() {
%1 = tail call i32 @isalnum(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int inject(char *);
enum nss_status _nss_inject_gethostbyname3_r(const char *name, int family,
                                             struct hostent *result,
                                             char *buffer, size_t buflen,
                                             int *errnop, int *h_errnop,
                                             int32_t *ttlp, char **canonp) {
  return inject("gethostbyname3");
}


x86 assembly (clang, -O0):
<_nss_inject_gethostbyname3_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <inject@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [15 x i8] c"gethostbyname3\00"
define i32 @_nss_inject_gethostbyname3_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6, i32* %7, i8** %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca %struct.hostent*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i8**
store i8* %0, i8** %10
store i32 %1, i32* %11
store %struct.hostent* %2, %struct.hostent** %12
store i8* %3, i8** %13
store i64 %4, i64* %14
store i32* %5, i32** %15
store i32* %6, i32** %16
store i32* %7, i32** %17
store i8** %8, i8*** %18
%19 = call i32 @inject(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %19
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [15 x i8] c"gethostbyname3\00"
define i32 @_nss_inject_gethostbyname3_r(i8* nocapture readnone %0, i32 %1, %struct.hostent* nocapture readnone %2, i8* nocapture readnone %3, i64 %4, i32* nocapture readnone %5, i32* nocapture readnone %6, i32* nocapture readnone %7, i8** nocapture readnone %8) {
%10 = tail call i32 @inject(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}
int pre_show_moose() {}


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

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

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

LLVM IR (-O2):
define i32 @pre_show_moose() {
ret i32 undef
}
void SSMR3GetStrZ(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetStrZ() {
ret void
}
int test15b() {
  int x = x;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @test15b() {
ret i32 undef
}
/* Variables and functions */
int CHAR_BIT;
int main(void) { return (int)1 << sizeof(int) * CHAR_BIT; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = mul i64 4, %3
%5 = trunc i64 %4 to i32
%6 = shl i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 2
%3 = shl nuw i32 1, %2
ret i32 %3
}
int dummy_get_cal(struct bladerf *dev, char *cal) { return 0; }


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

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

LLVM IR (-O0):
%struct.bladerf = type opaque
define i32 @dummy_get_cal(%struct.bladerf* %0, i8* %1) {
%3 = alloca %struct.bladerf*
%4 = alloca i8*
store %struct.bladerf* %0, %struct.bladerf** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.bladerf = type opaque
define i32 @dummy_get_cal(%struct.bladerf* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
double doubleAddConstant(double value, void *constantP) {
  assert(constantP);
  double *c = constantP;
  return 2 * value + *c;
}


x86 assembly (clang, -O0):
<doubleAddConstant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleAddConstant>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
addsd  (%rbx),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @doubleAddConstant(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double*
store double %0, double* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %5
%10 = load double, double* %3
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %10, double %12)
ret double %13
}

LLVM IR (-O2):
define double @doubleAddConstant(double %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = bitcast i8* %1 to double*
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %5)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int trap(int *, int);
void trapMain(void) {
  int array[] = {0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1,
                 0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1};
  int len = 0;
  { len = sizeof(array) / sizeof(array[0]); };
  printf("%d\n", trap(array, len));
}


x86 assembly (clang, -O0):
<trapMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x60(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x60,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x64(%rbp)
movl   $0x18,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1050 <trap@plt>
mov    %eax,%esi
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trapMain>:
sub    $0x68,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x18,%esi
call   1040 <trap@plt>
lea    0xee1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.trapMain.array = [24 x i32] [i32 0, i32 1, i32 0, i32 2, i32 1, i32 0, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1, i32 0, i32 1, i32 0, i32 2, i32 1, i32 0, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define void @trapMain() {
%1 = alloca [24 x i32]
%2 = alloca i32
%3 = bitcast [24 x i32]* %1 to i8*
store i32 0, i32* %2
store i32 24, i32* %2
%4 = getelementptr inbounds [24 x i32], [24 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @trap(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.trapMain.array = [24 x i32] [i32 0, i32 1, i32 0, i32 2, i32 1, i32 0, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1, i32 0, i32 1, i32 0, i32 2, i32 1, i32 0, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define void @trapMain() {
%1 = alloca [24 x i32]
%2 = bitcast [24 x i32]* %1 to i8*
%3 = getelementptr inbounds [24 x i32], [24 x i32]* %1, i64 0, i64 0
%4 = call i32 @trap(i32* %3, i32 24)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s2;
typedef int /*<<< orphan*/ s1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  void *p;
  char c;
  char cs[3];
  int x;
  struct s1 {
    char *p;
    char a;
    char c;
  } s1, s2[4];
  printf("%p, %p, %p\n", &p, &c, &x);
  printf("sizeof(s1)=%zu, s2=%zu\n", sizeof(s1), sizeof(s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x19(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x10,%esi
mov    $0x40,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x10,%esi
mov    $0x40,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.s1 = type { i8*, i8, i8 }
@.str = [12 x i8] c"%p, %p, %p\0A\00"
@.str.1 = [24 x i8] c"sizeof(s1)=%zu, s2=%zu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8
%8 = alloca [3 x i8]
%9 = alloca i32
%10 = alloca %struct.s1
%11 = alloca [4 x %struct.s1]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6, i8* %7, i32* %9)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 64)
ret i32 0
}

LLVM IR (-O2):
%struct.s1 = type { i8*, i8, i8 }
@.str = [12 x i8] c"%p, %p, %p\0A\00"
@.str.1 = [24 x i8] c"sizeof(s1)=%zu, s2=%zu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = bitcast i8** %3 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3, i8* %4, i32* %5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 64)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gdt_install();
int /*<<< orphan*/ idt_install();
int /*<<< orphan*/ irq_install();
int /*<<< orphan*/ isrs_install();
int /*<<< orphan*/ keyboard_install();
int /*<<< orphan*/ timer_install();
void initOs() {
  gdt_install();
  idt_install();
  isrs_install();
  irq_install();
  timer_install();
  keyboard_install();
}


x86 assembly (clang, -O0):
<initOs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <gdt_install@plt>
mov    $0x0,%al
call   1060 <idt_install@plt>
mov    $0x0,%al
call   1070 <isrs_install@plt>
mov    $0x0,%al
call   1040 <irq_install@plt>
mov    $0x0,%al
call   1030 <timer_install@plt>
mov    $0x0,%al
call   1080 <keyboard_install@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initOs>:
push   %rax
xor    %eax,%eax
call   1050 <gdt_install@plt>
xor    %eax,%eax
call   1060 <idt_install@plt>
xor    %eax,%eax
call   1070 <isrs_install@plt>
xor    %eax,%eax
call   1040 <irq_install@plt>
xor    %eax,%eax
call   1030 <timer_install@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <keyboard_install@plt>

LLVM IR (-O0):
define void @initOs() {
%1 = call i32 (...) @gdt_install()
%2 = call i32 (...) @idt_install()
%3 = call i32 (...) @isrs_install()
%4 = call i32 (...) @irq_install()
%5 = call i32 (...) @timer_install()
%6 = call i32 (...) @keyboard_install()
ret void
}

LLVM IR (-O2):
define void @initOs() {
%1 = tail call i32 (...) @gdt_install()
%2 = tail call i32 (...) @idt_install()
%3 = tail call i32 (...) @isrs_install()
%4 = tail call i32 (...) @irq_install()
%5 = tail call i32 (...) @timer_install()
%6 = tail call i32 (...) @keyboard_install()
ret void
}
void g_unichar_iswide() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_iswide() {
ret void
}
/* Variables and functions */
unsigned isupper(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_break_for() {
  printf("\n===== test_break_for\n");
  int result = 1;
  for (int i = 1; i < 10; ++i) {
    ++result;
    if (result == 5)
      break;
  }
  assert(result == 5);
}


x86 assembly (clang, -O0):
<test_break_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1177 <test_break_for+0x57>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1164 <test_break_for+0x44>
jmp    1177 <test_break_for+0x57>
jmp    1169 <test_break_for+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <test_break_for+0x22>
cmpl   $0x5,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_break_for>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0A===== test_break_for\0A\00"
define void @test_break_for() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 5
br i1 %11, label %12, label %13
12: ; preds = %7
br label %17
13: ; preds = %7
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %12, %4
%18 = load i32, i32* %1
%19 = icmp eq i32 %18, 5
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"\0A===== test_break_for\00"
define void @test_break_for() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
ret void
}
void outl(short port, int val) {
  __asm__ volatile("outl %1, %0" : : "dN"(port), "a"(val));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x8(%rbp),%eax
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

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

LLVM IR (-O2):
define void @outl(i16 signext %0, i32 %1) {
tail call void asm sideeffect "outl $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
void do_prelude() {}


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

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

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

LLVM IR (-O2):
define void @do_prelude() {
ret void
}
int extractMax(int *array) { return *(array + 0); }


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

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

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

LLVM IR (-O2):
define i32 @extractMax(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int map_update(struct map_ent **mpp, int devnum, char *metadata, int *uuid,
               char *path) {
  return 0;
}


x86 assembly (clang, -O0):
<map_update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.map_ent = type opaque
define i32 @map_update(%struct.map_ent** %0, i32 %1, i8* %2, i32* %3, i8* %4) {
%6 = alloca %struct.map_ent**
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i8*
store %struct.map_ent** %0, %struct.map_ent*** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
%struct.map_ent = type opaque
define i32 @map_update(%struct.map_ent** nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
ex17() { printf("\n%d\n", EOF); }


x86 assembly (clang, -O0):
<ex17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex17>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%d\0A\00"
@EOF = global i32 0
define i32 @ex17() {
%1 = alloca i32
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
@EOF = global i32 0
define i32 @ex17() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
void fd75(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    p013A:
      goto p013A;
      goto a;
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a : {
  typedef int(*f)[n];
P02A:
  goto P02A;
  {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
P02B:
  goto P02B;
  {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
P02C:
  goto P02C;
  ;
  typedef int(*i)[n];
P026A:
  goto P026A;
  0;
};
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd75>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd75+0x7>

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

LLVM IR (-O0):
define void @fd75(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd75(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c = '1';
  printf("%d", (c - '0') + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x31,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
add    $0x1,%eax
lea    0xed3(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
store i8 49, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = sub nsw i32 %3, 48
%5 = add nsw i32 %4, 1
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 2)
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long _time(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000000 + t.tv_usec;
}


x86 assembly (clang, -O0):
<_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
void TimerCounterSet(unsigned long ulBase, unsigned long ulCounter) {

  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000024))) = ulCounter;
}


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

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

LLVM IR (-O0):
define void @TimerCounterSet(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 = add i64 %6, 36
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerCounterSet(i64 %0, i64 %1) {
%3 = add i64 %0, 36
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}