xunge/DecIR huggingface dataset:
int fn3(int x, int y) {
  int tem1 = x | y;
  int tem2 = ~(y & x);
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int otp_AWB_LSC_light_source_copy(unsigned char const *, unsigned char *,
                                  int *);
int otp_AWB_LSC_light_copy(const unsigned char *ov8865_data_ptr,
                           const int ov8865_size, unsigned char *otp_data_ptr,
                           int *otp_size) {
  int ret = 0;
  ret = otp_AWB_LSC_light_source_copy(ov8865_data_ptr, otp_data_ptr, otp_size);
  if (ret)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<otp_AWB_LSC_light_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <otp_AWB_LSC_light_source_copy@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1158 <otp_AWB_LSC_light_copy+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <otp_AWB_LSC_light_copy+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otp_AWB_LSC_light_copy>:
push   %rax
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <otp_AWB_LSC_light_source_copy@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @otp_AWB_LSC_light_copy(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @otp_AWB_LSC_light_source_copy(i8* %0, i8* %2, i32* %3)
%6 = icmp ne i32 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
int au_br_whable(int brperm) { return brperm & (1 | (1 << 12)); }


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

x86 assembly (clang, -O2):
<au_br_whable>:
mov    %edi,%eax
and    $0x1001,%eax
ret

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

LLVM IR (-O2):
define i32 @au_br_whable(i32 %0) {
%2 = and i32 %0, 4097
ret i32 %2
}
/* Variables and functions */
int nextquadlabel();
int /*<<< orphan*/ printf(char *);
int handle_boolean_M() {
  printf("boolean_M -> empty\n");
  return nextquadlabel();
}


x86 assembly (clang, -O0):
<handle_boolean_M>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <nextquadlabel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_boolean_M>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <nextquadlabel@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"boolean_M -> empty\0A\00"
define i32 @handle_boolean_M() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @nextquadlabel()
ret i32 %2
}

LLVM IR (-O2):
@str = [19 x i8] c"boolean_M -> empty\00"
define i32 @handle_boolean_M() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @nextquadlabel()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
int __syscall_error(void) {
  register int err_no asm("%r8");
  __set_errno(err_no);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__syscall_error() {
%1 = tail call i32 @__set_errno(i32 undef)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print(char *Msg) {
  int i;
  for (i = 0; i < 4; ++i) {
    printf("%c", Msg[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1153 <print+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xec4(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%esi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x1(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x2(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x3(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ _atomic_add_u32(int /*<<< orphan*/ *, int /*<<< orphan*/);
void _atomic_add_s32(int32_t *ptr, int32_t value) {
  _atomic_add_u32((uint32_t *)ptr, value);
}


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

x86 assembly (clang, -O2):
<_atomic_add_s32>:
jmp    1030 <_atomic_add_u32@plt>

LLVM IR (-O0):
define void @_atomic_add_s32(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 @_atomic_add_u32(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @_atomic_add_s32(i32* %0, i32 %1) {
%3 = tail call i32 @_atomic_add_u32(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlg_exiterr(char *, char const *);
void Usage(const char *msg) {
  dlg_exiterr("Error: %s.\nUse --help to list options.\n\n", msg);
}


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

x86 assembly (clang, -O2):
<Usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <dlg_exiterr@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Error: %s.\0AUse --help to list options.\0A\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dlg_exiterr(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Error: %s.\0AUse --help to list options.\0A\0A\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @dlg_exiterr(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("\nreadline started\n\n");
  int i;
  char line[81];
  void readLine(char buffer[]);
  readLine(line);
  printf("%s\n\n", line);
  printf("\nreadline ended\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <readLine@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%s\0A\0A\00"
@str = [19 x i8] c"\0Areadline started\0A\00"
@str.3 = [17 x i8] c"\0Areadline ended\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void RTFileGetMaxSizeEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileGetMaxSizeEx() {
ret void
}
const char *mg_version(void) { return "3.6"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"3.6\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int atoi(char const *);
short int CShortChars(const char *Src) {
  int ret = atoi(Src);
  return (short int)ret;
}


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

x86 assembly (clang, -O2):
<CShortChars>:
push   %rax
call   1030 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @CShortChars(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @CShortChars(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void err_handler(int sig) {
  write(STDERR_FILENO, "Critical error! Now exiting...\n", 31);
  _exit(sig);
}


x86 assembly (clang, -O0):
<err_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x1f,%edx
call   1040 <write@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<err_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    $0x1f,%edx
call   1040 <write@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
@.str = [32 x i8] c"Critical error! Now exiting...\0A\00"
define void @err_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @STDERR_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 31)
%5 = load i32, i32* %2
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
@.str = [32 x i8] c"Critical error! Now exiting...\0A\00"
define void @err_handler(i32 %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 31)
%4 = tail call i32 @_exit(i32 %0)
unreachable
}
unsigned long __mp_libversion(void) { return 10501; }


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

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

LLVM IR (-O0):
define i64 @__mp_libversion() {
ret i64 10501
}

LLVM IR (-O2):
define i64 @__mp_libversion() {
ret i64 10501
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int __int8_t_encode_array(void *_buf, int offset, int maxlen, const int8_t *p,
                          int elements) {
  if (maxlen < elements)
    return -1;
  int8_t *buf = (int8_t *)_buf;
  memcpy(&buf[offset], p, elements);
  return elements;
}


x86 assembly (clang, -O0):
<__int8_t_encode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1142 <__int8_t_encode_array+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <__int8_t_encode_array+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int8_t_encode_array>:
mov    $0xffffffff,%eax
cmp    %r8d,%edx
jl     1133 <__int8_t_encode_array+0x23>
push   %rbx
mov    %r8d,%ebx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__int8_t_encode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = icmp slt i32 %2, %4
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to i32*
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = tail call i32 @memcpy(i32* %10, i32* %3, i32 %4)
br label %12
12: ; preds = %5, %7
%13 = phi i32 [ %4, %7 ], [ -1, %5 ]
ret i32 %13
}
void dfn_acc(_Complex char c) {}


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

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

LLVM IR (-O0):
define void @dfn_acc(i16 %0) {
%2 = alloca { i8, i8 }
%3 = bitcast { i8, i8 }* %2 to i16*
store i16 %0, i16* %3
ret void
}

LLVM IR (-O2):
define void @dfn_acc(i16 %0) {
ret void
}
/* Variables and functions */
float __ocml_sub_rte_f32(float, float);
float __fsub_rn(float x, float y) { return __ocml_sub_rte_f32(x, y); }


x86 assembly (clang, -O0):
<__fsub_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__ocml_sub_rte_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fsub_rn>:
jmp    1030 <__ocml_sub_rte_f32@plt>

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

LLVM IR (-O2):
define float @__fsub_rn(float %0, float %1) {
%3 = tail call float @__ocml_sub_rte_f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int intnumber;
  float floatnumber = 9.75;
  intnumber = (int)floatnumber;
  printf("%i\n", intnumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 9.750000e+00, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _sort(void **, int /*<<< orphan*/, size_t,
                         int (*)(void *, void *));
int /*<<< orphan*/ shuffle(void **, size_t);
void quick_sort1(void **a, size_t n, int (*comp)(void *, void *)) {
  shuffle(a, n);
  _sort(a, 0, n - 1, comp);
}


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

x86 assembly (clang, -O2):
<quick_sort1>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <shuffle@plt>
add    $0xffffffffffffffff,%rbx
mov    %r15,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <_sort@plt>

LLVM IR (-O0):
define void @quick_sort1(i8** %0, i64 %1, i32 (i8*, i8*)* %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i32 (i8*, i8*)*
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %6
%7 = load i8**, i8*** %4
%8 = load i64, i64* %5
%9 = call i32 @shuffle(i8** %7, i64 %8)
%10 = load i8**, i8*** %4
%11 = load i64, i64* %5
%12 = sub i64 %11, 1
%13 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%14 = call i32 @_sort(i8** %10, i32 0, i64 %12, i32 (i8*, i8*)* %13)
ret void
}

LLVM IR (-O2):
define void @quick_sort1(i8** %0, i64 %1, i32 (i8*, i8*)* %2) {
%4 = tail call i32 @shuffle(i8** %0, i64 %1)
%5 = add i64 %1, -1
%6 = tail call i32 @_sort(i8** %0, i32 0, i64 %5, i32 (i8*, i8*)* %2)
ret void
}
int g(int n, int i) {
  int s = 0;
  for (i = 0; i < n; i++)
    s += i;
  return s;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113b <g+0x3b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <g+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   %edi,%edi
jle    1118 <g+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @g(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
store i32 0, i32* %4
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, %11
store i32 %13, i32* %5
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %11, %0
%13 = add i32 %12, -1
br label %14
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %13, %4 ]
ret i32 %15
}
/* Variables and functions */
double _exp2(double);
double exp2(double vx) { return _exp2(vx); }


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

x86 assembly (clang, -O2):
<exp2>:
jmp    1030 <_exp2@plt>

LLVM IR (-O0):
define double @exp2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_exp2(double %3)
ret double %4
}

LLVM IR (-O2):
define double @exp2(double %0) {
%2 = tail call double @_exp2(double %0)
ret double %2
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int16_t setBit_fun_int16_t(int16_t x, uint32_t i) { return x | 1 << i; }


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

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

LLVM IR (-O0):
define i32 @setBit_fun_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setBit_fun_int16_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
long fortran_strpbrk_core(char const *, char const *);
long fortran_strpbrk_core_(const char *sz, const char *charset) {
  return fortran_strpbrk_core(sz, charset);
}


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

x86 assembly (clang, -O2):
<fortran_strpbrk_core_>:
jmp    1030 <fortran_strpbrk_core@plt>

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

LLVM IR (-O2):
define i64 @fortran_strpbrk_core_(i8* %0, i8* %1) {
%3 = tail call i64 @fortran_strpbrk_core(i8* %0, i8* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *sw(int);
int main() {
  int x = 5, y = 7;
  printf("sw(%d) = %s\n", x, sw(x));
  printf("sw(%d) = %s\n", y, sw(y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sw@plt>
mov    -0x14(%rbp),%esi
mov    %rax,%rdx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <sw@plt>
mov    -0x10(%rbp),%esi
mov    %rax,%rdx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <sw@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <sw@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"sw(%d) = %s\0A\00"
define i32 @main() {
%1 = tail call i8* @sw(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 5, i8* %1)
%3 = tail call i8* @sw(i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 7, i8* %3)
ret i32 0
}
void EC_POINT_method_of(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_method_of() {
ret void
}
float Pow4(float v) { return v * v * v * v; }


x86 assembly (clang, -O0):
<Pow4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pow4>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Pow4(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = fmul float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @Pow4(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fmul float %3, %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
short read_lsb_short(FILE *f) {
  unsigned char buf[2];
  fread(buf, 2, 1, f);
  return (buf[1] << 8) | (buf[0]);
}


x86 assembly (clang, -O0):
<read_lsb_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl -0x9(%rbp),%eax
shl    $0x8,%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lsb_short>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @read_lsb_short(i32* %0) {
%2 = alloca i32*
%3 = alloca [2 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 2, i32 1, i32* %5)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @read_lsb_short(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 2, i32 1, i32* %0)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = load i8, i8* %3
%10 = zext i8 %9 to i16
%11 = or i16 %8, %10
ret i16 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void testElemRegion1() {
  char *x = (void *)malloc(2);
  int *ix = (int *)x;
  free(&(x[0]));
}


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

x86 assembly (clang, -O2):
<testElemRegion1>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testElemRegion1() {
%1 = alloca i8*
%2 = alloca i32*
%3 = call i64 @malloc(i32 2)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %2
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @testElemRegion1() {
%1 = tail call i64 @malloc(i32 2)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int liczba = 80;
  printf("Wartość zmiennej liczba: %d\n", liczba);
  printf("Adres zmiennej liczba: %p\n", &liczba);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x50,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0x50,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Warto\C5\9B\C4\87 zmiennej liczba: %d\0A\00"
@.str.1 = [27 x i8] c"Adres zmiennej liczba: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 80, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Warto\C5\9B\C4\87 zmiennej liczba: %d\0A\00"
@.str.1 = [27 x i8] c"Adres zmiennej liczba: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 80, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_irq4(void) { print("IRQ 4"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"IRQ 4\00"
define void @idt_irq4() {
%1 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"IRQ 4\00"
define void @idt_irq4() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/"
             "LibFontConfig/src/fc-match/.libs/lt-fc-match.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf51(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf6c(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-match/.libs/lt-fc-match.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibFontConfig/src/fc-match/.libs/lt-fc-match.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
void wifi_rsp_endpoint_set_streaming_destination(
    const struct wifi_msg_endpoint_set_streaming_destination_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_endpoint_set_streaming_destination_rsp_t = type opaque
define void @wifi_rsp_endpoint_set_streaming_destination(%struct.wifi_msg_endpoint_set_streaming_destination_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fsync(int fd) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fsync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fsync(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fsync(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
double busywork(int count) {
  int i;
  double sum = 0.0012;
  for (i = 0; i < count; i++) {
    sum += 0.01;
  }
  return sum;
}


x86 assembly (clang, -O0):
<busywork>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1147 <busywork+0x47>
movsd  0xed9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <busywork+0x1b>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<busywork>:
test   %edi,%edi
jle    111b <busywork+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <busywork+0x24>
movsd  0xee7(%rip),%xmm0
jmp    1165 <busywork+0x65>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm0
movsd  0xed1(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0xfffffff8,%edi
jne    1140 <busywork+0x40>
test   %eax,%eax
je     1189 <busywork+0x89>
movsd  0xe97(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
add    $0xffffffff,%eax
jne    1180 <busywork+0x80>
ret

LLVM IR (-O0):
define double @busywork(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
store double 1.200000e-03, double* %4
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load double, double* %4
%11 = fadd double %10, 1.000000e-02
store double %11, double* %4
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
define double @busywork(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %32
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %22, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi double [ 1.200000e-03, %7 ], [ %19, %9 ]
%11 = phi i32 [ 0, %7 ], [ %20, %9 ]
%12 = fadd double %10, 1.000000e-02
%13 = fadd double %12, 1.000000e-02
%14 = fadd double %13, 1.000000e-02
%15 = fadd double %14, 1.000000e-02
%16 = fadd double %15, 1.000000e-02
%17 = fadd double %16, 1.000000e-02
%18 = fadd double %17, 1.000000e-02
%19 = fadd double %18, 1.000000e-02
%20 = add i32 %11, 8
%21 = icmp eq i32 %20, %8
br i1 %21, label %22, label %9
22: ; preds = %9, %3
%23 = phi double [ undef, %3 ], [ %19, %9 ]
%24 = phi double [ 1.200000e-03, %3 ], [ %19, %9 ]
%25 = icmp eq i32 %5, 0
br i1 %25, label %32, label %26
26: ; preds = %22, %26
%27 = phi double [ %29, %26 ], [ %24, %22 ]
%28 = phi i32 [ %30, %26 ], [ 0, %22 ]
%29 = fadd double %27, 1.000000e-02
%30 = add i32 %28, 1
%31 = icmp eq i32 %30, %5
br i1 %31, label %32, label %26
32: ; preds = %22, %26, %1
%33 = phi double [ 1.200000e-03, %1 ], [ %23, %22 ], [ %29, %26 ]
ret double %33
}
int execute_capset() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_capset() {
ret i32 0
}
void RAND_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @RAND_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HitOrStand() { printf("Do you (h)it or (s)tand?\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Do you (h)it or (s)tand?\0A\00"
define void @HitOrStand() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Do you (h)it or (s)tand?\00"
define void @HitOrStand() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 10;
  int b = 20;
  int c = a + b;
  printf("%d + %d = %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 30)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ constChars(char *);
int main(void) {
  char a[10] = {'b', 'c', 'd', 'e', 'f', 'f', 'f', 'f', 'f', 'f'};
  constChars(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <constChars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6666666665646362,%rax
66 66 66
mov    %rax,0x8(%rsp)
movw   $0x6666,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <constChars@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"bcdeffffff"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @constChars(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i8] c"bcdeffffff"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @constChars(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_prompt(void) { printf(">>> "); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c">>> \00"
define void @print_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
void uninitvar_strlen(void) {
  char *s;
  (void)strlen(s);
}


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

x86 assembly (clang, -O2):
<uninitvar_strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define void @uninitvar_strlen() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @strlen(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strlen() {
%1 = tail call i32 @strlen(i8* undef)
ret void
}