xunge/DecIR huggingface dataset:
void t17() {
  int i;
  __asm__("nop" : "=m"(i));
}


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

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

LLVM IR (-O0):
define void @t17() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @t17() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret void
}
/* Variables and functions */
int tracepoint_probe_unregister(char *, void *);
__attribute__((always_)) int unregister_trace_mm_page_alloc_extfrag(
    void (*probe)(struct page *page, int alloc_order, int fallback_order,
                  int alloc_migratetype, int fallback_migratetype)) {
  return tracepoint_probe_unregister("mm_page_alloc_extfrag", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
@.str = [22 x i8] c"mm_page_alloc_extfrag\00"
define i32 @unregister_trace_mm_page_alloc_extfrag(void (%struct.page*, i32, i32, i32, i32)* %0) {
%2 = alloca void (%struct.page*, i32, i32, i32, i32)*
store void (%struct.page*, i32, i32, i32, i32)* %0, void (%struct.page*, i32, i32, i32, i32)** %2
%3 = load void (%struct.page*, i32, i32, i32, i32)*, void (%struct.page*, i32, i32, i32, i32)** %2
%4 = bitcast void (%struct.page*, i32, i32, i32, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.page = type opaque
@.str = [22 x i8] c"mm_page_alloc_extfrag\00"
define i32 @unregister_trace_mm_page_alloc_extfrag(void (%struct.page*, i32, i32, i32, i32)* %0) {
%2 = bitcast void (%struct.page*, i32, i32, i32, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void array_dump(int array[], size_t array_length) {
  for (int index = 0; index < array_length; ++index) {
    printf("%d ", array[index]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<array_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <array_dump+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <array_dump+0x17>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @array_dump(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
scalar_t__ malloc(int);
char *itob(int integer) {
  int size = 4;
  char *result = (char *)malloc(sizeof(char) * size);
  char *aux = (char *)&integer;
  int i;
  for (i = size - 1; i >= 0; i--) {
    result[size - 1 - i] = aux[i];
  }
  return result;
}


x86 assembly (clang, -O0):
<itob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     117c <itob+0x6c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <itob+0x36>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itob>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
bswap  %ebx
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @itob(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %3
%7 = load i32, i32* %3
%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 = bitcast i32* %2 to i8*
store i8* %13, i8** %5
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %6
br label %16
16: ; preds = %32, %1
%17 = load i32, i32* %6
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %4
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %25, i64 %30
store i8 %24, i8* %31
br label %32
32: ; preds = %19
%33 = load i32, i32* %6
%34 = add nsw i32 %33, -1
store i32 %34, i32* %6
br label %16
35: ; preds = %16
%36 = load i8*, i8** %4
ret i8* %36
}

LLVM IR (-O2):
define i8* @itob(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
%9 = tail call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i8*
store i8 %8, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %6, i8* %11
%12 = getelementptr inbounds i8, i8* %10, i64 2
store i8 %4, i8* %12
%13 = getelementptr inbounds i8, i8* %10, i64 3
store i8 %2, i8* %13
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Github!\n");
  printf("Have a great day!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%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
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello Github!\0A\00"
@.str.1 = [19 x i8] c"Have a great day!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello Github!\00"
@str.2 = [18 x i8] c"Have a great day!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fortfunc_(int *, float *);
int main() {
  int ii = 5;
  float ff = 6.345;
  fortfunc_(&ii, &ff);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x40cb0a3d,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <fortfunc_@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 5, i32* %2
store float 0x40196147A0000000, float* %3
%4 = call i32 @fortfunc_(i32* %2, float* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast float* %2 to i8*
store float 0x40196147A0000000, float* %2
%5 = call i32 @fortfunc_(i32* %1, float* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void my_abort(void) { kill(getpid(), SIGABRT); }


x86 assembly (clang, -O0):
<my_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_abort>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @my_abort() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @my_abort() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
unsigned char floor(int);
int random2();
void memory_randomize(void *data, int size) {
  unsigned char *bytes = (unsigned char *)data;
  for (int i = 0; i != size; ++i) {
    bytes[i] = floor(random2() * 255);
  }
}


x86 assembly (clang, -O0):
<memory_randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1177 <memory_randomize+0x57>
mov    $0x0,%al
call   1030 <random2@plt>
imul   $0xff,%eax,%edi
call   1040 <floor@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <memory_randomize+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_randomize>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1160 <memory_randomize+0x40>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random2@plt>
mov    %eax,%edi
shl    $0x8,%edi
sub    %eax,%edi
call   1040 <floor@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <memory_randomize+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @memory_randomize(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
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 ], [ %13, %7 ]
%9 = tail call i32 (...) @random2()
%10 = mul nsw i32 %9, 255
%11 = tail call zeroext i8 @floor(i32 %10)
%12 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %11, i8* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ OSCInvokeMessagesThatAreReady(int);
int /*<<< orphan*/ printf(char *);
void TestEmptyCase() {
  printf(
      "Calling OSCInvokeMessagesThatAreReady, even though nothing's ready.\n");
  OSCInvokeMessagesThatAreReady(2);
}


x86 assembly (clang, -O0):
<TestEmptyCase>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <OSCInvokeMessagesThatAreReady@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestEmptyCase>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <OSCInvokeMessagesThatAreReady@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"Calling OSCInvokeMessagesThatAreReady, even though nothing's ready.\0A\00"
define void @TestEmptyCase() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @OSCInvokeMessagesThatAreReady(i32 2)
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"Calling OSCInvokeMessagesThatAreReady, even though nothing's ready.\00"
define void @TestEmptyCase() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @OSCInvokeMessagesThatAreReady(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void light(void) {
  static int l;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}


x86 assembly (clang, -O0):
<light>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0a(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2f01(%rip)
cmp    $0x0,%eax
je     114f <light+0x2f>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115d <light+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<light>:
xorl   $0x1,0x2f0d(%rip)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
je     1137 <light+0x17>
jmp    1030 <glEnable@plt>
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@light.l = internal global i32 0
@GL_LIGHTING = global i32 0
define void @light() {
%1 = load i32, i32* @light.l
%2 = xor i32 %1, 1
store i32 %2, i32* @light.l
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @GL_LIGHTING
%6 = call i32 @glEnable(i32 %5)
br label %10
7: ; preds = %0
%8 = load i32, i32* @GL_LIGHTING
%9 = call i32 @glDisable(i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@light.l = internal unnamed_addr global i32 0
@GL_LIGHTING = global i32 0
define void @light() {
%1 = load i32, i32* @light.l
%2 = xor i32 %1, 1
store i32 %2, i32* @light.l
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_LIGHTING
br i1 %3, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @glEnable(i32 %4)
br label %9
7: ; preds = %0
%8 = tail call i32 @glDisable(i32 %4)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cb1(int);
void trigger_callback1() { cb1(7); }


x86 assembly (clang, -O0):
<trigger_callback1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <cb1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trigger_callback1>:
mov    $0x7,%edi
jmp    1030 <cb1@plt>

LLVM IR (-O0):
define void @trigger_callback1() {
%1 = call i32 @cb1(i32 7)
ret void
}

LLVM IR (-O2):
define void @trigger_callback1() {
%1 = tail call i32 @cb1(i32 7)
ret void
}
/* Variables and functions */
scalar_t__ strchr(char const *, char);
int PasswordIsValid(const char *str) {
  ;
  if (!str)
    return 0;
  if (!*str || *str == ':' || strchr(str, ' '))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<PasswordIsValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <PasswordIsValid+0x23>
movl   $0x0,-0x4(%rbp)
jmp    117b <PasswordIsValid+0x6b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <PasswordIsValid+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     1168 <PasswordIsValid+0x58>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1174 <PasswordIsValid+0x64>
movl   $0x0,-0x4(%rbp)
jmp    117b <PasswordIsValid+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PasswordIsValid>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1123 <PasswordIsValid+0x13>
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <PasswordIsValid+0x13>
cmp    $0x3a,%cl
jne    1125 <PasswordIsValid+0x15>
pop    %rcx
ret
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PasswordIsValid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %22
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 58
br i1 %15, label %20, label %16
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = call i64 @strchr(i8* %17, i8 signext 32)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16, %11, %7
store i32 0, i32* %2
br label %22
21: ; preds = %16
store i32 1, i32* %2
br label %22
22: ; preds = %21, %20, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @PasswordIsValid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
switch i8 %4, label %5 [
i8 0, label %9
i8 58, label %9
]
5: ; preds = %3
%6 = tail call i64 @strchr(i8* %0, i8 signext 32)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %3, %3, %1
%10 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 0, %3 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ I2CSlaveEnable(unsigned long);
void I2CSlaveInit(unsigned long ulBase, unsigned char ucSlaveAddr) {
  ;
  ;
  I2CSlaveEnable(ulBase);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ucSlaveAddr;
}


x86 assembly (clang, -O0):
<I2CSlaveInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CSlaveEnable@plt>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveInit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <I2CSlaveEnable@plt>
mov    %ebp,%eax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @I2CSlaveInit(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CSlaveEnable(i64 %5)
%7 = load i8, i8* %4
%8 = zext i8 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2CSlaveInit(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @I2CSlaveEnable(i64 %0)
%4 = zext i8 %1 to i64
%5 = inttoptr i64 %0 to i64*
store volatile i64 %4, i64* %5
ret void
}
void test(int *p) { *p = 100; }


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

x86 assembly (clang, -O2):
<test>:
movl   $0x64,(%rdi)
ret

LLVM IR (-O0):
define void @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 100, i32* %3
ret void
}

LLVM IR (-O2):
define void @test(i32* nocapture writeonly %0) {
store i32 100, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("Number of arguments: %i\n", argc);
  printf("Name specified: %s\n", argv[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Number of arguments: %i\0A\00"
@.str.1 = [20 x i8] c"Name specified: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void gg_dcc_fill_filetime(uint32_t ut, uint32_t *ft) {}


x86 assembly (clang, -O0):
<gg_dcc_fill_filetime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gg_dcc_fill_filetime(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x14_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x14_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x14_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x14_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x14_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, int, int);
int /*<<< orphan*/ system(char *);
void update_cpu_mem_rrd(int cpu, int mem) {
  char cmd[1024];
  snprintf(cmd, 1024, "%s update %s N:%d:%d", "/bin/rrdtool",
           "/var/cpu_mem.rrd", cpu, mem);
  system(cmd);
}


x86 assembly (clang, -O0):
<update_cpu_mem_rrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%r9d
mov    -0x8(%rbp),%eax
mov    $0x400,%esi
lea    0xeb5(%rip),%rdx
lea    0xec3(%rip),%rcx
lea    0xec9(%rip),%r8
mov    %eax,(%rsp)
call   1040 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_cpu_mem_rrd>:
push   %rbx
sub    $0x410,%rsp
mov    %edi,%r9d
mov    %esi,(%rsp)
lea    0xecb(%rip),%rdx
lea    0xed9(%rip),%rcx
lea    0xedf(%rip),%r8
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s update %s N:%d:%d\00"
@.str.1 = [13 x i8] c"/bin/rrdtool\00"
@.str.2 = [17 x i8] c"/var/cpu_mem.rrd\00"
define void @update_cpu_mem_rrd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1024 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s update %s N:%d:%d\00"
@.str.1 = [13 x i8] c"/bin/rrdtool\00"
@.str.2 = [17 x i8] c"/var/cpu_mem.rrd\00"
define void @update_cpu_mem_rrd(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @system(i8* %4)
ret void
}
int _is_hex(char c) {
  return (((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F')) ||
          ((c >= 'a') && (c <= 'f')));
}


x86 assembly (clang, -O0):
<_is_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <_is_hex+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_is_hex+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <_is_hex+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_is_hex+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <_is_hex+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_is_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 70
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 97
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 102
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @_is_hex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int C(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  printf("C(%d, %d) = %d\n", 4, 2, C(4, 2));
  printf("C(%d, %d) = %d\n", 49, 6, C(49, 6));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x2,%esi
call   1040 <C@plt>
mov    %eax,%ecx
lea    0xec4(%rip),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    $0x31,%edi
mov    $0x6,%esi
call   1040 <C@plt>
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
mov    $0x31,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
mov    $0x2,%esi
call   1040 <C@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x31,%edi
mov    $0x6,%esi
call   1040 <C@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
mov    $0x6,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"C(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = call i32 @C(i32 4, i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 2, i32 %1)
%3 = call i32 @C(i32 49, i32 6)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 49, i32 6, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"C(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @C(i32 4, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 2, i32 %1)
%3 = tail call i32 @C(i32 49, i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 49, i32 6, i32 %3)
ret i32 0
}
/* Variables and functions */
char *strcpy(char *, char const *);
int strlen(char *);
char *igraph_i_stpcpy(char *s1, const char *s2) {
  char *result = strcpy(s1, s2);
  return result + strlen(s1);
}


x86 assembly (clang, -O0):
<igraph_i_stpcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_i_stpcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @igraph_i_stpcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strcpy(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
ret i8* %13
}

LLVM IR (-O2):
define i8* @igraph_i_stpcpy(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
unsigned int calc_hash2(const char *str) {
  unsigned int hash;
  for (hash = 0; str[0] != 0; str++)
    hash = hash * 33 + str[0];
  return hash;
}


x86 assembly (clang, -O0):
<calc_hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <calc_hash2+0x40>
imul   $0x21,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <calc_hash2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hash2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <calc_hash2+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <calc_hash2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_hash2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int simulated_nested_loop_with_and_constant(int p) {
  int k = 0;
  int t = 5;
  int j = 0;
  for (int i = 0; i < 5; i++) {
  B:
    t = 3;
    j++;
    if (k == 0 && j < 100) {
      goto B;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<simulated_nested_loop_with_and_constant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116e <simulated_nested_loop_with_and_constant+0x6e>
jmp    1132 <simulated_nested_loop_with_and_constant+0x32>
movl   $0x3,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <simulated_nested_loop_with_and_constant+0x5b>
cmpl   $0x64,-0x10(%rbp)
jge    115b <simulated_nested_loop_with_and_constant+0x5b>
jmp    1132 <simulated_nested_loop_with_and_constant+0x32>
jmp    1160 <simulated_nested_loop_with_and_constant+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <simulated_nested_loop_with_and_constant+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @simulated_nested_loop_with_and_constant(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 5, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %24
10: ; preds = %7
br label %11
11: ; preds = %19, %10
store i32 3, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %20
19: ; preds = %16
br label %11
20: ; preds = %16, %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @simulated_nested_loop_with_and_constant(i32 %0) {
ret i32 0
}
int max(int a, int b) { return a < b ? b : a; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(short *, int, int, int /*<<< orphan*/ *);
size_t AuChannelReadShort(FILE *audioChannel, short *samples, int nSamples,
                          int *readed) {
  *readed = fread(samples, 2, nSamples, audioChannel);
  return *readed <= 0;
}


x86 assembly (clang, -O0):
<AuChannelReadShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
call   1030 <fread@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
setle  %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AuChannelReadShort>:
push   %rbx
mov    %rcx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x2,%esi
call   1030 <fread@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @AuChannelReadShort(i32* %0, i16* %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i16* %1, i16** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i16*, i16** %6
%10 = load i32, i32* %7
%11 = load i32*, i32** %5
%12 = call i32 @fread(i16* %9, i32 2, i32 %10, i32* %11)
%13 = load i32*, i32** %8
store i32 %12, i32* %13
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = icmp sle i32 %15, 0
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @AuChannelReadShort(i32* nocapture %0, i16* nocapture %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @fread(i16* %1, i32 2, i32 %2, i32* %0)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 1
%7 = zext i1 %6 to i64
ret i64 %7
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t gettimeusec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  uint64_t t = tv.tv_sec * 1000000 + tv.tv_usec;
  return t;
}


x86 assembly (clang, -O0):
<gettimeusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeusec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @gettimeusec() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @gettimeusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int foo();
int main() { volatile int x = foo(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store volatile i32 %2, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @foo()
store volatile i32 %3, i32* %1
ret i32 0
}
int test_imm_16int32_mem(int *val) {
  return ((*val) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 22
%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_16int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 22
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct obstack {
  int dummy;
};

/* Variables and functions */
int _obstack_begin(struct obstack *, int, int, void *(*)(long),
                   void (*)(void *));
__attribute__((__weak__, __always___)) int
softboundcets__obstack_begin(struct obstack *obj, int a, int b,
                             void *(foo)(long), void(bar)(void *)) {
  return _obstack_begin(obj, a, b, foo, bar);
}


x86 assembly (clang, -O0):
<softboundcets__obstack_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <_obstack_begin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets__obstack_begin>:
jmp    1030 <_obstack_begin@plt>

LLVM IR (-O0):
%struct.obstack = type { i32 }
define weak i32 @softboundcets__obstack_begin(%struct.obstack* %0, i32 %1, i32 %2, i8* (i64)* %3, void (i8*)* %4) {
%6 = alloca %struct.obstack*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8* (i64)*
%10 = alloca void (i8*)*
store %struct.obstack* %0, %struct.obstack** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* (i64)* %3, i8* (i64)** %9
store void (i8*)* %4, void (i8*)** %10
%11 = load %struct.obstack*, %struct.obstack** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8* (i64)*, i8* (i64)** %9
%15 = load void (i8*)*, void (i8*)** %10
%16 = call i32 @_obstack_begin(%struct.obstack* %11, i32 %12, i32 %13, i8* (i64)* %14, void (i8*)* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.obstack = type { i32 }
define weak i32 @softboundcets__obstack_begin(%struct.obstack* %0, i32 %1, i32 %2, i8* (i64)* %3, void (i8*)* %4) {
%6 = tail call i32 @_obstack_begin(%struct.obstack* %0, i32 %1, i32 %2, i8* (i64)* %3, void (i8*)* %4)
ret i32 %6
}
/* Type definitions */
struct nn_epbase {
  int dummy;
};

/* Variables and functions */
int nn_cipc_create(void *, struct nn_epbase **);
int nn_ipc_connect(void *hint, struct nn_epbase **epbase) {
  return nn_cipc_create(hint, epbase);
}


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

x86 assembly (clang, -O2):
<nn_ipc_connect>:
jmp    1030 <nn_cipc_create@plt>

LLVM IR (-O0):
%struct.nn_epbase = type { i32 }
define i32 @nn_ipc_connect(i8* %0, %struct.nn_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.nn_epbase**
store i8* %0, i8** %3
store %struct.nn_epbase** %1, %struct.nn_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.nn_epbase**, %struct.nn_epbase*** %4
%7 = call i32 @nn_cipc_create(i8* %5, %struct.nn_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.nn_epbase = type { i32 }
define i32 @nn_ipc_connect(i8* %0, %struct.nn_epbase** %1) {
%3 = tail call i32 @nn_cipc_create(i8* %0, %struct.nn_epbase** %1)
ret i32 %3
}