#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int GLuint;
typedef int GLint;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void processHits(GLint hits, GLuint buffer[]) {
  int i, j, names;
  GLuint *ptr;
  printf("hits = %d\n", hits);
  ptr = (GLuint *)buffer;
  for (i = 0; i < hits; i++) {
    names = (int)*ptr;
    printf(" number of names for hit = %d\n", names);
    ptr++;
    printf("  z1 is %g;", (float)*ptr / 0x7fffffff);
    ptr++;
    printf(" z2 is %g\n", (float)*ptr / 0x7fffffff);
    ptr++;
    printf("   the name is ");
    for (j = 0; j < names; j++) {
      printf("%d ", *ptr);
      ptr++;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<processHits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1240 <processHits+0x130>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xe7f(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xe4d(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1224 <processHits+0x114>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ea <processHits+0xda>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <processHits+0x2f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processHits>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    120b <processHits+0xeb>
lea    0xef6(%rip),%r13
lea    0xeff(%rip),%r14
xor    %r12d,%r12d
jmp    1177 <processHits+0x57>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    %ebp,%r12d
je     120b <processHits+0xeb>
mov    (%rbx),%r15d
lea    0xe8e(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ssl 0x4(%rbx),%xmm0
movss  0xe65(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe84(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ssl 0x8(%rbx),%xmm0
mulss  0xe3f(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0xc,%rbx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    1160 <processHits+0x40>
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
add    $0xffffffff,%r15d
jne    11f0 <processHits+0xd0>
jmp    1160 <processHits+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hits = %d\0A\00"
@.str.1 = [31 x i8] c" number of names for hit = %d\0A\00"
@.str.2 = [12 x i8] c" z1 is %g;\00"
@.str.3 = [11 x i8] c" z2 is %g\0A\00"
@.str.4 = [16 x i8] c" the name is \00"
@.str.5 = [4 x i8] c"%d \00"
@.str.6 = [2 x i8] c"\0A\00"
define void @processHits(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %4
store i32* %11, i32** %8
store i32 0, i32* %5
br label %12
12: ; preds = %55, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %58
16: ; preds = %12
%17 = load i32*, i32** %8
%18 = load i32, i32* %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32*, i32** %8
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %8
%23 = load i32*, i32** %8
%24 = load i32, i32* %23
%25 = sitofp i32 %24 to float
%26 = fdiv float %25, 0x41E0000000000000
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %27)
%29 = load i32*, i32** %8
%30 = getelementptr inbounds i32, i32* %29, i32 1
store i32* %30, i32** %8
%31 = load i32*, i32** %8
%32 = load i32, i32* %31
%33 = sitofp i32 %32 to float
%34 = fdiv float %33, 0x41E0000000000000
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %35)
%37 = load i32*, i32** %8
%38 = getelementptr inbounds i32, i32* %37, i32 1
store i32* %38, i32** %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %40
40: ; preds = %50, %16
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %53
44: ; preds = %40
%45 = load i32*, i32** %8
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = load i32*, i32** %8
%49 = getelementptr inbounds i32, i32* %48, i32 1
store i32* %49, i32** %8
br label %50
50: ; preds = %44
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %40
53: ; preds = %40
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %12
58: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"hits = %d\0A\00"
@.str.1 = [31 x i8] c" number of names for hit = %d\0A\00"
@.str.2 = [12 x i8] c" z1 is %g;\00"
@.str.3 = [11 x i8] c" z2 is %g\0A\00"
@.str.4 = [16 x i8] c" the name is \00"
@.str.5 = [4 x i8] c"%d \00"
define void @processHits(i32 %0, i32* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %38
5: ; preds = %2, %33
%6 = phi i32* [ %34, %33 ], [ %1, %2 ]
%7 = phi i32 [ %36, %33 ], [ 0, %2 ]
%8 = load i32, i32* %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to float
%13 = fmul float %12, 0x3E00000000000000
%14 = fpext float %13 to double
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = getelementptr inbounds i32, i32* %6, i64 2
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to float
%19 = fmul float %18, 0x3E00000000000000
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %20)
%22 = getelementptr inbounds i32, i32* %6, i64 3
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp sgt i32 %8, 0
br i1 %24, label %25, label %33
25: ; preds = %5, %25
%26 = phi i32* [ %30, %25 ], [ %22, %5 ]
%27 = phi i32 [ %31, %25 ], [ 0, %5 ]
%28 = load i32, i32* %26
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i32, i32* %26, i64 1
%31 = add nuw nsw i32 %27, 1
%32 = icmp eq i32 %31, %8
br i1 %32, label %33, label %25
33: ; preds = %25, %5
%34 = phi i32* [ %22, %5 ], [ %30, %25 ]
%35 = tail call i32 @putchar(i32 10)
%36 = add nuw nsw i32 %7, 1
%37 = icmp eq i32 %36, %0
br i1 %37, label %38, label %5
38: ; preds = %33, %2
ret void
}