xunge/DecIR huggingface dataset:
/* Variables and functions */
float floor(float);
float f_floor(float x) { return floor(x); }


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

x86 assembly (clang, -O2):
<f_floor>:
jmp    1030 <floorf@plt>

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

LLVM IR (-O2):
define float @f_floor(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
void main() {
  test1();
  test2();
  test3();
  test4();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    $0x0,%al
call   1050 <test4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test4@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @test1()
%2 = call i32 (...) @test2()
%3 = call i32 (...) @test3()
%4 = call i32 (...) @test4()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void strListFreeBlock(char *block) {
  if (block != NULL)
    free(block);
}


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

x86 assembly (clang, -O2):
<strListFreeBlock>:
test   %rdi,%rdi
je     111a <strListFreeBlock+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @strListFreeBlock(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void podnies_do_kwadratu(int *n) {
  int b;
  b = *n;
  *n = (b * b);
}


x86 assembly (clang, -O0):
<podnies_do_kwadratu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @podnies_do_kwadratu(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32*, i32** %2
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @podnies_do_kwadratu(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
store i32 %3, i32* %0
ret void
}
void f(char *p) {
  int i;
  for (i = 0; i < 10; i++)
    p[i] = i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1137 <f+0x37>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <f+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movabs $0x706050403020100,%rax
05 06 07
mov    %rax,(%rdi)
movw   $0x908,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0) {
store i8 0, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 1, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 2, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 3, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 4, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 5
store i8 5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 6
store i8 6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 7
store i8 7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 8
store i8 8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 9
store i8 9, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CallBack0(int);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void ClearDataFolderFlags(void) {
  if (!CheckRunningInMainThread("ClearDataFolderFlags"))
    return;
  CallBack0(125);
}


x86 assembly (clang, -O0):
<ClearDataFolderFlags>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    113e <ClearDataFolderFlags+0x1e>
jmp    1148 <ClearDataFolderFlags+0x28>
mov    $0x7d,%edi
call   1040 <CallBack0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearDataFolderFlags>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     113c <ClearDataFolderFlags+0x1c>
mov    $0x7d,%edi
pop    %rax
jmp    1040 <CallBack0@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"ClearDataFolderFlags\00"
define void @ClearDataFolderFlags() {
%1 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 @CallBack0(i32 125)
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"ClearDataFolderFlags\00"
define void @ClearDataFolderFlags() {
%1 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @CallBack0(i32 125)
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int pkstgen_main(int, char **);
int main(int argc, char **argv) { return pkstgen_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pkstgen_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <pkstgen_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @pkstgen_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @pkstgen_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
extern char *str_time() {
  static char buf[24];
  sprintf(buf, "%ld", time(0));
  return buf;
}


x86 assembly (clang, -O0):
<str_time>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%edx
lea    0x2f0c(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_time>:
push   %rbx
xor    %edi,%edi
call   1030 <time@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@str_time.buf = internal global [24 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @str_time() {
%1 = call i32 @time(i32 0)
%2 = call i32 @sprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str_time.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str_time.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@str_time.buf = internal global [24 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @str_time() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str_time.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str_time.buf, i64 0, i64 0)
}
/* Type definitions */
struct utmp {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int main(void) {
  struct utmp ut = {0};
  return 0;
}


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

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

LLVM IR (-O0):
%struct.utmp = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utmp
store i32 0, i32* %1
%3 = bitcast %struct.utmp* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_negative_sized_VLA_11_sub(int);
void check_negative_sized_VLA_11(int x) {
  if (x > 0)
    check_negative_sized_VLA_11_sub(x);
}


x86 assembly (clang, -O0):
<check_negative_sized_VLA_11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <check_negative_sized_VLA_11+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <check_negative_sized_VLA_11_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_negative_sized_VLA_11>:
test   %edi,%edi
jle    1119 <check_negative_sized_VLA_11+0x9>
jmp    1030 <check_negative_sized_VLA_11_sub@plt>
ret

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

LLVM IR (-O2):
define void @check_negative_sized_VLA_11(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @check_negative_sized_VLA_11_sub(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int signbit(double);
int main(int argc, char *argv[]) {
  double d = 0.0;
  printf("signbit: %d\n", signbit(d));
  d = -d;
  printf("signbit: %d\n", signbit(d));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <signbit@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <signbit@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xorps  %xmm0,%xmm0
call   1040 <signbit@plt>
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xebe(%rip),%xmm0
call   1040 <signbit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"signbit: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @signbit(double 0.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @signbit(double -0.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int);
main() {
  if (f(3))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
je     115a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <f@plt>
test   %rax,%rax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 3)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ unknown_function();
void differentiate_array_info_Good() {
  int *p;
  if (unknown_function()) {
    p = (int *)malloc(sizeof(int) * 5);
  } else {
    p = (int *)malloc(sizeof(int) * 10);
    p = p + 5;
  }
  p[4] = 0;
}


x86 assembly (clang, -O0):
<differentiate_array_info_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <unknown_function@plt>
cmp    $0x0,%rax
je     114c <differentiate_array_info_Good+0x2c>
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <differentiate_array_info_Good+0x46>
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<differentiate_array_info_Good>:
push   %rax
xor    %eax,%eax
call   1040 <unknown_function@plt>
test   %rax,%rax
je     1139 <differentiate_array_info_Good+0x19>
mov    $0x14,%edi
call   1030 <malloc@plt>
jmp    1147 <differentiate_array_info_Good+0x27>
mov    $0x28,%edi
call   1030 <malloc@plt>
add    $0x14,%rax
movl   $0x0,0x10(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @differentiate_array_info_Good() {
%1 = alloca i32*
%2 = call i64 (...) @unknown_function()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 @malloc(i32 20)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
br label %12
7: ; preds = %0
%8 = call i64 @malloc(i32 40)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %1
%10 = load i32*, i32** %1
%11 = getelementptr inbounds i32, i32* %10, i64 5
store i32* %11, i32** %1
br label %12
12: ; preds = %7, %4
%13 = load i32*, i32** %1
%14 = getelementptr inbounds i32, i32* %13, i64 4
store i32 0, i32* %14
ret void
}

LLVM IR (-O2):
define void @differentiate_array_info_Good() {
%1 = tail call i64 (...) @unknown_function()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @malloc(i32 20)
%5 = inttoptr i64 %4 to i32*
br label %10
6: ; preds = %0
%7 = tail call i64 @malloc(i32 40)
%8 = inttoptr i64 %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 5
br label %10
10: ; preds = %6, %3
%11 = phi i32* [ %5, %3 ], [ %9, %6 ]
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 0, i32* %12
ret void
}
/* Variables and functions */
long *malloc(int);
int main() {
  volatile long *arr = malloc(10 * sizeof(long));
  arr[5] = 23;
  arr[4] = 65;
  return arr[5] + arr[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x50,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x17,0x28(%rax)
mov    -0x10(%rbp),%rax
movq   $0x41,0x20(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x20(%rcx),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x50,%edi
call   1030 <malloc@plt>
movq   $0x17,0x28(%rax)
movq   $0x41,0x20(%rax)
mov    0x28(%rax),%rcx
mov    0x20(%rax),%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64*
store i32 0, i32* %1
%3 = call i64* @malloc(i32 80)
store i64* %3, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 5
store volatile i64 23, i64* %5
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 4
store volatile i64 65, i64* %7
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 5
%10 = load volatile i64, i64* %9
%11 = load i64*, i64** %2
%12 = getelementptr inbounds i64, i64* %11, i64 4
%13 = load volatile i64, i64* %12
%14 = add nsw i64 %10, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64* @malloc(i32 80)
%2 = getelementptr inbounds i64, i64* %1, i64 5
store volatile i64 23, i64* %2
%3 = getelementptr inbounds i64, i64* %1, i64 4
store volatile i64 65, i64* %3
%4 = load volatile i64, i64* %2
%5 = load volatile i64, i64* %3
%6 = add nsw i64 %5, %4
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int testLib4libopt_noexist();
int testLib4libopt(void) { return testLib4libopt_noexist(); }


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

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

LLVM IR (-O0):
define i32 @testLib4libopt() {
%1 = call i32 (...) @testLib4libopt_noexist()
ret i32 %1
}

LLVM IR (-O2):
define i32 @testLib4libopt() {
%1 = tail call i32 (...) @testLib4libopt_noexist()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_is_suspended() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_is_suspended"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_stream_is_suspended\0A\00"
define i32 @pa_stream_is_suspended() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_stream_is_suspended\00"
define i32 @pa_stream_is_suspended() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ another_function(int *);
int /*<<< orphan*/ printf(char *, int);
int some_function(int a) {
  int some_local_var = 0;
  printf("some_local_var has been changed to %d\n", some_local_var);
  another_function(&some_local_var);
  printf("some_lcoal_var has been changed to %d\n", some_local_var);
  return 0;
}


x86 assembly (clang, -O0):
<some_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <another_function@plt>
mov    -0x8(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_function>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <another_function@plt>
mov    0x4(%rsp),%esi
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"some_local_var has been changed to %d\0A\00"
@.str.1 = [39 x i8] c"some_lcoal_var has been changed to %d\0A\00"
define i32 @some_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @another_function(i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"some_local_var has been changed to %d\0A\00"
@.str.1 = [39 x i8] c"some_lcoal_var has been changed to %d\0A\00"
define i32 @some_function(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = call i32 @another_function(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
unsigned int get_index(int shmid) { return shmid % 0x10000; }


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
mov    %edi,%eax
lea    0xffff(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_index(i32 %0) {
%2 = srem i32 %0, 65536
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __original___openat_2(int, char const *, int, int /*<<< orphan*/);
int __openat_2(int dirfd, const char *pathname, int flags, mode_t mode) {
  int ret = 0;
  ret = __original___openat_2(dirfd, pathname, flags, mode);
  return ret;
}


x86 assembly (clang, -O0):
<__openat_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <__original___openat_2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__openat_2>:
jmp    1030 <__original___openat_2@plt>

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

LLVM IR (-O2):
define i32 @__openat_2(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @__original___openat_2(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
int ft_height(char *str) {
  int i;
  int h;
  i = 0;
  h = 0;
  while (str[i] != '\0') {
    if (str[i] == '\n')
      h++;
    i++;
  }
  return (h - 1);
}


x86 assembly (clang, -O0):
<ft_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_height+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1149 <ft_height+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ft_height+0x16>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_height>:
xor    %eax,%eax
jmp    1117 <ft_height+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <ft_height+0x10>
test   %cl,%cl
jne    1113 <ft_height+0x13>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_height(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 10, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, -1
ret i32 %13
}
void RTProcSelf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTProcSelf() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char *modifiermap;
};
typedef TYPE_1__ XModifierKeymap;

/* Variables and functions */
void set_XModifierKeymap_modifiermap(void *_p, void *_v) {
  ((XModifierKeymap *)_p)->modifiermap = (unsigned char *)_v;
}


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

x86 assembly (clang, -O2):
<set_XModifierKeymap_modifiermap>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XModifierKeymap_modifiermap(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
char *chompr(char *, int /*<<< orphan*/);
char *chomp(char *s) { return chompr(s, 0); }


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

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

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

LLVM IR (-O2):
define i8* @chomp(i8* %0) {
%2 = tail call i8* @chompr(i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Send(int, char *, char *);
void version(int sock, char *sender, int argc, char **argv) {
  Send(sock, "NOTICE %s :Kaiten wa goraku\n", sender);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rsi
call   1030 <Send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <Send@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"NOTICE %s :Kaiten wa goraku\0A\00"
define void @version(i32 %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @Send(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"NOTICE %s :Kaiten wa goraku\0A\00"
define void @version(i32 %0, i8* %1, i32 %2, i8** nocapture readnone %3) {
%5 = tail call i32 @Send(i32 %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void reshape_2(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<reshape_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <glViewport@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape_2>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glViewport@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @reshape_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @reshape_2(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *tl_strdup(const char *str) {
  char *ret = (char *)malloc(strlen(str) + 1);
  if (!ret)
    return NULL;
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<tl_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <tl_strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <tl_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <tl_strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <tl_strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @tl_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
void geom_CM_sph_tpr(double xm[], double xp[], double xc[]) {
  xc[0] = 0.5 * (xm[0] + xp[0]);
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM_sph_tpr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xed8(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM_sph_tpr>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM_sph_tpr(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fadd double %9, %12
%14 = fmul double 5.000000e-01, %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 0
store double %14, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fadd double %19, %22
%24 = fmul double 5.000000e-01, %23
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 1
store double %24, double* %26
ret void
}

LLVM IR (-O2):
define void @geom_CM_sph_tpr(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
%7 = fmul double %6, 5.000000e-01
store double %7, double* %2
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = fmul double %12, 5.000000e-01
%14 = getelementptr inbounds double, double* %2, i64 1
store double %13, double* %14
ret void
}
/* Variables and functions */
char *_getsym(char *, char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
char *mon_getsym(char *name, char *buf, int bufsize) {
  char *ret;
  monLock();
  ret = _getsym(name, buf, bufsize);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_getsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <_getsym@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_getsym>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <_getsym@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mon_getsym(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i32 (...) @monLock()
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i8* @_getsym(i8* %9, i8* %10, i32 %11)
store i8* %12, i8** %7
%13 = call i32 (...) @monUnlock()
%14 = load i8*, i8** %7
ret i8* %14
}

LLVM IR (-O2):
define i8* @mon_getsym(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i8* @_getsym(i8* %0, i8* %1, i32 %2)
%6 = tail call i32 (...) @monUnlock()
ret i8* %5
}
void inttob(int number, int length, char *result) {
  unsigned long long mask = 1LU << length;
  while (mask >>= 1) {
    *result++ = !!(mask & number) + '0';
  }
  return;
}


x86 assembly (clang, -O0):
<inttob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <inttob+0x6b>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    111f <inttob+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttob>:
test   %esi,%esi
je     1141 <inttob+0x41>
mov    $0x1,%eax
mov    %esi,%ecx
shl    %cl,%rax
movslq %edi,%r8
mov    %rax,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
shr    %rsi
mov    %rsi,%rdi
and    %r8,%rdi
cmp    $0x1,%rdi
mov    $0x31,%cl
sbb    $0x0,%cl
mov    %cl,(%rdx)
add    $0x1,%rdx
cmp    $0x3,%rax
mov    %rsi,%rax
ja     1120 <inttob+0x20>
ret

LLVM IR (-O0):
define void @inttob(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %7
br label %11
11: ; preds = %15, %3
%12 = load i64, i64* %7
%13 = lshr i64 %12, 1
store i64 %13, i64* %7
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i64, i64* %7
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = and i64 %16, %18
%20 = icmp ne i64 %19, 0
%21 = xor i1 %20, true
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = add nsw i32 %23, 48
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
store i8 %25, i8* %26
br label %11
28: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @inttob(i32 %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = shl nuw i64 1, %6
%8 = sext i32 %0 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ %7, %5 ], [ %12, %9 ]
%11 = phi i8* [ %2, %5 ], [ %16, %9 ]
%12 = lshr i64 %10, 1
%13 = and i64 %12, %8
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8 48, i8 49
%16 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %15, i8* %11
%17 = icmp ult i64 %10, 4
br i1 %17, label %18, label %9
18: ; preds = %9, %3
ret void
}
void INT_ST0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_ST0() {
ret void
}
int test_imm_AEint16_reg(short val) {
  return ((val) & (0xAE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AEint16_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, 174
%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_AEint16_reg(i16 signext %0) {
%2 = and i16 %0, 174
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t sr_crc32c_hw_byte(uint32_t crc, unsigned char const *data,
                           unsigned int length) {
  while (length--) {
    __asm__ __volatile__(".byte 0xf2, 0xf, 0x38, 0xf0, 0xf1"
                         : "=S"(crc)
                         : "0"(crc), "c"(*data));
    data++;
  }
  return crc;
}


x86 assembly (clang, -O0):
<sr_crc32c_hw_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1147 <sr_crc32c_hw_byte+0x47>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
crc32  %cl,%esi
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <sr_crc32c_hw_byte+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_crc32c_hw_byte>:
mov    %rsi,%rax
mov    %rdi,%rsi
test   %edx,%edx
je     1121 <sr_crc32c_hw_byte+0x21>
mov    %edx,%edx
xor    %edi,%edi
xchg   %ax,%ax
movzbl (%rax,%rdi,1),%ecx
crc32  %cl,%esi
add    $0x1,%rdi
cmp    %edi,%edx
jne    1110 <sr_crc32c_hw_byte+0x10>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @sr_crc32c_hw_byte(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add i32 %8, -1
store i32 %9, i32* %6
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = call i8* asm sideeffect ".byte 0xf2, 0xf, 0x38, 0xf0, 0xf1", "={si},0,{cx},~{dirflag},~{fpsr},~{flags}"(i8* %12, i8 %14)
store i8* %15, i8** %4
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
br label %7
18: ; preds = %7
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @sr_crc32c_hw_byte(i8* %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = phi i8* [ %12, %5 ], [ %1, %3 ]
%8 = phi i8* [ %11, %5 ], [ %0, %3 ]
%9 = add i32 %6, -1
%10 = load i8, i8* %7
%11 = tail call i8* asm sideeffect ".byte 0xf2, 0xf, 0x38, 0xf0, 0xf1", "={si},0,{cx},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8 %10)
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = icmp eq i32 %9, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi i8* [ %0, %3 ], [ %11, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int triangularNumber;
  triangularNumber = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
  printf("The eighth triangular number is %i\n", triangularNumber);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"The eighth triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 36, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The eighth triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 36)
ret i32 0
}
void gtk_tree_view_column_cell_get_position() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_cell_get_position() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double astro_julday_time(int /*<<< orphan*/ *);
double astro_mjd_time(time_t *time) {
  return astro_julday_time(time) - 2400000.5;
}


x86 assembly (clang, -O0):
<astro_mjd_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <astro_julday_time@plt>
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @astro_mjd_time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call double @astro_julday_time(i32* %3)
%5 = fsub double %4, 0x41424F8040000000
ret double %5
}

LLVM IR (-O2):
define double @astro_mjd_time(i32* %0) {
%2 = tail call double @astro_julday_time(i32* %0)
%3 = fadd double %2, 0xC1424F8040000000
ret double %3
}
int test_imm_89int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 588410519552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}