xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_num_char(int /*<<< orphan*/);
int is_num_str(char *input_str) {
  int is_a_num = 1;
  if (input_str == 0)
    is_a_num = 0;
  while (*input_str) {
    if (is_num_char(*input_str++)) {
      continue;
    }
    is_a_num = 0;
    break;
  }
  return is_a_num;
}


x86 assembly (clang, -O0):
<is_num_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <is_num_str+0x25>
movl   $0x0,-0xc(%rbp)
jmp    113a <is_num_str+0x2a>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <is_num_str+0x64>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <is_num_char@plt>
cmp    $0x0,%rax
je     116d <is_num_str+0x5d>
jmp    113a <is_num_str+0x2a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
test   %rdi,%rdi
setne  %bpl
nop
movsbl (%rbx),%edi
test   %edi,%edi
je     1137 <is_num_str+0x27>
add    $0x1,%rbx
call   1030 <is_num_char@plt>
test   %rax,%rax
jne    1120 <is_num_str+0x10>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_num_str(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
br label %4
4: ; preds = %8, %1
%5 = phi i8* [ %0, %1 ], [ %9, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = sext i8 %6 to i32
%11 = tail call i64 @is_num_char(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %8, %4
%14 = phi i32 [ %3, %4 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ integer(float);
int divisor(float a, float b) {
  bool result = 0;
  if (integer(b / a))
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<divisor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
call   1030 <integer@plt>
cmp    $0x0,%rax
je     1149 <divisor+0x39>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisor>:
push   %rax
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <integer@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @divisor(float %0, float %1) {
%3 = fdiv float %1, %0
%4 = tail call i64 @integer(float %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int main(argc, argv)
int argc;
char *argv[];
{
  char *pn;
  if ((pn = (char *)strrchr(argv[0], '/')))
    pn++;
  else
    pn = argv[0];
  (void)printf("%s ... %s\n", pn, "this test does not run on this dialect.");
  exit(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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1176 <main+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1181 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe74(%rip),%rdi
lea    0xe78(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
lea    0xead(%rip),%rdi
lea    0xeb1(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s ... %s\0A\00"
@.str.1 = [40 x i8] c"this test does not run on this dialect.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i8* @strrchr(i8* %9, i32 47)
store i8* %10, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %6
br label %19
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
store i8* %18, i8** %6
br label %19
19: ; preds = %15, %12
%20 = load i8*, i8** %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s ... %s\0A\00"
@.str.1 = [40 x i8] c"this test does not run on this dialect.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %3, i32 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %3, i8* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
double libballistics_computeEnergy(double velocity, double bulletWeight) {
  return bulletWeight * (velocity * velocity) / (2 * -(-32.194) * 7000);
}


x86 assembly (clang, -O0):
<libballistics_computeEnergy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<libballistics_computeEnergy>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @libballistics_computeEnergy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fmul double %5, %8
%10 = fdiv double %9, 0x411B827000000001
ret double %10
}

LLVM IR (-O2):
define double @libballistics_computeEnergy(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %3, %1
%5 = fdiv double %4, 0x411B827000000001
ret double %5
}
int _muldiv(int a, int b, int c) {
  return ((unsigned long long)a * (unsigned long long)b) / c;
}


x86 assembly (clang, -O0):
<_muldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_muldiv>:
mov    %edx,%ecx
movslq %edi,%rdx
movslq %esi,%rax
imul   %rdx,%rax
movslq %ecx,%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1121 <_muldiv+0x21>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i32 @_muldiv(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = mul i64 %8, %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = udiv i64 %11, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @_muldiv(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = sext i32 %1 to i64
%6 = mul nsw i64 %5, %4
%7 = sext i32 %2 to i64
%8 = udiv i64 %6, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_memory(void const *data, size_t len) {
  if (0) {
    size_t i;
    printf("Data in [%p..%p): ", data, data + len);
    for (i = 0; i < len; i++) {
      printf("%02X ", ((unsigned char *)data)[i]);
    }
    printf("\n");
  }
  return;
}


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

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

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

LLVM IR (-O2):
define void @dump_memory(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newln(int);
int /*<<< orphan*/ printstr(char *);
int /*<<< orphan*/ setcurs(int, int);
void printhelp(int x, int y) {
  setcurs(x, y);
  printstr("ESC to clear, TAB to skip,");
  newln(x);
  printstr("ENTER to return");
}


x86 assembly (clang, -O0):
<printhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <setcurs@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printstr@plt>
mov    -0x4(%rbp),%edi
call   1030 <newln@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhelp>:
push   %rbx
mov    %edi,%ebx
call   1050 <setcurs@plt>
lea    0xec1(%rip),%rdi
call   1040 <printstr@plt>
mov    %ebx,%edi
call   1030 <newln@plt>
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1040 <printstr@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"ESC to clear, TAB to skip,\00"
@.str.1 = [16 x i8] c"ENTER to return\00"
define void @printhelp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @setcurs(i32 %5, i32 %6)
%8 = call i32 @printstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = call i32 @newln(i32 %9)
%11 = call i32 @printstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"ESC to clear, TAB to skip,\00"
@.str.1 = [16 x i8] c"ENTER to return\00"
define void @printhelp(i32 %0, i32 %1) {
%3 = tail call i32 @setcurs(i32 %0, i32 %1)
%4 = tail call i32 @printstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @newln(i32 %0)
%6 = tail call i32 @printstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char prompt_double(void) {
  char temp_value = '\0';
  printf("Is the bread double sized (y = yes, n = no) ?");
  scanf(" %c", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_double>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Is the bread double sized (y = yes, n = no) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_double() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [46 x i8] c"Is the bread double sized (y = yes, n = no) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_double() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
int hash(int key, int size) { return (key & 0x7FFFFFFF) % size; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
and    $0x7fffffff,%eax
xor    %edx,%edx
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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 = and i32 %5, 2147483647
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = and i32 %0, 2147483647
%4 = srem i32 %3, %1
ret i32 %4
}
void server_error(const char *msg) {
  internal_logit(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c",
      810, __FUNCTION__, "ERROR: %s", msg);
  add_event_all(0x04, msg);
}


x86 assembly (clang, -O0):
<server_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
lea    0xec9(%rip),%rdi
mov    $0x32a,%esi
lea    0xf45(%rip),%rdx
lea    0xf4b(%rip),%rcx
mov    $0x0,%al
call   1040 <internal_logit@plt>
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <add_event_all@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xf56(%rip),%rdx
lea    0xf5c(%rip),%rcx
mov    $0x32a,%esi
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <internal_logit@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <add_event_all@plt>

LLVM IR (-O0):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c\00"
@__FUNCTION__.server_error = [13 x i8] c"server_error\00"
@.str.1 = [10 x i8] c"ERROR: %s\00"
define void @server_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.server_error, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @add_event_all to i32 (i32, i8*, ...)*)(i32 4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c\00"
@__FUNCTION__.server_error = [13 x i8] c"server_error\00"
@.str.1 = [10 x i8] c"ERROR: %s\00"
define void @server_error(i8* %0) {
%2 = tail call i32 (i8*, i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.server_error, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @add_event_all to i32 (i32, i8*, ...)*)(i32 4, i8* %0)
ret void
}
void __attribute__((no)) hiphip(void (*f)()) { f(); }


x86 assembly (clang, -O0):
<hiphip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiphip>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @hiphip(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
unsigned long long rdtsc(void) {
  unsigned long low, high;
  asm volatile("mfence\n\t"
               "rdtsc\n\t"
               "mfence\n\t"
               : "=a"(low), "=d"(high));
  return ((low) | (high) << 32);
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
mfence
rdtsc
mfence
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
mfence
rdtsc
mfence
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "mfence\0A\09rdtsc\0A\09mfence\0A\09", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = shl i64 %7, 32
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "mfence\0A\09rdtsc\0A\09mfence\0A\09", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
double isfinite(double);
double function_isfinite(double x) { return isfinite(x); }


x86 assembly (clang, -O0):
<function_isfinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isfinite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_isfinite>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define double @function_isfinite(double %0) {
%2 = tail call double @isfinite(double %0)
ret double %2
}
double get_time_factor_of_use(double global_improvement,
                              double local_improvement) {
  return (1 - global_improvement) /
         (-global_improvement + (global_improvement / local_improvement));
}


x86 assembly (clang, -O0):
<get_time_factor_of_use>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x8(%rbp),%xmm2
divsd  -0x10(%rbp),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_factor_of_use>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm1,%xmm3
subsd  %xmm0,%xmm3
divsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @get_time_factor_of_use(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fsub double 1.000000e+00, %5
%7 = load double, double* %3
%8 = fneg double %7
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fdiv double %9, %10
%12 = fadd double %8, %11
%13 = fdiv double %6, %12
ret double %13
}

LLVM IR (-O2):
define double @get_time_factor_of_use(double %0, double %1) {
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %0, %1
%5 = fsub double %4, %0
%6 = fdiv double %3, %5
ret double %6
}
int test(int a, int b, int c) {
  if (a == 10 || a == 12)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1121 <test+0x21>
cmpl   $0xc,-0x8(%rbp)
jne    112c <test+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <test+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %esi,%eax
cmp    $0xa,%edi
je     110c <test+0xc>
cmp    $0xc,%edi
jne    110d <test+0xd>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %4 [
i32 12, label %5
i32 10, label %5
]
4: ; preds = %3
br label %5
5: ; preds = %3, %3, %4
%6 = phi i32 [ %2, %4 ], [ %1, %3 ], [ %1, %3 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void one(void (*a)(void)) {
  glEnable(GL_DEPTH_TEST);
  a();
  glDisable(GL_DEPTH_TEST);
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
call   *-0x8(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
call   1030 <glEnable@plt>
call   *%rbx
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
define void @one(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = call i32 @glEnable(i32 %3)
%5 = load void ()*, void ()** %2
%6 = load i32, i32* @GL_DEPTH_TEST
%7 = call i32 @glDisable(i32 %6)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
define void @one(void ()* nocapture %0) {
%2 = load i32, i32* @GL_DEPTH_TEST
%3 = tail call i32 @glEnable(i32 %2)
tail call void %0()
%4 = load i32, i32* @GL_DEPTH_TEST
%5 = tail call i32 @glDisable(i32 %4)
ret void
}
void mem_trim(void) {}


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

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

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

LLVM IR (-O2):
define void @mem_trim() {
ret void
}
int venc_init(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @venc_init(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int c_strcmp0(const char *str1, const char *str2) {
  if (!str1) {
    if (!str2)
      return 0;
    return -1;
  }
  if (!str2)
    return 1;
  return strcmp(str1, str2);
}


x86 assembly (clang, -O0):
<c_strcmp0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <c_strcmp0+0x3e>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <c_strcmp0+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1175 <c_strcmp0+0x65>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <c_strcmp0+0x65>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <c_strcmp0+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1175 <c_strcmp0+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strcmp0>:
test   %rdi,%rdi
je     111f <c_strcmp0+0xf>
test   %rsi,%rsi
je     1125 <c_strcmp0+0x15>
jmp    1030 <strcmp@plt>
neg    %rsi
sbb    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @c_strcmp0(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp ne i8* %1, null
%6 = sext i1 %5 to i32
br label %11
7: ; preds = %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %11
11: ; preds = %7, %4, %9
%12 = phi i32 [ %10, %9 ], [ %6, %4 ], [ 1, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ glinject_handle_x11_event(int /*<<< orphan*/ *);
int glinject_real_XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int XNextEvent(Display *dpy, XEvent *event) {
  int return_val;
  do {
    return_val = glinject_real_XNextEvent(dpy, event);
  } while (glinject_handle_x11_event(event));
  return return_val;
}


x86 assembly (clang, -O0):
<XNextEvent>:
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 <glinject_real_XNextEvent@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <glinject_handle_x11_event@plt>
cmp    $0x0,%rax
jne    1130 <XNextEvent+0x10>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNextEvent>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <glinject_real_XNextEvent@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <glinject_handle_x11_event@plt>
test   %rax,%rax
jne    1130 <XNextEvent+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @XNextEvent(i32* %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @glinject_real_XNextEvent(i32* %0, i32* %1)
%5 = tail call i64 @glinject_handle_x11_event(i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int smallest_diff(int *, int, int *, int);
int test_unsorted() {
  int a[] = {23, 65, 2, 18, 5};
  int b[] = {55, 19, 13, 42};
  return 1 == smallest_diff(a, 5, b, 4);
}


x86 assembly (clang, -O0):
<test_unsorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <smallest_diff@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unsorted>:
sub    $0x38,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <smallest_diff@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_unsorted.a = [5 x i32] [i32 23, i32 65, i32 2, i32 18, i32 5]
@__const.test_unsorted.b = [4 x i32] [i32 55, i32 19, i32 13, i32 42]
define i32 @test_unsorted() {
%1 = alloca [5 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @smallest_diff(i32* %5, i32 5, i32* %6, i32 4)
%8 = icmp eq i32 1, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@__const.test_unsorted.a = [5 x i32] [i32 23, i32 65, i32 2, i32 18, i32 5]
@__const.test_unsorted.b = [4 x i32] [i32 55, i32 19, i32 13, i32 42]
define i32 @test_unsorted() {
%1 = alloca [5 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @smallest_diff(i32* %5, i32 5, i32* %6, i32 4)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct NotificationQueue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ notificationQueueClear(struct NotificationQueue *);
void notificationQueueDelete(struct NotificationQueue *notificationQueue) {
  notificationQueueClear(notificationQueue);
}


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

x86 assembly (clang, -O2):
<notificationQueueDelete>:
jmp    1030 <notificationQueueClear@plt>

LLVM IR (-O0):
%struct.NotificationQueue = type { i32 }
define void @notificationQueueDelete(%struct.NotificationQueue* %0) {
%2 = alloca %struct.NotificationQueue*
store %struct.NotificationQueue* %0, %struct.NotificationQueue** %2
%3 = load %struct.NotificationQueue*, %struct.NotificationQueue** %2
%4 = call i32 @notificationQueueClear(%struct.NotificationQueue* %3)
ret void
}

LLVM IR (-O2):
%struct.NotificationQueue = type { i32 }
define void @notificationQueueDelete(%struct.NotificationQueue* %0) {
%2 = tail call i32 @notificationQueueClear(%struct.NotificationQueue* %0)
ret void
}
/* Variables and functions */
int opd_read_fs_int(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *, int);
void print_if(char const *fmt, char const *path, char const *filename,
              int force) {
  int value = opd_read_fs_int(path, filename, 0);
  if (value != -1 || force)
    printf(fmt, value);
}


x86 assembly (clang, -O0):
<print_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <opd_read_fs_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    115d <print_if+0x3d>
cmpl   $0x0,-0x1c(%rbp)
je     1169 <print_if+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_if>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
xor    %edx,%edx
call   1040 <opd_read_fs_int@plt>
test   %ebp,%ebp
jne    1145 <print_if+0x25>
cmp    $0xffffffff,%eax
jne    1145 <print_if+0x25>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @print_if(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @opd_read_fs_int(i8* %1, i8* %2, i32 0)
%6 = icmp ne i32 %5, -1
%7 = icmp ne i32 %3, 0
%8 = or i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @printf(i8* %0, i32 %5)
br label %11
11: ; preds = %4, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int write(int, char const *, int);
void send_data(int socketfd, const char *data, int length) {
  int length2;
  length2 = write(socketfd, data, length);
  if (length2 != length)
    fprintf(stderr, "*** write truncated to %d chars...\n", length2);
}


x86 assembly (clang, -O0):
<send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1168 <send_data+0x48>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_data>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
jne    112e <send_data+0xe>
pop    %rbx
ret
mov    0x2eab(%rip),%rcx
mov    (%rcx),%edi
lea    0xec2(%rip),%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"*** write truncated to %d chars...\0A\00"
define void @send_data(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = load i32, i32* %7
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"*** write truncated to %d chars...\0A\00"
define void @send_data(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %6, %3
ret void
}
void swap(void **a, void **b) {
  void *tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(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** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Type definitions */
struct tm {
  scalar_t__ tm_wday;
};

/* Variables and functions */
struct tm *time_get_localtime(int /*<<< orphan*/);
int /*<<< orphan*/ time_get_timestamp();
unsigned long time_get_week_day(void) {
  const struct tm *const date = time_get_localtime(time_get_timestamp());
  return (unsigned long)date->tm_wday;
}


x86 assembly (clang, -O0):
<time_get_week_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <time_get_timestamp@plt>
mov    %eax,%edi
call   1040 <time_get_localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_get_week_day>:
push   %rax
xor    %eax,%eax
call   1030 <time_get_timestamp@plt>
mov    %eax,%edi
call   1040 <time_get_localtime@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i64 }
define i64 @time_get_week_day() {
%1 = alloca %struct.tm*
%2 = call i32 (...) @time_get_timestamp()
%3 = call %struct.tm* @time_get_localtime(i32 %2)
store %struct.tm* %3, %struct.tm** %1
%4 = load %struct.tm*, %struct.tm** %1
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
%struct.tm = type { i64 }
define i64 @time_get_week_day() {
%1 = tail call i32 (...) @time_get_timestamp()
%2 = tail call %struct.tm* @time_get_localtime(i32 %1)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}
int isspace(int c) { return (c >= 0x09 && c <= 0x1F); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isspace+0x20>
cmpl   $0x1f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x17,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 23
%4 = zext i1 %3 to i32
ret i32 %4
}
void ata_noop_dev_select(struct ata_port *ap, unsigned int device) {
  { return; }
}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_noop_dev_select(%struct.ata_port* nocapture %0, i32 %1) {
ret void
}
int Compare(const void *letterA, const void *letterB) {
  return (*(char *)letterA) - (*(char *)letterB);
}


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

x86 assembly (clang, -O2):
<Compare>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ malloc(size_t);
void *cTools_memAlloc(size_t sizeInBytes) {
  return ((void *)malloc(sizeInBytes));
}


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

x86 assembly (clang, -O2):
<cTools_memAlloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @cTools_memAlloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cTools_memAlloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void do_nothing() {
  int i;
  i = 0;
}


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

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

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

LLVM IR (-O2):
define void @do_nothing() {
ret void
}
__attribute__((always_)) void module_update_tracepoints(void) {}


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

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

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

LLVM IR (-O2):
define void @module_update_tracepoints() {
ret void
}
__typeof__(tolower("")) test_tolower_74(void) { return tolower(""); }


x86 assembly (clang, -O0):
<test_tolower_74>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <tolower@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_tolower_74() {
%1 = call i32 @tolower(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_tolower_74() {
%1 = tail call i32 @tolower(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
int checkComment(char *x) {
  if (x[0] == '.')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkComment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1124 <checkComment+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <checkComment+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkComment>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @checkComment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 46
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @checkComment(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
double mjd2ep(dj)
double dj;
{
  double date, time;
  jd2dt(dj + 2400000.5, &date, &time);
  return (dt2ep(date, time));
}


x86 assembly (clang, -O0):
<mjd2ep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x1,%al
call   1040 <jd2dt@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2ep@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd2ep>:
sub    $0x18,%rsp
addsd  0xed4(%rip),%xmm0
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%al
call   1040 <jd2dt@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1030 <dt2ep@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @mjd2ep(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fadd double %5, 0x41424F8040000000
%7 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @jd2dt to i32 (double, double*, double*, ...)*)(double %6, double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ep to i32 (double, double, ...)*)(double %8, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @mjd2ep(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = fadd double %0, 0x41424F8040000000
%7 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @jd2dt to i32 (double, double*, double*, ...)*)(double %6, double* %2, double* %3)
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ep to i32 (double, double, ...)*)(double %8, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kthlargeutil(struct node *, int, int);
void kthlarge(struct node *root, int k) {
  static int c = 0;
  kthlargeutil(root, k, c);
}


x86 assembly (clang, -O0):
<kthlarge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2f00(%rip),%edx
call   1030 <kthlargeutil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kthlarge>:
xor    %edx,%edx
jmp    1030 <kthlargeutil@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
@kthlarge.c = internal global i32 0
define void @kthlarge(%struct.node* %0, i32 %1) {
%3 = alloca %struct.node*
%4 = alloca i32
store %struct.node* %0, %struct.node** %3
store i32 %1, i32* %4
%5 = load %struct.node*, %struct.node** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @kthlarge.c
%8 = call i32 @kthlargeutil(%struct.node* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @kthlarge(%struct.node* %0, i32 %1) {
%3 = tail call i32 @kthlargeutil(%struct.node* %0, i32 %1, i32 0)
ret void
}