xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t metadata_get_timestamp(const uint8_t *header) {
  uint64_t ret;
  assert(sizeof(ret) == (sizeof(uint64_t)));
  memcpy(&ret, &header[((sizeof(uint32_t)))], (sizeof(uint64_t)));
  ret = le64toh(ret);
  return ret;
}


x86 assembly (clang, -O0):
<metadata_get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rsi
add    $0x10,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1030 <le64toh@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metadata_get_timestamp>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <assert@plt>
add    $0x10,%rbx
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1030 <le64toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @metadata_get_timestamp(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @assert(i32 1)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = call i32 @memcpy(i32* %3, i32* %6, i32 4)
%8 = load i32, i32* %3
%9 = call i32 @le64toh(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @metadata_get_timestamp(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @assert(i32 1)
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = call i32 @memcpy(i32* %2, i32* %5, i32 4)
%7 = load i32, i32* %2
%8 = call i32 @le64toh(i32 %7)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ cl_int;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, scalar_t__);
void chk(cl_int status, const char *cmd) {
  if (status != CL_SUCCESS) {
    printf("%s failed (%d) \n", cmd, status);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%rax
je     1162 <chk+0x42>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %rdi,(%rax)
jne    112f <chk+0xf>
pop    %rax
ret
mov    %rdi,%rdx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@CL_SUCCESS = global i64 0
@.str = [17 x i8] c"%s failed (%d) \0A\00"
define void @chk(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i64, i64* @CL_SUCCESS
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i64, i64* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9, i64 %10)
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@CL_SUCCESS = global i64 0
@.str = [17 x i8] c"%s failed (%d) \0A\00"
define void @chk(i64 %0, i8* %1) {
%3 = load i64, i64* @CL_SUCCESS
%4 = icmp eq i64 %3, %0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %0)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int strlcpy(char *, char *, int /*<<< orphan*/);
int f7() {
  char buf[8];
  return strlcpy(buf, "1234567", 0);
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    0xedd(%rip),%rsi
xor    %edx,%edx
call   1030 <strlcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdi
xor    %edx,%edx
call   1030 <strlcpy@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1234567\00"
define i32 @f7() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"1234567\00"
define i32 @f7() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %3
}
void a() {}


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

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

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

LLVM IR (-O2):
define void @a() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *unctrl(int);
int main() {
  int ch;
  for (ch = 0; ch < 256; ch++) {
    printf("0x%02x: %s\n", ch, unctrl(ch));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1171 <main+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <unctrl@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <unctrl@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"0x%02x: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i8* @unctrl(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"0x%02x: %s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i8* @unctrl(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
int d_eq_cr1(double a1) { return (((100) == (a1))); }


x86 assembly (clang, -O0):
<d_eq_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_cr1>:
cmpeqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_eq_cr1(double %0) {
%2 = fcmp oeq double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int __BNF_trans_string(char *);
int digging_verb(void) {
  int state;
  do {
    state = __BNF_trans_string("dig");
    if (!state)
      break;
    state = __BNF_trans_string("excavate");
  } while (0);
  return state;
}


x86 assembly (clang, -O0):
<digging_verb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <digging_verb+0x26>
jmp    1145 <digging_verb+0x35>
lea    0xec7(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digging_verb>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     112e <digging_verb+0x1e>
lea    0xedc(%rip),%rdi
pop    %rax
jmp    1030 <__BNF_trans_string@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"dig\00"
@.str.1 = [9 x i8] c"excavate\00"
define i32 @digging_verb() {
%1 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Type definitions */
struct gffFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gffFileAdd(struct gffFile *, char *, int /*<<< orphan*/);
struct gffFile *gffFileNew(char *);
struct gffFile *gffRead(char *fileName) {
  struct gffFile *gff = gffFileNew(fileName);
  gffFileAdd(gff, fileName, 0);
  return gff;
}


x86 assembly (clang, -O0):
<gffRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gffFileNew@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1040 <gffFileAdd@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffRead>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <gffFileNew@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <gffFileAdd@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.gffFile = type { i32 }
define %struct.gffFile* @gffRead(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.gffFile*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.gffFile* @gffFileNew(i8* %4)
store %struct.gffFile* %5, %struct.gffFile** %3
%6 = load %struct.gffFile*, %struct.gffFile** %3
%7 = load i8*, i8** %2
%8 = call i32 @gffFileAdd(%struct.gffFile* %6, i8* %7, i32 0)
%9 = load %struct.gffFile*, %struct.gffFile** %3
ret %struct.gffFile* %9
}

LLVM IR (-O2):
%struct.gffFile = type { i32 }
define %struct.gffFile* @gffRead(i8* %0) {
%2 = tail call %struct.gffFile* @gffFileNew(i8* %0)
%3 = tail call i32 @gffFileAdd(%struct.gffFile* %2, i8* %0, i32 0)
ret %struct.gffFile* %2
}
/* Variables and functions */
void *lmalloc(size_t);
int /*<<< orphan*/ lmalloc_oom(size_t);
void *realloc(void *, size_t);
void *lrealloc(void *ptr, size_t size) {
  void *newptr;
  if (ptr == NULL)
    return lmalloc(size);
  newptr = realloc(ptr, size);
  if (!newptr)
    lmalloc_oom(size);
  return newptr;
}


x86 assembly (clang, -O0):
<lrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <lrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1040 <lmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    118a <lrealloc+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1182 <lrealloc+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <lmalloc_oom@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrealloc>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     1148 <lrealloc+0x18>
mov    %rbx,%rsi
call   1050 <realloc@plt>
test   %rax,%rax
je     1151 <lrealloc+0x21>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <lmalloc@plt>
mov    %rbx,%rdi
call   1030 <lmalloc_oom@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %5
%11 = call i8* @lmalloc(i64 %10)
store i8* %11, i8** %3
br label %23
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i8* @realloc(i8* %13, i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %21, label %18
18: ; preds = %12
%19 = load i64, i64* %5
%20 = call i32 @lmalloc_oom(i64 %19)
br label %21
21: ; preds = %18, %12
%22 = load i8*, i8** %6
store i8* %22, i8** %3
br label %23
23: ; preds = %21, %9
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @lrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @lmalloc(i64 %1)
br label %11
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @lmalloc_oom(i64 %1)
br label %11
11: ; preds = %6, %9, %4
%12 = phi i8* [ %5, %4 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t equalKeys(void *keyA, int hashA, void *keyB, int hashB,
                  uint8_t (*equals)(void *, void *)) {
  if (keyA == keyB) {
    return 1;
  }
  if (hashA != hashB) {
    return 0;
  }
  return equals(keyA, keyB);
}


x86 assembly (clang, -O0):
<equalKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1134 <equalKeys+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115d <equalKeys+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     114c <equalKeys+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    115d <equalKeys+0x5d>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalKeys>:
cmp    %rdx,%rdi
je     1111 <equalKeys+0x11>
xor    %eax,%eax
cmp    %ecx,%esi
jne    1116 <equalKeys+0x16>
mov    %rdx,%rsi
jmp    *%r8
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equalKeys(i8* %0, i32 %1, i8* %2, i32 %3, i32 (i8*, i8*)* nocapture %4) {
%6 = icmp eq i8* %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i32 %1, %3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 %4(i8* %0, i8* %2)
br label %11
11: ; preds = %7, %5, %9
%12 = phi i32 [ %10, %9 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnb(int nb) {
  if (nb / 10 >= 1) {
    ft_putnb(nb / 10);
    ft_putchar(nb % 10 + '0');
  } else {
    ft_putchar('0' + nb);
  }
}


x86 assembly (clang, -O0):
<ft_putnb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     116b <ft_putnb+0x4b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ft_putnb@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1040 <ft_putchar@plt>
jmp    1176 <ft_putnb+0x56>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnb>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0x9,%edi
jle    114c <ft_putnb+0x2c>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1030 <ft_putnb@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
or     $0x30,%ebp
jmp    114f <ft_putnb+0x2f>
add    $0x30,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp sge i32 %4, 1
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
%11 = add nsw i32 %10, 48
%12 = call i32 @ft_putchar(i32 %11)
br label %17
13: ; preds = %1
%14 = load i32, i32* %2
%15 = add nsw i32 48, %14
%16 = call i32 @ft_putchar(i32 %15)
br label %17
17: ; preds = %13, %6
ret void
}

LLVM IR (-O2):
define void @ft_putnb(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %6, label %10
3: ; preds = %10, %6
%4 = phi i32 [ %11, %10 ], [ %9, %6 ]
%5 = tail call i32 @ft_putchar(i32 %4)
ret void
6: ; preds = %1
%7 = udiv i32 %0, 10
tail call void @ft_putnb(i32 %7)
%8 = urem i32 %0, 10
%9 = or i32 %8, 48
br label %3
10: ; preds = %1
%11 = add nsw i32 %0, 48
br label %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_height(void *_p) { return (int)((XImage *)_p)->height; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XImage_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XImage_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double log10(double);
double log2(double x) {
  return (log10(x) / ((double)0.30102999566398119521373889472449));
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
call   1030 <log10@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fdiv double %4, 0x3FD34413509F79FF
ret double %5
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @log10(double %0)
%3 = fdiv double %2, 0x3FD34413509F79FF
ret double %3
}
void __attribute__((weak)) usb_lp_can1_rx0_isr() {
  debug_handler(__FUNCTION__);
}


x86 assembly (clang, -O0):
<usb_lp_can1_rx0_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lp_can1_rx0_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.usb_lp_can1_rx0_isr = [20 x i8] c"usb_lp_can1_rx0_isr\00"
define weak void @usb_lp_can1_rx0_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.usb_lp_can1_rx0_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.usb_lp_can1_rx0_isr = [20 x i8] c"usb_lp_can1_rx0_isr\00"
define weak void @usb_lp_can1_rx0_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.usb_lp_can1_rx0_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
void __VERIFIER_assert(int cond) {
  if (!(cond)) {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<__VERIFIER_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <__VERIFIER_assert+0x21>
jmp    112a <__VERIFIER_assert+0x1a>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_assert>:
test   %edi,%edi
je     1115 <__VERIFIER_assert+0x5>
ret
xor    %eax,%eax
jmp    1030 <__VERIFIER_error@plt>

LLVM IR (-O0):
define void @__VERIFIER_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @__VERIFIER_error()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %1
ret void
}
int _mpyluhs(unsigned int src1, int src2) {
  return (unsigned short)src1 * (short)(src2 >> 16);
}


x86 assembly (clang, -O0):
<_mpyluhs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyluhs>:
movzwl %di,%eax
sar    $0x10,%esi
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyluhs(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 = trunc i32 %5 to i16
%7 = zext i16 %6 to i32
%8 = load i32, i32* %4
%9 = ashr i32 %8, 16
%10 = trunc i32 %9 to i16
%11 = sext i16 %10 to i32
%12 = mul nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpyluhs(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = ashr i32 %1, 16
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char my_word1[] = {'H', 'e', 'l', 'l', 'o', '\0'};
  char my_word2[] = "Hello";
  puts(my_word1);
  puts(my_word2);
  printf("\n[Press Enter to close]");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x10(%rbp),%rdi
call   1030 <puts@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6548,0x10(%rsp)
6c
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x10(%rsp),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.my_word1 = [6 x i8] c"Hello\00"
@__const.main.my_word2 = [6 x i8] c"Hello\00"
@.str = [24 x i8] c"\0A[Press Enter to close]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.my_word2 = [6 x i8] c"Hello\00"
@.str = [24 x i8] c"\0A[Press Enter to close]\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %3)
%6 = call i32 @puts(i8* %4)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @getchar()
ret i32 0
}
void test___atomic_fetch_nand_0(char *mem) { __atomic_fetch_nand(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_nand_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test___atomic_fetch_nand_0+0x4f>
jmp    111f <test___atomic_fetch_nand_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_nand_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
or     $0xfe,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test___atomic_fetch_nand_0+0x10>
ret

LLVM IR (-O0):
define void @test___atomic_fetch_nand_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw nand i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_nand_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
ret void
}
void *double_thread(void *arg) {
  int x = (int)arg;
  x = x * 2;
  return (void *)(x);
}


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

x86 assembly (clang, -O2):
<double_thread>:
add    %edi,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @double_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @double_thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = shl nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIO_set_many(uint64_t pins) {
  (*((volatile uint32_t *)(0x0020001C))) = (uint32_t)pins;
  (*((volatile uint32_t *)(0x00200020))) = (uint32_t)(0x3FFFFF & (pins >> 32));
}


x86 assembly (clang, -O0):
<GPIO_set_many>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x20001c,%eax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0x3fffff,%eax
movslq %eax,%rcx
mov    $0x200020,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_set_many>:
movslq %edi,%rax
mov    %rax,0x20001c
ret

LLVM IR (-O0):
define void @GPIO_set_many(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 2097180 to i64*)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = and i32 4194303, %6
%8 = sext i32 %7 to i64
store volatile i64 %8, i64* inttoptr (i64 2097184 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIO_set_many(i32 %0) {
%2 = sext i32 %0 to i64
store volatile i64 %2, i64* inttoptr (i64 2097180 to i64*)
store volatile i64 poison, i64* inttoptr (i64 2097184 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EC_KEY;

/* Variables and functions */
int /*<<< orphan*/ EC_KEY_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_assign_EC_KEY(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) {
  int ret = EVP_PKEY_assign_EC_KEY(pkey, key);
  if (ret != 0)
    EC_KEY_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_EC_KEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <EVP_PKEY_assign_EC_KEY@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_EC_KEY+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <EC_KEY_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_EC_KEY>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <EVP_PKEY_assign_EC_KEY@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_EC_KEY+0x19>
mov    %rbx,%rdi
call   1030 <EC_KEY_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_EC_KEY(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_EC_KEY(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @EC_KEY_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void handle_XFSZ(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_XFSZ(i32 %0) {
ret void
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructNameString(struct constructHeader *);
const char *EnvGetDefruleName(void *theEnv, void *theDefrule) {
  return GetConstructNameString((struct constructHeader *)theDefrule);
}


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

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

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefruleName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructNameString(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefruleName(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructNameString(%struct.constructHeader* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const);
void td_write_doubles(const double *x) {
  printf("  hi = %21.14e\n", x[0]);
  printf("  mi = %21.14e\n", x[1]);
  printf("  lo = %21.14e\n", x[2]);
}


x86 assembly (clang, -O0):
<td_write_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_write_doubles>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
lea    0xedf(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c" hi = %21.14e\0A\00"
@.str.1 = [16 x i8] c" mi = %21.14e\0A\00"
@.str.2 = [16 x i8] c" lo = %21.14e\0A\00"
define void @td_write_doubles(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = load double, double* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %9)
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 2
%13 = load double, double* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %13)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c" hi = %21.14e\0A\00"
@.str.1 = [16 x i8] c" mi = %21.14e\0A\00"
@.str.2 = [16 x i8] c" lo = %21.14e\0A\00"
define void @td_write_doubles(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %8)
ret void
}
/* Variables and functions */
scalar_t__ write_com_4bit(int);
void lcd_shift() {
  write_com_4bit(0x0004 | 0x0002 | 0x0001);
  while (write_com_4bit(0x0100) != 0)
    ;
}


x86 assembly (clang, -O0):
<lcd_shift>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <write_com_4bit@plt>
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
cmp    $0x0,%rax
je     1137 <lcd_shift+0x27>
jmp    111e <lcd_shift+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_shift>:
push   %rax
mov    $0x7,%edi
call   1030 <write_com_4bit@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
test   %rax,%rax
jne    1120 <lcd_shift+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @lcd_shift() {
%1 = call i64 @write_com_4bit(i32 7)
br label %2
2: ; preds = %5, %0
%3 = call i64 @write_com_4bit(i32 256)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @lcd_shift() {
%1 = tail call i64 @write_com_4bit(i32 7)
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @write_com_4bit(i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
int __attribute__((visibility("default"))) shlibfunc2(void) { return 24; }


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

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

LLVM IR (-O0):
define i32 @shlibfunc2() {
ret i32 24
}

LLVM IR (-O2):
define i32 @shlibfunc2() {
ret i32 24
}
/* Variables and functions */
int /*<<< orphan*/ splitpath(char *, char *, char *);
char *basename(char *path) {
  static char bname[30];
  static char dname[256];
  splitpath(path, dname, bname);
  return (char *)bname;
}


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

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

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

LLVM IR (-O2):
@basename.bname = internal global [30 x i8] zeroinitializer
@basename.dname = internal global [256 x i8] zeroinitializer
define i8* @basename(i8* %0) {
%2 = tail call i32 @splitpath(i8* %0, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @basename.dname, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @basename.bname, i64 0, i64 0))
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @basename.bname, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ eq(char const *, char *);
int /*<<< orphan*/ usg();
void help(int c, const char **a) {
  if (c > 1 && eq(a[1], "-h"))
    usg();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    115e <help+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <eq@plt>
cmp    $0x0,%rax
je     115e <help+0x3e>
mov    $0x0,%al
call   1030 <usg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
cmp    $0x2,%edi
jl     1147 <help+0x27>
push   %rax
mov    0x8(%rsi),%rdi
lea    0xecf(%rip),%rsi
call   1040 <eq@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     1147 <help+0x27>
xor    %eax,%eax
jmp    1030 <usg@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
define void @help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @eq(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @usg()
br label %15
15: ; preds = %13, %7, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
define void @help(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @eq(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @usg()
br label %11
11: ; preds = %9, %4, %2
ret void
}
void ff_hevc_put_hevc_uni_w_epel_h8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info_start() {
  printf("\n Execute one from the following list of commands. \n");
  printf("	vfs create <file_system_name> \n 	vfs open "
         "<file_system_name/file_system_path> \n 	vfs save "
         "<file_name_to_be_saved> \n 	vfs close  \n 	vfs extract "
         "<file_name_to_be_extracted> \n 	vfs status \n 	quit \n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"\0A Execute one from the following list of commands. \0A\00"
@.str.1 = [196 x i8] c"\09vfs create <file_system_name> \0A \09vfs open <file_system_name/file_system_path> \0A \09vfs save <file_name_to_be_saved> \0A \09vfs close \0A \09vfs extract <file_name_to_be_extracted> \0A \09vfs status \0A \09quit \0A\00"
define void @info_start() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"\0A Execute one from the following list of commands. \00"
@str.2 = [195 x i8] c"\09vfs create <file_system_name> \0A \09vfs open <file_system_name/file_system_path> \0A \09vfs save <file_name_to_be_saved> \0A \09vfs close \0A \09vfs extract <file_name_to_be_extracted> \0A \09vfs status \0A \09quit \00"
define void @info_start() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @str.2, i64 0, i64 0))
ret void
}
int test_imm_84uint8_mem(unsigned char *val) {
  return ((*val) & (-0x84 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_84uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff7c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_84uint8_mem>:
testb  $0x7c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_84uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 124
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int e = 1;
  foo(&e);
#pragma omp taskwait
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ bl_time_extras_test();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int failed = 0;
  if (bl_time_extras_test() != 0) {
    ++failed;
  }
  printf("\n[SUITE ERR ] %d suite(s)\n", failed);
  return failed;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bl_time_extras_test@plt>
cmp    $0x0,%rax
je     1150 <main+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <bl_time_extras_test@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A[SUITE ERR ] %d suite(s)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 (...) @bl_time_extras_test()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %0
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A[SUITE ERR ] %d suite(s)\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @bl_time_extras_test()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
void do_nasty(char *ptr) { ptr[10] = 'n'; }


x86 assembly (clang, -O0):
<do_nasty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x6e,0xa(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_nasty>:
movb   $0x6e,0xa(%rdi)
ret

LLVM IR (-O0):
define void @do_nasty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 10
store i8 110, i8* %4
ret void
}

LLVM IR (-O2):
define void @do_nasty(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 10
store i8 110, i8* %2
ret void
}