xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *path_join_file(char const *, char const *);
int /*<<< orphan*/ remove(char *);
void delete_file(const char *path, const char *filename) {
  char *path_file_name;
  path_file_name = path_join_file(path, filename);
  remove(path_file_name);
  free(path_file_name);
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <path_join_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <remove@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
call   1050 <path_join_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <remove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delete_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @path_join_file(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @delete_file(i8* %0, i8* %1) {
%3 = tail call i8* @path_join_file(i8* %0, i8* %1)
%4 = tail call i32 @remove(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logiccircuitdesignmarkovalgorithm();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world\n");
  logiccircuitdesignmarkovalgorithm();
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @logiccircuitdesignmarkovalgorithm()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @logiccircuitdesignmarkovalgorithm()
ret i32 0
}
/* Variables and functions */
long systemEx(char *, int /*<<< orphan*/);
long system(char *command) {
  long rt;
  rt = systemEx(command, 0);
  return rt;
}


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

x86 assembly (clang, -O2):
<system>:
xor    %esi,%esi
jmp    1030 <systemEx@plt>

LLVM IR (-O0):
define i64 @system(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @systemEx(i8* %4, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @system(i8* %0) {
%2 = tail call i64 @systemEx(i8* %0, i32 0)
ret i64 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float to_real2f(uint32_t v) {
  union {
    float f;
    uint32_t u;
  } x;
  x.u = 0x3f800000 | (v >> 9);
  return x.f - 1.0f;
}


x86 assembly (clang, -O0):
<to_real2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x9,%eax
or     $0x3f800000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xede(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_real2f>:
sar    $0x9,%edi
or     $0x3f800000,%edi
movd   %edi,%xmm0
addss  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @to_real2f(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 9
%6 = or i32 1065353216, %5
%7 = bitcast %union.anon* %3 to i32*
store i32 %6, i32* %7
%8 = bitcast %union.anon* %3 to float*
%9 = load float, float* %8
%10 = fsub float %9, 1.000000e+00
ret float %10
}

LLVM IR (-O2):
define float @to_real2f(i32 %0) {
%2 = ashr i32 %0, 9
%3 = or i32 %2, 1065353216
%4 = bitcast i32 %3 to float
%5 = fadd float %4, -1.000000e+00
ret float %5
}
void InitializeSets(void) {}


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

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

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

LLVM IR (-O2):
define void @InitializeSets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i = 0;
  i = i + 5;
  printf("no debug!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x14(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [11 x i8] c"no debug!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, ...);
int main(int argc, char **argv) {
  printf("decimal number: %d\n", 55);
  printf("floating pointer number: %f\n", 3.1415);
  printf("%.2f %.3f %.4f\n", 3.1415, 4.1415, 5.1415);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xef3(%rip),%rdi
movsd  0xee3(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
movsd  0xeb5(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
movsd  0xe9f(%rip),%xmm0
movsd  0xe9f(%rip),%xmm1
movsd  0xe9f(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
movsd  0xed2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
movsd  0xec4(%rip),%xmm1
movsd  0xec4(%rip),%xmm2
movsd  0xeac(%rip),%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"decimal number: %d\0A\00"
@.str.1 = [29 x i8] c"floating pointer number: %f\0A\00"
@.str.2 = [16 x i8] c"%.2f %.3f %.4f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 5.500000e+01)
%7 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double 3.141500e+00)
%8 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 3.141500e+00, double 4.141500e+00, double 5.141500e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"decimal number: %d\0A\00"
@.str.1 = [29 x i8] c"floating pointer number: %f\0A\00"
@.str.2 = [16 x i8] c"%.2f %.3f %.4f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 5.500000e+01)
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double 3.141500e+00)
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 3.141500e+00, double 4.141500e+00, double 5.141500e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void cleanup_signal_handler(int sig) {
  cleanup();
  signal(sig, SIG_DFL);
  kill(getpid(), sig);
}


x86 assembly (clang, -O0):
<cleanup_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <cleanup@plt>
mov    -0x4(%rbp),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1050 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_signal_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <cleanup@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <kill@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @cleanup_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @kill(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @cleanup_signal_handler(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @kill(i32 %5, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outstr(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void gotoxy(int col, int line) {
  char buf[32];
  sprintf(buf, "\033[%d;%dH", line + 1, col + 1);
  outstr(buf);
}


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <outstr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
push   %rbx
sub    $0x20,%rsp
lea    0x1(%rsi),%edx
lea    0x1(%rdi),%ecx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <outstr@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%13 = call i32 @outstr(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 1
%6 = add nsw i32 %0, 1
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @outstr(i8* %4)
ret void
}
int _mcrypt_get_algo_iv_size() { return 32; }


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

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

LLVM IR (-O0):
define i32 @_mcrypt_get_algo_iv_size() {
ret i32 32
}

LLVM IR (-O2):
define i32 @_mcrypt_get_algo_iv_size() {
ret i32 32
}
int f() {
  int x = 12;
  int y;
  return x + y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0xc,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
store i32 12, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
void EVP_CIPHER_CTX_set_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_set_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ String_Report();
void UI_Report() { String_Report(); }


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

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

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

LLVM IR (-O2):
define void @UI_Report() {
%1 = tail call i32 (...) @String_Report()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions(void) {
  printf("Enter your choice:\n"
         "    1 to insert an element into the list.\n"
         "    2 to delete an element from the list.\n"
         "    3 to end.\n");
}


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

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

LLVM IR (-O0):
@.str = [118 x i8] c"Enter your choice:\0A 1 to insert an element into the list.\0A 2 to delete an element from the list.\0A 3 to end.\0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [117 x i8] c"Enter your choice:\0A 1 to insert an element into the list.\0A 2 to delete an element from the list.\0A 3 to end.\00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void gmi_fail(const char *why) {
  fprintf(stderr, "gmi failed: %s\n", why);
  abort();
}


x86 assembly (clang, -O0):
<gmi_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<gmi_fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"gmi failed: %s\0A\00"
define void @gmi_fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"gmi failed: %s\0A\00"
define void @gmi_fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
short int shortint_ignoring_signedlong(short int x, signed long y) { return x; }


x86 assembly (clang, -O0):
<shortint_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @shortint_ignoring_signedlong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char x, y;
  scanf("%c", &x);
  y = 'z' - (x - 'a');
  printf("%c\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xeac(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
char *SubStrings_Extract(char *, scalar_t__, char const *, char const *,
                         char const *);
scalar_t__ SubStrings_Length(char const *);
char *SubStrings_Between(register char *Dest, const char *After,
                         const char *Before, const char *InStream) {
  return SubStrings_Extract(Dest, SubStrings_Length(InStream) + 1, After,
                            Before, InStream);
}


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

x86 assembly (clang, -O2):
<SubStrings_Between>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
call   1040 <SubStrings_Length@plt>
lea    0x1(%rax),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <SubStrings_Extract@plt>

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

LLVM IR (-O2):
define i8* @SubStrings_Between(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @SubStrings_Length(i8* %3)
%6 = add nsw i64 %5, 1
%7 = tail call i8* @SubStrings_Extract(i8* %0, i64 %6, i8* %1, i8* %2, i8* %3)
ret i8* %7
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strcpy_deep(const char *str) {
  size_t str_len = strlen(str) + 1;
  char *ret = malloc(sizeof(char) * str_len);
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<strcpy_deep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_deep>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcpy_deep(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcpy_deep(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int is_first_in_group_SecAltIDGrp(size_t __tag) {
  return (__tag == (455)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_first_in_group_SecAltIDGrp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1c7,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_SecAltIDGrp>:
xor    %eax,%eax
cmp    $0x1c7,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_SecAltIDGrp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 455
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_SecAltIDGrp(i64 %0) {
%2 = icmp eq i64 %0, 455
%3 = zext i1 %2 to i32
ret i32 %3
}
void usleep(unsigned int usec) {
  unsigned int t0 = Timer();
  unsigned int dly = (((usec)*100) >> 11);
  while (((unsigned int)(Timer() - t0)) < dly)
    ;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Timer@plt>
mov    %eax,-0x8(%rbp)
imul   $0x64,-0x4(%rbp),%eax
shr    $0xb,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <Timer@plt>
sub    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1147 <usleep+0x37>
jmp    112f <usleep+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <Timer@plt>
mov    %eax,%ebx
imul   $0x64,%ebp,%ebp
shr    $0xb,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <Timer@plt>
sub    %ebx,%eax
cmp    %ebp,%eax
jb     1130 <usleep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @Timer()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = mul i32 %6, 100
%8 = lshr i32 %7, 11
store i32 %8, i32* %4
br label %9
9: ; preds = %15, %1
%10 = call i32 (...) @Timer()
%11 = load i32, i32* %3
%12 = sub i32 %10, %11
%13 = load i32, i32* %4
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @usleep(i32 %0) {
%2 = tail call i32 (...) @Timer()
%3 = mul i32 %0, 100
%4 = lshr i32 %3, 11
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @Timer()
%7 = sub i32 %6, %2
%8 = icmp ult i32 %7, %4
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outnop1str(char *);
void outreturn() { outnop1str("RETURN"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"RETURN\00"
define void @outreturn() {
%1 = tail call i32 @outnop1str(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_35int8_reg(signed char val) {
  return ((val) & (-0x35 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_35int8_reg(i8 signext %0) {
%2 = and i8 %0, -53
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void *test_anti_range_135(long n) {
  extern void *alloc_anti_range_135(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= 2)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_135(n);
}


x86 assembly (clang, -O0):
<test_anti_range_135>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_135+0x39>
cmpq   $0x2,-0x8(%rbp)
jg     1149 <test_anti_range_135+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_135@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_135>:
movabs $0x8000000000000001,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xfffffffffffffffd,%rcx
cmp    %rax,%rcx
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_135@plt>

LLVM IR (-O0):
define i8* @test_anti_range_135(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_135(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_135(i64 %0) {
%2 = add i64 %0, 9223372036854775806
%3 = icmp ult i64 %2, -9223372036854775807
%4 = select i1 %3, i64 -9223372036854775807, i64 %0
%5 = tail call i8* @alloc_anti_range_135(i64 %4)
ret i8* %5
}
void interrupt() {}


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

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

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

LLVM IR (-O2):
define void @interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/Motors/bin");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xee3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <chdir@plt>
lea    0xee6(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/mnt/user/code/Motors/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"/mnt/user/code/Motors/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int hashpos(str, i, m)
char *str;
int i, m;
{
  unsigned int k = hashk(str, i);
  return ((int)(k % m));
}


x86 assembly (clang, -O0):
<hashpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <hashk@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashpos>:
push   %rbx
mov    %edx,%ebx
xor    %eax,%eax
call   1030 <hashk@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hashpos(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @hashk to i32 (i8*, i32, ...)*)(i8* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = urem i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hashpos(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @hashk to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%5 = urem i32 %4, %2
ret i32 %5
}
int calc_next_pof2(int total) {
  int next_pof2 = 1;
  while (next_pof2 <= total) {
    next_pof2 <<= 1;
  }
  next_pof2 >>= 1;
  return next_pof2;
}


x86 assembly (clang, -O0):
<calc_next_pof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1128 <calc_next_pof2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <calc_next_pof2+0xe>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_next_pof2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jle    1110 <calc_next_pof2+0x10>
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @calc_next_pof2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp sgt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
%7 = ashr i32 %3, 1
ret i32 %7
}
/* Variables and functions */
void const *stub1();
const void *testClosureVrP(const void *(*closure)(void)) {
  return closure != NULL ? (*closure)() : (const void *)0;
}


x86 assembly (clang, -O0):
<testClosureVrP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureVrP+0x23>
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrP+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrP+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrP>:
test   %rdi,%rdi
je     1107 <testClosureVrP+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @testClosureVrP(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 i8* %6()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @testClosureVrP(i8* ()* %0) {
%2 = icmp eq i8* ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* %0()
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct fontparse {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void parsetype3(struct fontparse *fp, FILE *in) {}


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

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

LLVM IR (-O0):
%struct.fontparse = type { i32 }
define void @parsetype3(%struct.fontparse* %0, i32* %1) {
%3 = alloca %struct.fontparse*
%4 = alloca i32*
store %struct.fontparse* %0, %struct.fontparse** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.fontparse = type { i32 }
define void @parsetype3(%struct.fontparse* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSolidOctahedron();
void drawSolidOctahedron(void) { glutSolidOctahedron(); }


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

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

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

LLVM IR (-O2):
define void @drawSolidOctahedron() {
%1 = tail call i32 (...) @glutSolidOctahedron()
ret void
}
/* Variables and functions */
int get_i();
int /*<<< orphan*/ put_s(char *);
void main() {
  int x;
  put_s("x=");
  x = get_i();
  if (x < 0)
    put_s("negativ");
  else
    put_s("pozitiv");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <put_s@plt>
mov    $0x0,%al
call   1040 <get_i@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1159 <main+0x39>
lea    0xeb4(%rip),%rdi
call   1030 <put_s@plt>
jmp    1165 <main+0x45>
lea    0xeab(%rip),%rdi
call   1030 <put_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <put_s@plt>
xor    %eax,%eax
call   1040 <get_i@plt>
test   %eax,%eax
lea    0xec6(%rip),%rax
lea    0xec7(%rip),%rdi
cmovs  %rax,%rdi
pop    %rax
jmp    1030 <put_s@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"x=\00"
@.str.1 = [8 x i8] c"negativ\00"
@.str.2 = [8 x i8] c"pozitiv\00"
define void @main() {
%1 = tail call i32 @put_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @get_i()
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @put_s(i8* %4)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_33(uint64_t x) {
  __asm__("rolq $33, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_33>:
mov    %rdi,%rax
rol    $0x21,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_33(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$33, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_33(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$33, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int fun378() { return 378; }


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

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

LLVM IR (-O0):
define i32 @fun378() {
ret i32 378
}

LLVM IR (-O2):
define i32 @fun378() {
ret i32 378
}
int test_imm_E2int16_reg(short val) {
  return ((val) & (-0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2int16_reg>:
test   $0xff1e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E2int16_reg(i16 signext %0) {
%2 = and i16 %0, -226
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void i(int x) { printf("i(%d)\n", x); }


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

x86 assembly (clang, -O2):
<i>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"i(%d)\0A\00"
define void @i(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("You have forgotten who you are and so forgotten me.\n"); }


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"You have forgotten who you are and so forgotten me.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [52 x i8] c"You have forgotten who you are and so forgotten me.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void preventCommandPropagation(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               98, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<preventCommandPropagation>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x62,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<preventCommandPropagation>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x62,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.preventCommandPropagation = [26 x i8] c"preventCommandPropagation\00"
define void @preventCommandPropagation() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 98, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.preventCommandPropagation, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.preventCommandPropagation = [26 x i8] c"preventCommandPropagation\00"
define void @preventCommandPropagation() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 98, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.preventCommandPropagation, i64 0, i64 0))
ret void
}
/* Variables and functions */
char **malloc(int);
int /*<<< orphan*/ printFF(char *, char **, int /*<<< orphan*/);
void printShellComand() {
  char **s = malloc(sizeof(char *));
  char *str = "shell>";
  s[0] = str;
  printFF("%s", s, 0);
}


x86 assembly (clang, -O0):
<printShellComand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
xor    %edx,%edx
call   1030 <printFF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printShellComand>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rcx
mov    %rcx,(%rax)
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
xor    %edx,%edx
pop    %rax
jmp    1030 <printFF@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"shell>\00"
@.str.1 = [3 x i8] c"%s\00"
define void @printShellComand() {
%1 = alloca i8**
%2 = alloca i8*
%3 = call i8** @malloc(i32 8)
store i8** %3, i8*** %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i8**, i8*** %1
%6 = getelementptr inbounds i8*, i8** %5, i64 0
store i8* %4, i8** %6
%7 = load i8**, i8*** %1
%8 = call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"shell>\00"
@.str.1 = [3 x i8] c"%s\00"
define void @printShellComand() {
%1 = tail call i8** @malloc(i32 8)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = tail call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ getchar();
void read(char *tape, unsigned long index, unsigned long count) {
  for (unsigned long i = 0; i < count; i++) {
    tape[index] = (char)getchar();
  }
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115f <read+0x4f>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <read+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r15
push   %r14
push   %rbx
test   %rdx,%rdx
je     1141 <read+0x31>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%r15,%r14,1)
add    $0xffffffffffffffff,%rbx
jne    1130 <read+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @read(i8* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 %1
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = tail call i64 (...) @getchar()
%11 = trunc i64 %10 to i8
store i8 %11, i8* %6
%12 = add nuw i64 %9, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %7, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ len_squared_vn(double const *, int /*<<< orphan*/ const);
double sqrt(int /*<<< orphan*/);
double len_vn(const double v0[], const uint dims) {
  return sqrt(len_squared_vn(v0, dims));
}


x86 assembly (clang, -O0):
<len_vn>:
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 <len_squared_vn@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_vn>:
push   %rax
call   1030 <len_squared_vn@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @len_vn(double* %0, i32 %1) {
%3 = tail call i32 @len_squared_vn(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}