xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ quick_sort_recursive(void *, int, int /*<<< orphan*/, int,
                                        int (*)(void *, void *),
                                        void (*)(void *, void *));
void quick_sort(void *arr, int unit_size, int len,
                int (*compare)(void *one, void *two),
                void (*swap)(void *one, void *two)) {
  quick_sort_recursive(arr, unit_size, 0, len - 1, compare, swap);
}


x86 assembly (clang, -O0):
<quick_sort>:
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),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %edx,%edx
call   1030 <quick_sort_recursive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
mov    %r8,%r9
mov    %rcx,%r8
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
jmp    1030 <quick_sort_recursive@plt>

LLVM IR (-O0):
define void @quick_sort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3, void (i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32 (i8*, i8*)*
%10 = alloca void (i8*, i8*)*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %9
store void (i8*, i8*)* %4, void (i8*, i8*)** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = sub nsw i32 %13, 1
%15 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %9
%16 = load void (i8*, i8*)*, void (i8*, i8*)** %10
%17 = call i32 @quick_sort_recursive(i8* %11, i32 %12, i32 0, i32 %14, i32 (i8*, i8*)* %15, void (i8*, i8*)* %16)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3, void (i8*, i8*)* %4) {
%6 = add nsw i32 %2, -1
%7 = tail call i32 @quick_sort_recursive(i8* %0, i32 %1, i32 0, i32 %6, i32 (i8*, i8*)* %3, void (i8*, i8*)* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ *authunix_create_default();
int /*<<< orphan*/ printf(char *, int);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  AUTH *authUnx = NULL;
  authUnx = authunix_create_default();
  test_status = ((AUTH *)authUnx != NULL) ? 0 : 1;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x0,%al
call   1040 <authunix_create_default@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <authunix_create_default@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %8
store i32* null, i32** %9
%14 = call i32* (...) @authunix_create_default()
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = icmp ne i32* %15, null
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @authunix_create_default()
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
char *_strdup(char *word) {
  char *p = (char *)malloc(strlen(word) + 1);
  p = strcpy(p, word);
  return p;
}


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

x86 assembly (clang, -O2):
<_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i8* @strcpy(i8* %9, i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @_strdup(i8* nocapture %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 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, i;
  scanf("%d", &n);
  if (n > 2) {
    for (i = 2; i < 10000; i += n) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jle    117f <main+0x5f>
movl   $0x2,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    117a <main+0x5a>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <main+0x30>
jmp    117f <main+0x5f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3,0x4(%rsp)
jl     1166 <main+0x46>
mov    $0x2,%ebx
lea    0xebb(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    0x4(%rsp),%ebx
cmp    $0x2710,%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ 2, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %7
%11 = icmp slt i32 %10, 10000
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
void test4(_Complex float *x) { *x = ~*x; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm1,(%rax)
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
movss  0x4(%rdi),%xmm0
xorps  0xef4(%rip),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @test4({ float, float }* %0) {
%2 = alloca { float, float }*
store { float, float }* %0, { float, float }** %2
%3 = load { float, float }*, { float, float }** %2
%4 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%5 = load float, float* %4
%6 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%7 = load float, float* %6
%8 = fneg float %7
%9 = load { float, float }*, { float, float }** %2
%10 = getelementptr inbounds { float, float }, { float, float }* %9, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %9, i32 0, i32 1
store float %5, float* %10
store float %8, float* %11
ret void
}

LLVM IR (-O2):
define void @test4({ float, float }* nocapture %0) {
%2 = getelementptr inbounds { float, float }, { float, float }* %0, i64 0, i32 1
%3 = load float, float* %2
%4 = fneg float %3
store float %4, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    printf("%d ", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
xor    %ebx,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You have travelled %d kms", distance);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"You have travelled %d kms\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"You have travelled %d kms\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int Flog10(int);
int MY_LOG10(int x) {
  if (x <= 0)
    return 0;
  else
    return (10 * (Flog10((int)x) + 0x4d104)) >> 16;
}


x86 assembly (clang, -O0):
<MY_LOG10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <MY_LOG10+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1147 <MY_LOG10+0x37>
mov    -0x8(%rbp),%edi
call   1030 <Flog10@plt>
add    $0x4d104,%eax
imul   $0xa,%eax,%eax
sar    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MY_LOG10>:
test   %edi,%edi
jle    112c <MY_LOG10+0x1c>
push   %rax
call   1030 <Flog10@plt>
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    $0x302a28,%eax
sar    $0x10,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @MY_LOG10(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @Flog10(i32 %0)
%5 = mul i32 %4, 10
%6 = add i32 %5, 3156520
%7 = ashr i32 %6, 16
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_byte(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeconfig_update_audio(uint8_t val) {
  eeprom_update_byte((uint8_t *)7, val);
}


x86 assembly (clang, -O0):
<eeconfig_update_audio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7,%edi
call   1030 <eeprom_update_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @eeconfig_update_audio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eeprom_update_byte(i32* inttoptr (i64 7 to i32*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_audio(i32 %0) {
%2 = tail call i32 @eeprom_update_byte(i32* inttoptr (i64 7 to i32*), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void info() { fprintf(stdout, "Try \'sysextract -h\' for more information\n"); }


x86 assembly (clang, -O0):
<info>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<info>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [42 x i8] c"Try 'sysextract -h' for more information\0A\00"
define void @info() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [42 x i8] c"Try 'sysextract -h' for more information\0A\00"
define void @info() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rlimit {
  int rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NOFILE;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int fd_max(void) {
  struct rlimit rlim;
  getrlimit(RLIMIT_NOFILE, &rlim);
  return rlim.rlim_max;
}


x86 assembly (clang, -O0):
<fd_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_max>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_NOFILE = global i32 0
define i32 @fd_max() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_NOFILE
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_NOFILE = global i32 0
define i32 @fd_max() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
const char *timefmt(time_t t) {
  static char buf[128];
  strftime(buf, sizeof(buf), "%y-%m-%d %H:%M", localtime(&t));
  return buf;
}


x86 assembly (clang, -O0):
<timefmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%ecx
lea    0x2f03(%rip),%rdi
mov    $0x80,%esi
lea    0xeb7(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2eeb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timefmt>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@timefmt.buf = internal global [128 x i8] zeroinitializer
@.str = [15 x i8] c"%y-%m-%d %H:%M\00"
define i8* @timefmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @timefmt.buf, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @timefmt.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@timefmt.buf = internal global [128 x i8] zeroinitializer
@.str = [15 x i8] c"%y-%m-%d %H:%M\00"
define i8* @timefmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @timefmt.buf, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @timefmt.buf, i64 0, i64 0)
}
int ph_ftp_data_determine_target(void *handler, struct sockaddr_in *addr) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sockaddr_in = type opaque
define i32 @ph_ftp_data_determine_target(i8* %0, %struct.sockaddr_in* %1) {
%3 = alloca i8*
%4 = alloca %struct.sockaddr_in*
store i8* %0, i8** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type opaque
define i32 @ph_ftp_data_determine_target(i8* nocapture readnone %0, %struct.sockaddr_in* nocapture readnone %1) {
ret i32 0
}
void entity_init(void) {}


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

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

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

LLVM IR (-O2):
define void @entity_init() {
ret void
}
int cairo_code_draw_16seg_get_width() { return 30; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_16seg_get_width() {
ret i32 30
}

LLVM IR (-O2):
define i32 @cairo_code_draw_16seg_get_width() {
ret i32 30
}
int is_whitespace(char character) {
  return ((character == ' ') || (character == '\t') || (character == '\n') ||
          (character == '\r'));
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     1120 <is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
bool args_sanity_check(int argc, char *argv[]) {
  if (argc < 3)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<args_sanity_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1121 <args_sanity_check+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1128 <args_sanity_check+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_sanity_check>:
xor    %eax,%eax
cmp    $0x3,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @args_sanity_check(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %10
9: ; preds = %2
store i32 1, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @args_sanity_check(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int execute_brk() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_brk() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rt_init();
void XeDisk_Init(void) { rt_init(); }


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

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

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

LLVM IR (-O2):
define void @XeDisk_Init() {
%1 = tail call i32 (...) @rt_init()
ret void
}
void test___atomic_xor_fetch_1(short *mem) { __atomic_xor_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test___atomic_xor_fetch_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xffff,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
xor    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test___atomic_xor_fetch_1+0x5d>
jmp    1125 <test___atomic_xor_fetch_1+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
xor    %cx,%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_xor_fetch_1>:
lock xorw $0xffff,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_xor_fetch_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 -1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw xor i16* %5, i16 %6 acq_rel
%8 = xor i16 %7, %6
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_xor_fetch_1(i16* nocapture %0) {
%2 = atomicrmw xor i16* %0, i16 -1 acq_rel
ret void
}
int main() {
  unsigned char keyb[] = {0x37, 0xfa, 0x21, 0x3d};
  int max = 1024 * 1024 * 8;
  int step = 1024 * 512;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x800000,-0xc(%rbp)
movl   $0x80000,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.keyb = [4 x i8] c"7\FA!="
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x i8]* %2 to i8*
store i32 8388608, i32* %3
store i32 524288, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int error_simgen_create(void **gen, const char *seed) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @error_simgen_create(i8** nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void _infix_operator_div_u32_u32(unsigned long lhs, unsigned long rhs,
                                 unsigned long *__rval_1) {
  *__rval_1 = lhs / rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_div_u32_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_div_u32_u32>:
mov    %rdx,%rcx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     111b <_infix_operator_div_u32_u32+0x1b>
xor    %edx,%edx
div    %rsi
mov    %rax,(%rcx)
ret
xor    %edx,%edx
div    %esi
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @_infix_operator_div_u32_u32(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = udiv i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_div_u32_u32(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = udiv i64 %0, %1
store i64 %4, i64* %2
ret void
}
int up8(int i) {
  int r;
  r = i % 8;
  if (r == 0)
    return i;
  return i + 8 - r;
}


x86 assembly (clang, -O0):
<up8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112a <up8+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <up8+0x36>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<up8>:
lea    0x7(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffffff8,%ecx
lea    0x8(%rcx),%eax
cmp    %ecx,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @up8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = srem i32 %5, 8
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 8
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @up8(i32 %0) {
%2 = srem i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, 8
%5 = sub i32 %4, %2
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(unsigned int);
main() {
  if (f((~0U) >> 1))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7fffffff,%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    $0x7fffffff,%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 2147483647)
%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 2147483647)
%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
}
int main() { return 1 < 1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_SEGV(void) {
  kill(getpid(), SIGSEGV);
  return 0;
}


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

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

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

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @gen_SEGV() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGSEGV
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ valid_digit(char const, int);
int is_number(const char *str) {
  int radix = 10;
  while (*str) {
    if (!valid_digit(*str, radix)) {
      return 0;
    }
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <is_number+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x14(%rbp),%esi
movsbl %al,%edi
call   1030 <valid_digit@plt>
cmp    $0x0,%eax
jne    1156 <is_number+0x46>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_number+0x5e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1123 <is_number+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     1150 <is_number+0x40>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
mov    $0xa,%esi
call   1030 <valid_digit@plt>
test   %eax,%eax
je     114e <is_number+0x3e>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_number+0x20>
jmp    1150 <is_number+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @valid_digit(i8 signext %8, i32 10)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int digitsum(int);
char droot(int n) {
  while (n >= 10)
    n = digitsum(n);
  return n;
}


x86 assembly (clang, -O0):
<droot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1135 <droot+0x25>
mov    -0x4(%rbp),%edi
call   1030 <digitsum@plt>
mov    %eax,-0x4(%rbp)
jmp    111b <droot+0xb>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<droot>:
push   %rax
mov    %edi,%eax
cmp    $0xa,%edi
jl     112c <droot+0x1c>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <digitsum@plt>
cmp    $0x9,%eax
jg     1120 <droot+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @droot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @digitsum(i32 %7)
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @droot(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = tail call i32 @digitsum(i32 %4)
%6 = icmp sgt i32 %5, 9
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
void putchar(char c) {}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *IoTHubAccount_GetDeviceId(void) {
  return getenv("IOTHUB_DEVICE_ID");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"IOTHUB_DEVICE_ID\00"
define i8* @IoTHubAccount_GetDeviceId() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [17 x i8] c"IOTHUB_DEVICE_ID\00"
define i8* @IoTHubAccount_GetDeviceId() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int pid;
  pid = fork();
  if (pid == 0) {
    for (;;)
      printf("je suis le fils\n");
  } else {
    for (;;)
      printf("je suis le père\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1160 <main+0x40>
jmp    114f <main+0x2f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0x2f>
jmp    1165 <main+0x45>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1165 <main+0x45>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     114a <main+0x2a>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <main+0x20>
lea    0xec0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [17 x i8] c"je suis le fils\0A\00"
@.str.1 = [18 x i8] c"je suis le p\C3\A8re\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
br label %11
11: ; preds = %11, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %11
13: ; preds = %2
br label %14
14: ; preds = %14, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %14
}

LLVM IR (-O2):
@str = [17 x i8] c"je suis le p\C3\A8re\00"
@str.2 = [16 x i8] c"je suis le fils\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2, %5
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
br label %5
7: ; preds = %2, %7
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %7
}
/* Type definitions */
typedef void ifaddrs;

/* Variables and functions */
scalar_t__ getifaddrs(void **);
struct ifaddrs *qs_getifaddrs() {
  struct ifaddrs *interfaces = (void *)0;
  if (getifaddrs(&interfaces) == 0) {
    return interfaces;
  } else {
    return (void *)0;
  }
}


x86 assembly (clang, -O0):
<qs_getifaddrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <getifaddrs@plt>
cmp    $0x0,%rax
jne    1140 <qs_getifaddrs+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <qs_getifaddrs+0x38>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qs_getifaddrs>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <getifaddrs@plt>
test   %rax,%rax
jne    112c <qs_getifaddrs+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifaddrs = type opaque
define %struct.ifaddrs* @qs_getifaddrs() {
%1 = alloca %struct.ifaddrs*
%2 = alloca %struct.ifaddrs*
store %struct.ifaddrs* null, %struct.ifaddrs** %2
%3 = bitcast %struct.ifaddrs** %2 to i8**
%4 = call i64 @getifaddrs(i8** %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load %struct.ifaddrs*, %struct.ifaddrs** %2
store %struct.ifaddrs* %7, %struct.ifaddrs** %1
br label %9
8: ; preds = %0
store %struct.ifaddrs* null, %struct.ifaddrs** %1
br label %9
9: ; preds = %8, %6
%10 = load %struct.ifaddrs*, %struct.ifaddrs** %1
ret %struct.ifaddrs* %10
}

LLVM IR (-O2):
%struct.ifaddrs = type opaque
define %struct.ifaddrs* @qs_getifaddrs() {
%1 = alloca %struct.ifaddrs*
%2 = bitcast %struct.ifaddrs** %1 to i8*
store %struct.ifaddrs* null, %struct.ifaddrs** %1
%3 = bitcast %struct.ifaddrs** %1 to i8**
%4 = call i64 @getifaddrs(i8** %3)
%5 = icmp eq i64 %4, 0
%6 = load %struct.ifaddrs*, %struct.ifaddrs** %1
%7 = select i1 %5, %struct.ifaddrs* %6, %struct.ifaddrs* null
ret %struct.ifaddrs* %7
}
float sqrf(float x) { return x * x; }


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

x86 assembly (clang, -O2):
<sqrf>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sqrf(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int Cyc_Character_isdigit(unsigned char c) { return c >= '0' ? c <= '9' : 0; }


x86 assembly (clang, -O0):
<Cyc_Character_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     112e <Cyc_Character_isdigit+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <Cyc_Character_isdigit+0x38>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <Cyc_Character_isdigit+0x38>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @Cyc_Character_isdigit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 57
%10 = zext i1 %9 to i32
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %6
%13 = phi i32 [ %10, %6 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Cyc_Character_isdigit(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void cli(void) { __asm__ __volatile__("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ od(void *, size_t, int /*<<< orphan*/, int);
void od_hex_dump(void *data, size_t data_len, uint8_t width) {
  od(data, data_len, width, (0x4000) | (0x0200) | (0x0010));
}


x86 assembly (clang, -O0):
<od_hex_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4210,%ecx
call   1030 <od@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_hex_dump>:
mov    $0x4210,%ecx
jmp    1030 <od@plt>

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

LLVM IR (-O2):
define void @od_hex_dump(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @od(i8* %0, i64 %1, i32 %2, i32 16912)
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? c + 65 : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x41(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 65
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 65
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}