xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rgd_get_all_grid_addresses(long **, long const *);
void ksp_get_all_grid_addresses(long grid_address[][3], const long mesh[3]) {
  rgd_get_all_grid_addresses(grid_address, mesh);
}


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

x86 assembly (clang, -O2):
<ksp_get_all_grid_addresses>:
jmp    1030 <rgd_get_all_grid_addresses@plt>

LLVM IR (-O0):
define void @ksp_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = alloca [3 x i64]*
%4 = alloca i64*
store [3 x i64]* %0, [3 x i64]** %3
store i64* %1, i64** %4
%5 = load [3 x i64]*, [3 x i64]** %3
%6 = bitcast [3 x i64]* %5 to i64**
%7 = load i64*, i64** %4
%8 = call i32 @rgd_get_all_grid_addresses(i64** %6, i64* %7)
ret void
}

LLVM IR (-O2):
define void @ksp_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = bitcast [3 x i64]* %0 to i64**
%4 = tail call i32 @rgd_get_all_grid_addresses(i64** %3, i64* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GSL_PUT_JXXX(char *, char *, int, int);
void GSL_PUT_JNZERO(char *name, int line_number) {
  GSL_PUT_JXXX(name, "jnzero.i", 40, line_number);
}


x86 assembly (clang, -O0):
<GSL_PUT_JNZERO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rsi
mov    $0x28,%edx
call   1030 <GSL_PUT_JXXX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSL_PUT_JNZERO>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
mov    $0x28,%edx
jmp    1030 <GSL_PUT_JXXX@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"jnzero.i\00"
define void @GSL_PUT_JNZERO(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @GSL_PUT_JXXX(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 40, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"jnzero.i\00"
define void @GSL_PUT_JNZERO(i8* %0, i32 %1) {
%3 = tail call i32 @GSL_PUT_JXXX(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 40, i32 %1)
ret void
}
/* Variables and functions */
float __nv_fabsf(float);
float fabsf(float __a) { return __nv_fabsf(__a); }


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

x86 assembly (clang, -O2):
<fabsf>:
jmp    1030 <__nv_fabsf@plt>

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

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call float @__nv_fabsf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t minipack_unpack_str16(void *ptr, size_t *sz) {
  *sz = 3;
  return ntohs(*((uint16_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_str16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_str16>:
movq   $0x3,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_str16(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 3, i64* %5
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @ntohs(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @minipack_unpack_str16(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 3, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
ret i32 %6
}
/* Variables and functions */
size_t min(size_t A, size_t B) {
  if (A <= B) {
    return A;
  } else {
    return B;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmova  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
int main(void) {
  int i = 10;
  int j = 100;
  int k = 20;
  int m = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint_fast16_t;
typedef scalar_t__ int_fast16_t;

/* Variables and functions */
int /*<<< orphan*/ cop_st_ule16(void *, int);
__attribute__((unused)) void cop_st_sle16(void *buf, int_fast16_t val) {
  cop_st_ule16(buf, ((uint_fast16_t)val) & 0xFFFF);
}


x86 assembly (clang, -O0):
<cop_st_sle16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
and    $0xffff,%esi
call   1030 <cop_st_ule16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_st_sle16>:
movzwl %si,%esi
jmp    1030 <cop_st_ule16@plt>

LLVM IR (-O0):
define void @cop_st_sle16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 65535
%9 = call i32 @cop_st_ule16(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @cop_st_sle16(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 65535
%5 = tail call i32 @cop_st_ule16(i8* %0, i32 %4)
ret void
}
void YUY2ToUV422Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUV422Row_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_ENABLE;
int /*<<< orphan*/ pthread_setcancelstate(int /*<<< orphan*/,
                                          int /*<<< orphan*/ *);
void thread_enable_cancel(void) {
  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
}


x86 assembly (clang, -O0):
<thread_enable_cancel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_setcancelstate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_enable_cancel>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <pthread_setcancelstate@plt>

LLVM IR (-O0):
@PTHREAD_CANCEL_ENABLE = global i32 0
define void @thread_enable_cancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = call i32 @pthread_setcancelstate(i32 %1, i32* null)
ret void
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ENABLE = global i32 0
define void @thread_enable_cancel() {
%1 = load i32, i32* @PTHREAD_CANCEL_ENABLE
%2 = tail call i32 @pthread_setcancelstate(i32 %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ *RSA_new_method(int /*<<< orphan*/ *);
RSA *RSA_new(void) { return (RSA_new_method(NULL)); }


x86 assembly (clang, -O0):
<RSA_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <RSA_new_method@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_new>:
xor    %edi,%edi
jmp    1030 <RSA_new_method@plt>

LLVM IR (-O0):
define i32* @RSA_new() {
%1 = call i32* @RSA_new_method(i32* null)
ret i32* %1
}

LLVM IR (-O2):
define i32* @RSA_new() {
%1 = tail call i32* @RSA_new_method(i32* null)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ test30_AvrPin_set__E();
void test30_Led_on__E() { test30_AvrPin_set__E(); }


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

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

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

LLVM IR (-O2):
define void @test30_Led_on__E() {
%1 = tail call i32 (...) @test30_AvrPin_set__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ShowString(char *str) { printf("%s \n", str); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @ShowString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message) {
  fprintf(stderr, "Error: %s.\n\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
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   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Error: %s.\0A\0A\00"
define void @error(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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Error: %s.\0A\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float cos(int);
int frand();
int log(int);
float sqrt(int);
float random_normal(float mean, float std) {
  return mean + std * (sqrt(-2 * log(frand())) *
                       cos(2 * 3.14159265358979323846 * frand()));
}


x86 assembly (clang, -O0):
<random_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <frand@plt>
mov    %eax,%edi
call   1050 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1060 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <frand@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe69(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movss  -0x14(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm3
movss  -0xc(%rbp),%xmm0
mulss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_normal>:
sub    $0x18,%rsp
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
xor    %eax,%eax
call   1030 <frand@plt>
mov    %eax,%edi
call   1050 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1060 <sqrt@plt>
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <frand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe7c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mulss  0xc(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @random_normal(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 i32 (...) @frand()
%8 = call i32 @log(i32 %7)
%9 = mul nsw i32 -2, %8
%10 = call float @sqrt(i32 %9)
%11 = call i32 (...) @frand()
%12 = sitofp i32 %11 to double
%13 = fmul double 0x401921FB54442D18, %12
%14 = fptosi double %13 to i32
%15 = call float @cos(i32 %14)
%16 = fmul float %10, %15
%17 = call float @llvm.fmuladd.f32(float %6, float %16, float %5)
ret float %17
}

LLVM IR (-O2):
define float @random_normal(float %0, float %1) {
%3 = tail call i32 (...) @frand()
%4 = tail call i32 @log(i32 %3)
%5 = mul nsw i32 %4, -2
%6 = tail call float @sqrt(i32 %5)
%7 = tail call i32 (...) @frand()
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x401921FB54442D18
%10 = fptosi double %9 to i32
%11 = tail call float @cos(i32 %10)
%12 = fmul float %6, %11
%13 = tail call float @llvm.fmuladd.f32(float %1, float %12, float %0)
ret float %13
}
/* Variables and functions */
int compseq(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char texto[] = "Faculdade de Informática";
  printf("%zu\n", strlen(texto));
  printf("%i\n", compseq(texto));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb1(%rip),%ax
mov    %ax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <compseq@plt>
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xece(%rip),%xmm0
movups %xmm0,0xa(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <compseq@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.texto = [26 x i8] c"Faculdade de Inform\C3\A1tica\00"
@.str = [5 x i8] c"%zu\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i8]
store i32 0, i32* %1
%3 = bitcast [26 x i8]* %2 to i8*
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%8 = call i32 @compseq(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.texto = [26 x i8] c"Faculdade de Inform\C3\A1tica\00"
@.str = [5 x i8] c"%zu\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [26 x i8]
%2 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @compseq(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ printf(char *);
void init(int **p, int size) {
  int max_size = 100;
  ;
  if (size <= max_size) {
    *p = (int *)calloc(size, sizeof(int));
  } else {
    printf(
        "Failed to allocate array because size is more than 100. Try again.\n");
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     115e <init+0x3e>
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116a <init+0x4a>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
cmp    $0x64,%esi
jg     113a <init+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret
lea    0xebf(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Failed to allocate array because size is more than 100. Try again.\0A\00"
define void @init(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 100, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i64 @calloc(i32 %10, i32 4)
%12 = inttoptr i64 %11 to i32*
%13 = load i32**, i32*** %3
store i32* %12, i32** %13
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"Failed to allocate array because size is more than 100. Try again.\00"
define void @init(i32** nocapture writeonly %0, i32 %1) {
%3 = icmp slt i32 %1, 101
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i64 @calloc(i32 %1, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %0
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int errno;
int GetLastError() { return errno; }


x86 assembly (clang, -O0):
<GetLastError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLastError>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @GetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @GetLastError() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
char getchar();
void readline(char *buffer) {
  char c;
  int idx = 0;
  while ((c = getchar()) != '\n') {
    buffer[idx] = c;
    idx++;
  }
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1155 <readline+0x45>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <readline+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1131 <readline+0x21>
nop
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <readline+0x10>
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int, void const *, size_t);
ssize_t write(int fd, const void *buf, size_t count) {
  return syscall_cp(4, fd, buf, count);
}


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

x86 assembly (clang, -O2):
<write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <syscall_cp@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall_cp(i32 4, i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cli_pushname(char const *);
void cli_pushnames(const char **vector, const int count) {
  for (int i = 0; i < count; i++) {
    cli_pushname(vector[i]);
  }
}


x86 assembly (clang, -O0):
<cli_pushnames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <cli_pushnames+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <cli_pushname@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <cli_pushnames+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_pushnames>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <cli_pushnames+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <cli_pushname@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <cli_pushnames+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @cli_pushnames(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @cli_pushname(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ objects(unsigned int const);
int properties(int /*<<< orphan*/);
unsigned property_closure(const unsigned set) {
  return properties(objects(set));
}


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

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

LLVM IR (-O0):
define i32 @property_closure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @objects(i32 %3)
%5 = call i32 @properties(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @property_closure(i32 %0) {
%2 = tail call i32 @objects(i32 %0)
%3 = tail call i32 @properties(i32 %2)
ret i32 %3
}
int base2_len(int n) {
  int len = 0;
  while (n) {
    n >>= 1;
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<base2_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <base2_len+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <base2_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2_len>:
xor    %eax,%eax
test   %edi,%edi
je     111c <base2_len+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <base2_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @base2_len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
const char *deviceSerialDebugGetName(void) { return "serialDebug"; }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"serialDebug\00"
define i8* @deviceSerialDebugGetName() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
int isascii(int c) {
  if ((c - (c & 0x7F)) != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x7f,%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
je     1127 <isascii+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isascii+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
void save_ri_cb(struct runtime_instr_cb *cb_prev) {}


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

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

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

LLVM IR (-O2):
%struct.runtime_instr_cb = type opaque
define void @save_ri_cb(%struct.runtime_instr_cb* nocapture %0) {
ret void
}
/* Variables and functions */
int do_smbus_recv_byte(int, unsigned int);
int smbusx_recv_byte(unsigned smb_index, unsigned device) {
  return do_smbus_recv_byte(0x1000 + (smb_index << 8), device);
}


x86 assembly (clang, -O0):
<smbusx_recv_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
add    $0x1000,%edi
mov    -0x8(%rbp),%esi
call   1030 <do_smbus_recv_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbusx_recv_byte>:
shl    $0x8,%edi
add    $0x1000,%edi
jmp    1030 <do_smbus_recv_byte@plt>

LLVM IR (-O0):
define i32 @smbusx_recv_byte(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 = shl i32 %5, 8
%7 = add i32 4096, %6
%8 = load i32, i32* %4
%9 = call i32 @do_smbus_recv_byte(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @smbusx_recv_byte(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = add i32 %3, 4096
%5 = tail call i32 @do_smbus_recv_byte(i32 %4, i32 %1)
ret i32 %5
}
int test_imm_D4uint16_reg(unsigned short val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 212
%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_D4uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 212
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
extern void *nubus_slot_addr(int slot) {
  return (void *)(0xF0000000 | (slot << 24));
}


x86 assembly (clang, -O0):
<nubus_slot_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
or     $0xf0000000,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nubus_slot_addr>:
mov    %edi,%eax
or     $0xfffffff0,%eax
shl    $0x18,%eax
ret

LLVM IR (-O0):
define i8* @nubus_slot_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = or i32 -268435456, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @nubus_slot_addr(i32 %0) {
%2 = shl i32 %0, 24
%3 = or i32 %2, -268435456
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
void *ft_memcpy(void *, void const *, size_t);
void *malloc(size_t);
void *ft_memdup(void const *tab, size_t size) {
  void *new;
  if ((new = malloc(size)) == NULL)
    return (NULL);
  return (ft_memcpy(new, tab, size));
}


x86 assembly (clang, -O0):
<ft_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1154 <ft_memdup+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1169 <ft_memdup+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <ft_memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     114c <ft_memdup+0x2c>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %16
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i8* @ft_memcpy(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @ft_memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @ft_memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  search_for[strlen(search_for) - 1] = '\0';
  find_track(search_for);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %10
store i8 0, i8* %11
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = call i32 @find_track(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @find_track(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSC_BITSET_R8g_T4g(unsigned char *data) {
  switch_on_bits(data, (0x10));
  switch_off_bits(data, (0x02 | 0x01));
}


x86 assembly (clang, -O0):
<CTRL_REGSC_BITSET_R8g_T4g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1030 <switch_on_bits@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1040 <switch_off_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTRL_REGSC_BITSET_R8g_T4g>:
push   %rbx
mov    %rdi,%rbx
mov    $0x10,%esi
call   1030 <switch_on_bits@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
pop    %rbx
jmp    1040 <switch_off_bits@plt>

LLVM IR (-O0):
define void @CTRL_REGSC_BITSET_R8g_T4g(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @switch_on_bits(i8* %3, i32 16)
%5 = load i8*, i8** %2
%6 = call i32 @switch_off_bits(i8* %5, i32 3)
ret void
}

LLVM IR (-O2):
define void @CTRL_REGSC_BITSET_R8g_T4g(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 16)
%3 = tail call i32 @switch_off_bits(i8* %0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _irc_queue_insert(int, char *, char *, char *, ...);
int irc_kick(char *chan, char *nick, char *msg) {
  if (msg)
    _irc_queue_insert(5, "KICK %s %s :%s", chan, nick, msg);
  else
    _irc_queue_insert(5, "KICK %s %s", chan, nick);
  return 0;
}


x86 assembly (clang, -O0):
<irc_kick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <irc_kick+0x43>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x5,%edi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
jmp    116e <irc_kick+0x5e>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x5,%edi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_kick>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
test   %r8,%r8
je     1134 <irc_kick+0x24>
lea    0xeda(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
jmp    1147 <irc_kick+0x37>
lea    0xed4(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"KICK %s %s :%s\00"
@.str.1 = [11 x i8] c"KICK %s %s\00"
define i32 @irc_kick(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i32, i8*, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 (i32, i8*, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
ret i32 0
}
int op_ldbb(void) { return (4); }


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

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

LLVM IR (-O0):
define i32 @op_ldbb() {
ret i32 4
}

LLVM IR (-O2):
define i32 @op_ldbb() {
ret i32 4
}
/* Variables and functions */
int isrotate(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char a[] = "roatatethis";
  char b[] = "thisrotate";
  printf("The strings are rotation %d ", isrotate(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xf(%rbp)
mov    0xebe(%rip),%al
mov    %al,-0xd(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x17(%rbp),%rsi
call   1030 <isrotate@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x7465746174616f72,%rax
74 65 74
mov    %rax,0x18(%rsp)
movl   $0x736968,0x20(%rsp)
movabs $0x61746f7273696874,%rax
6f 74 61
mov    %rax,0x8(%rsp)
movl   $0x657461,0xf(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <isrotate@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [12 x i8] c"roatatethis\00"
@__const.main.b = [11 x i8] c"thisrotate\00"
@.str = [29 x i8] c"The strings are rotation %d \00"
define void @main() {
%1 = alloca [12 x i8]
%2 = alloca [11 x i8]
%3 = bitcast [12 x i8]* %1 to i8*
%4 = bitcast [11 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @isrotate(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@__const.main.a = [12 x i8] c"roatatethis\00"
@__const.main.b = [11 x i8] c"thisrotate\00"
@.str = [29 x i8] c"The strings are rotation %d \00"
define void @main() {
%1 = alloca [12 x i8]
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @isrotate(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void (*posix_signal(sig_num, action))() int sig_num;
void (*action)();
{}


x86 assembly (clang, -O0):
<posix_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias void (...)* @posix_signal(i32 %0, void (...)* nocapture readnone %1) {
ret void (...)* undef
}
/* Variables and functions */
int hash_check(void *);
int /*<<< orphan*/ hash_free(void *);
void *hash_init(char const *);
int /*<<< orphan*/ hash_read(void *);
int customer_license_check(const char *filepath) {
  void *ptr = hash_init(filepath);
  hash_read(ptr);
  int val = hash_check(ptr);
  hash_free(ptr);
  return val;
}


x86 assembly (clang, -O0):
<customer_license_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <hash_read@plt>
mov    -0x10(%rbp),%rdi
call   1060 <hash_check@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <hash_free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<customer_license_check>:
push   %rbp
push   %rbx
push   %rax
call   1030 <hash_init@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <hash_read@plt>
mov    %rbx,%rdi
call   1060 <hash_check@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <hash_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @customer_license_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @hash_init(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @hash_read(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @hash_check(i8* %9)
store i32 %10, i32* %4
%11 = load i8*, i8** %3
%12 = call i32 @hash_free(i8* %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @customer_license_check(i8* %0) {
%2 = tail call i8* @hash_init(i8* %0)
%3 = tail call i32 @hash_read(i8* %2)
%4 = tail call i32 @hash_check(i8* %2)
%5 = tail call i32 @hash_free(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
int system(char *);
int rm(char *target) {
  int ret;
  char *cmd = (char *)malloc(sizeof(char) * (strlen(target) + 8));
  sprintf(cmd, "rm -rf %s", target);
  ret = system(cmd);
  free(cmd);
  return ret;
}


x86 assembly (clang, -O0):
<rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x8,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe78(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x8(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe92(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"rm -rf %s\00"
define i32 @rm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 8
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @system(i8* %16)
store i32 %17, i32* %3
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"rm -rf %s\00"
define i32 @rm(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 8
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @system(i8* %5)
%8 = tail call i32 @free(i8* %5)
ret i32 %7
}