xunge/DecIR huggingface dataset:
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) struct vec3i *psvec3i(struct vec3i *result, int32_t x,
                                               int32_t y, int32_t z) {
  vec3i((int32_t *)result, x, y, z);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <vec3i@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i(%struct.vec3i* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.vec3i*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.vec3i* %0, %struct.vec3i** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @vec3i(i32* %10, i32 %11, i32 %12, i32 %13)
%15 = load %struct.vec3i*, %struct.vec3i** %5
ret %struct.vec3i* %15
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i(%struct.vec3i* returned %0, i32 %1, i32 %2, i32 %3) {
%5 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%6 = tail call i32 @vec3i(i32* %5, i32 %1, i32 %2, i32 %3)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int next_prime(int n) {
  do {
    n++;
  } while (!is_prime(n));
  return n;
}


x86 assembly (clang, -O0):
<next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111b <next_prime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_prime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     1120 <next_prime+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @next_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = tail call i32 @is_prime(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llroundf(float x) { return __infer_nondet_long_long_int(); }


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

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

LLVM IR (-O0):
define i64 @llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llroundf(float %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
/* Variables and functions */
unsigned char *hmac_ripemd256(unsigned char *, unsigned char const *, size_t,
                              unsigned char const *, size_t);
unsigned char *mac_hmac_ripemd256(unsigned char *out, const unsigned char *key,
                                  size_t key_len, const unsigned char *msg,
                                  size_t msg_len) {
  return hmac_ripemd256(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_ripemd256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_ripemd256@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_ripemd256>:
jmp    1030 <hmac_ripemd256@plt>

LLVM IR (-O0):
define i8* @mac_hmac_ripemd256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_ripemd256(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_ripemd256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_ripemd256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void EraseLnToCur() { WRITETEST("\033[1K"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1K\00"
define void @EraseLnToCur() {
%1 = call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1K\00"
define void @EraseLnToCur() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(intptr_t, void const *, size_t);
ssize_t vmir_sysio_write(void *opaque, intptr_t fh, const void *buf,
                         size_t count) {
  return write(fh, buf, count);
}


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

x86 assembly (clang, -O2):
<vmir_sysio_write>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @vmir_sysio_write(i8* nocapture readnone %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i32 @write(i64 %1, i8* %2, i64 %3)
ret i32 %5
}
char *quota_utf8_to_mbcs(const char *zUtf8) { return (char *)zUtf8; }


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

x86 assembly (clang, -O2):
<quota_utf8_to_mbcs>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @quota_utf8_to_mbcs(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void ReadBinaryTxt() {
  printf("\nInside the file is possible to find: \n");
  system("cat Binary.txt");
}


x86 assembly (clang, -O0):
<ReadBinaryTxt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadBinaryTxt>:
push   %rax
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AInside the file is possible to find: \0A\00"
@.str.1 = [15 x i8] c"cat Binary.txt\00"
define void @ReadBinaryTxt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"cat Binary.txt\00"
@str = [39 x i8] c"\0AInside the file is possible to find: \00"
define void @ReadBinaryTxt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_file(char *);
int /*<<< orphan*/ show_file_re(char *, char const *);
void show_functions(const char *funcre) {
  if (funcre)
    show_file_re("available_filter_functions", funcre);
  else
    show_file("available_filter_functions");
}


x86 assembly (clang, -O0):
<show_functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <show_functions+0x2c>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <show_file_re@plt>
jmp    1158 <show_functions+0x38>
lea    0xead(%rip),%rdi
call   1040 <show_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_functions>:
test   %rdi,%rdi
je     1134 <show_functions+0x14>
mov    %rdi,%rsi
lea    0xed1(%rip),%rdi
jmp    1030 <show_file_re@plt>
lea    0xec5(%rip),%rdi
jmp    1040 <show_file@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"available_filter_functions\00"
define void @show_functions(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @show_file_re(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @show_file(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct pcibx_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcibx_write(struct pcibx_device *, int, int);
int /*<<< orphan*/ prsendinfo(char *);
void pcibx_cmd_ramp(struct pcibx_device *dev, int fast) {
  prsendinfo("+5V RAMP");
  pcibx_write(dev, 0x7C, fast ? 1 : 0);
}


x86 assembly (clang, -O0):
<pcibx_cmd_ramp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <prsendinfo@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    $0x7c,%esi
call   1030 <pcibx_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibx_cmd_ramp>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xed0(%rip),%rdi
call   1040 <prsendinfo@plt>
xor    %edx,%edx
test   %ebx,%ebx
setne  %dl
mov    %r14,%rdi
mov    $0x7c,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pcibx_write@plt>

LLVM IR (-O0):
%struct.pcibx_device = type { i32 }
@.str = [9 x i8] c"+5V RAMP\00"
define void @pcibx_cmd_ramp(%struct.pcibx_device* %0, i32 %1) {
%3 = alloca %struct.pcibx_device*
%4 = alloca i32
store %struct.pcibx_device* %0, %struct.pcibx_device** %3
store i32 %1, i32* %4
%5 = call i32 @prsendinfo(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.pcibx_device*, %struct.pcibx_device** %3
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = call i32 @pcibx_write(%struct.pcibx_device* %6, i32 124, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.pcibx_device = type { i32 }
@.str = [9 x i8] c"+5V RAMP\00"
define void @pcibx_cmd_ramp(%struct.pcibx_device* %0, i32 %1) {
%3 = tail call i32 @prsendinfo(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @pcibx_write(%struct.pcibx_device* %0, i32 124, i32 %5)
ret void
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned HUF_isError(size_t code) { return ERR_isError(code); }


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

x86 assembly (clang, -O2):
<HUF_isError>:
jmp    1030 <ERR_isError@plt>

LLVM IR (-O0):
define i32 @HUF_isError(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @ERR_isError(i64 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @HUF_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
char *get_string(char p) {
  switch (p) {
  case 'r':
    return "rock";
  case 'p':
    return "paper";
  case 's':
    return "scissors";
  }
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x70,%eax
je     1151 <get_string+0x51>
jmp    111f <get_string+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x72,%eax
je     1141 <get_string+0x41>
jmp    1130 <get_string+0x30>
mov    -0x10(%rbp),%eax
sub    $0x73,%eax
je     1161 <get_string+0x61>
jmp    116c <get_string+0x6c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <get_string+0x6c>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <get_string+0x6c>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
cmp    $0x70,%dil
lea    0xefa(%rip),%rax
lea    0xeee(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x73,%dil
lea    0xeea(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"rock\00"
@.str.1 = [6 x i8] c"paper\00"
@.str.2 = [9 x i8] c"scissors\00"
define i8* @get_string(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 114, label %6
i32 112, label %7
i32 115, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %6, %7, %8, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"rock\00"
@.str.1 = [6 x i8] c"paper\00"
@.str.2 = [9 x i8] c"scissors\00"
define i8* @get_string(i8 signext %0) {
%2 = icmp eq i8 %0, 112
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = icmp eq i8 %0, 115
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %3
ret i8* %5
}
int main() {
  int *a;
  int *__attribute__((type_annotate("nullable"))) b;
  a = 0;
  b = 0;
  a = b;
  b = a;
  *a = 1;
  *b = 1;
  int *__attribute__((type_annotate("nullable"))) * c;
  int **__attribute__((type_annotate("nullable"))) d;
  c = 0;
  d = 0;
  *c = 0;
  *d = 0;
  typedef int *__attribute__((type_annotate("nullable"))) nip;
  nip e;
  e = 0;
  b = e;
  a = e;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i32**
%6 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
store i32* null, i32** %3
%7 = load i32*, i32** %3
store i32* %7, i32** %2
%8 = load i32*, i32** %2
store i32* %8, i32** %3
%9 = load i32*, i32** %2
store i32 1, i32* %9
%10 = load i32*, i32** %3
store i32 1, i32* %10
store i32** null, i32*** %4
store i32** null, i32*** %5
%11 = load i32**, i32*** %4
store i32* null, i32** %11
%12 = load i32**, i32*** %5
store i32* null, i32** %12
store i32* null, i32** %6
%13 = load i32*, i32** %6
store i32* %13, i32** %3
%14 = load i32*, i32** %6
store i32* %14, i32** %2
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
unsigned long cpufreq_get_freq_hardware(unsigned int);
unsigned long cpufreq_get_freq_kernel(unsigned int);
void test_cpu(unsigned int cpuid) {
  unsigned long scaling_cur_freq = cpufreq_get_freq_kernel(cpuid);
  unsigned long cpuinfo_cur_freq = cpufreq_get_freq_hardware(cpuid);
}


x86 assembly (clang, -O0):
<test_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cpufreq_get_freq_kernel@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cpufreq_get_freq_hardware@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cpu>:
push   %rbx
mov    %edi,%ebx
call   1030 <cpufreq_get_freq_kernel@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <cpufreq_get_freq_hardware@plt>

LLVM IR (-O0):
define void @test_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64 @cpufreq_get_freq_kernel(i32 %5)
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = call i64 @cpufreq_get_freq_hardware(i32 %7)
store i64 %8, i64* %4
ret void
}

LLVM IR (-O2):
define void @test_cpu(i32 %0) {
%2 = tail call i64 @cpufreq_get_freq_kernel(i32 %0)
%3 = tail call i64 @cpufreq_get_freq_hardware(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *nums, int size) {
  int i;
  for (i = 0; i < size; ++i) {
    printf("%d ", *(nums + i));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void __getsec_smctrl(void) {
  __asm__ __volatile__("xchgl %%ebx, %%edx;"
                       ".byte 0x0f,0x37"
                       "\n"
                       "xchgl %%ebx, %%edx;"
                       :
                       : "a"(7), "d"(0x0));
}


x86 assembly (clang, -O0):
<__getsec_smctrl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%eax
xor    %edx,%edx
xchg   %edx,%ebx
getsec
xchg   %edx,%ebx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getsec_smctrl>:
mov    $0x7,%eax
xor    %edx,%edx
xchg   %edx,%ebx
getsec
xchg   %edx,%ebx
ret

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

LLVM IR (-O2):
define void @__getsec_smctrl() {
tail call void asm sideeffect "xchgl %ebx, %edx;.byte 0x0f,0x37\0Axchgl %ebx, %edx;", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 7, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *memptr) {
  if (*(void **)memptr) {
    free(*(void **)memptr);
    *(void **)memptr = NULL;
  }
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <mem_free+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <mem_free+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CSlaveDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000804))) = 0;
  (*((volatile unsigned long *)(ui32Base + 0x00000020))) &= ~(0x00000020);
}


x86 assembly (clang, -O0):
<I2CSlaveDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x804(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDisable>:
movq   $0x0,0x804(%rdi)
andq   $0xffffffffffffffdf,0x20(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 2052
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -33
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDisable(i64 %0) {
%2 = add nsw i64 %0, 2052
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
%4 = add nsw i64 %0, 32
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -33
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  void insert(char[]);
  char str[80];
  printf("input four digits:\n");
  scanf("%s", str);
  insert(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <insert@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <insert@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"input four digits:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [19 x i8] c"input four digits:\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buff;

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void addmem(int block_size, int block_cnt) {
  char *buff = NULL;
  int i = 0;
  for (; i < block_cnt; ++i) {
    buff = (char *)malloc(block_size);
    memset(buff, 0, sizeof(buff));
  }
}


x86 assembly (clang, -O0):
<addmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1173 <addmem+0x53>
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <addmem+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addmem>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    114b <addmem+0x2b>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
add    $0xffffffff,%ebx
jne    1130 <addmem+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @addmem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @memset(i8* %15, i32 0, i32 8)
br label %17
17: ; preds = %11
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @addmem(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = tail call i64 @malloc(i32 %0)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memset(i8* %7, i32 0, i32 8)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) {}


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

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

LLVM IR (-O0):
%struct.mlx5e_priv = type opaque
define void @mlx5e_dcbnl_initialize(%struct.mlx5e_priv* %0) {
%2 = alloca %struct.mlx5e_priv*
store %struct.mlx5e_priv* %0, %struct.mlx5e_priv** %2
ret void
}

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define void @mlx5e_dcbnl_initialize(%struct.mlx5e_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ v4l2_open(char const *, int, int);
int v4l2_open_swift(const char *file, int oflag, int arg2) {
  v4l2_open(file, oflag, arg2);
}


x86 assembly (clang, -O0):
<v4l2_open_swift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <v4l2_open@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l2_open_swift>:
jmp    1030 <v4l2_open@plt>

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

LLVM IR (-O2):
define i32 @v4l2_open_swift(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @v4l2_open(i8* %0, i32 %1, i32 %2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_personalstart(FILE *outptr, int level) {
  int j;
  for (j = 0; j <= level; ++j)
    fprintf(outptr, "    ");
  fprintf(outptr, "<name type=\"personal\">\n");
}


x86 assembly (clang, -O0):
<output_personalstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1150 <output_personalstart+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output_personalstart+0x16>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_personalstart>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
js     114a <output_personalstart+0x3a>
mov    %esi,%ebp
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1130 <output_personalstart+0x20>
lea    0xeb4(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" \00"
@.str.1 = [24 x i8] c"<name type=\22personal\22>\0A\00"
define void @output_personalstart(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i32*, i32** %3
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
@.str.1 = [24 x i8] c"<name type=\22personal\22>\0A\00"
define void @output_personalstart(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 23, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_get_blocks(int session, int *val) {
  return (ap_cmd_get_int(session, 0xcc17, val));
}


x86 assembly (clang, -O0):
<ap_get_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc17,%esi
call   1030 <ap_cmd_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_blocks>:
mov    %rsi,%rdx
mov    $0xcc17,%esi
jmp    1030 <ap_cmd_get_int@plt>

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

LLVM IR (-O2):
define i32 @ap_get_blocks(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52247, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int /*<<< orphan*/ scanf(char *, int *);
void method2() {
  union {
    float floatValue;
    int intValue;
  } floatNum;
  scanf("%f", &floatNum.intValue);
  compute(floatNum.intValue);
}


x86 assembly (clang, -O0):
<method2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <compute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<method2>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
mov    (%rsp),%edi
call   1040 <compute@plt>
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
@.str = [3 x i8] c"%f\00"
define void @method2() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = bitcast %union.anon* %1 to i32*
%5 = load i32, i32* %4
%6 = call i32 @compute(i32 %5)
ret void
}

LLVM IR (-O2):
%union.anon = type { float }
@.str = [3 x i8] c"%f\00"
define void @method2() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to i32*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = call i32 @compute(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int a[12] = {1, 3, 5, 4, 7, 2, 99, 16, 45, 67, 89, 45};
  int i;
  int total = 0;
  float avg;
  for (i = 0; i < 12; ++i) {
    total += a[i];
  }
  avg = (float)total / 12;
  printf("Average of array element values is %f\n", avg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    1178 <main+0x58>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1152 <main+0x32>
cvtsi2ssl -0x48(%rbp),%xmm0
movss  0xe7b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [12 x i32] [i32 1, i32 3, i32 5, i32 4, i32 7, i32 2, i32 99, i32 16, i32 45, i32 67, i32 89, i32 45]
@.str = [39 x i8] c"Average of array element values is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = bitcast [12 x i32]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 12
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %4
%22 = sitofp i32 %21 to float
%23 = fdiv float %22, 1.200000e+01
store float %23, float* %5
%24 = load float, float* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Average of array element values is %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float 0x403FEAAAA0000000)
ret i32 0
}
/* Variables and functions */
int getfileinfo(char *, int *);
int fileutils___getfileinfo(char *filename, int *i) {
  return (getfileinfo(filename, i));
}


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

x86 assembly (clang, -O2):
<fileutils___getfileinfo>:
jmp    1030 <getfileinfo@plt>

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

LLVM IR (-O2):
define i32 @fileutils___getfileinfo(i8* %0, i32* %1) {
%3 = tail call i32 @getfileinfo(i8* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_is_sorted(int /*<<< orphan*/ const *);
int sk_OPENSSL_CSTRING_is_sorted(const struct stack_st_OPENSSL_CSTRING *sk) {
  return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_is_sorted>:
jmp    1030 <OPENSSL_sk_is_sorted@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_is_sorted(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_is_sorted(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_is_sorted(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_is_sorted(i32* %2)
ret i32 %3
}
int test_imm_F0int64_lowword_mem(long long *val) {
  return ((*val) & (0xF0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F0int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_awk_double_slash() {
  test_parser_verify_parse(test_parser_sourcefile("awk", "\"\\\\\"\n#comment"),
                           "awk", "\"\\\\\"\n", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_awk_double_slash>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_awk_double_slash>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed4(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"awk\00"
@.str.1 = [14 x i8] c"\22\\\\\22\0A#comment\00"
@.str.2 = [6 x i8] c"\22\\\\\22\0A\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_awk_double_slash() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"awk\00"
@.str.1 = [14 x i8] c"\22\\\\\22\0A#comment\00"
@.str.2 = [6 x i8] c"\22\\\\\22\0A\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_awk_double_slash() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
char *strerror(num)
int num;
{
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (num < 0 || num > sys_nerr)
    return "Unknown system error / illegal error number";
  return sys_errlist[num];
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1123 <strerror+0x23>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jle    1133 <strerror+0x33>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
movslq -0xc(%rbp),%rcx
mov    0x2eba(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jl     1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@.str = [44 x i8] c"Unknown system error / illegal error number\00"
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@.str = [44 x i8] c"Unknown system error / illegal error number\00"
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = load i32, i32* @sys_nerr
%4 = icmp slt i32 %3, %0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ set32(int, int);
int /*<<< orphan*/ udelay(int);
void Shutdown(void) {
  udelay(10);
  set32(0x0d8000E0, 1 << 1);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <udelay@plt>
mov    $0xd8000e0,%edi
mov    $0x2,%esi
call   1030 <set32@plt>
jmp    113d <Shutdown+0x1d>

x86 assembly (clang, -O2):
<Shutdown>:
push   %rax
mov    $0xa,%edi
call   1040 <udelay@plt>
mov    $0xd8000e0,%edi
mov    $0x2,%esi
call   1030 <set32@plt>
nopw   0x0(%rax,%rax,1)
jmp    1140 <Shutdown+0x20>

LLVM IR (-O0):
define void @Shutdown() {
%1 = call i32 @udelay(i32 10)
%2 = call i32 @set32(i32 226492640, i32 2)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @Shutdown() {
%1 = tail call i32 @udelay(i32 10)
%2 = tail call i32 @set32(i32 226492640, i32 2)
br label %3
3: ; preds = %0, %3
br label %3
}