#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int q1f() {
  int a[] = {9, 8, 7, 6, 5, 4, 3, 2, 1};
  int *p = a + 1;
  printf("\n%s\n", "q1f ------");
  while (*p++ > 5) {
    printf("%d\n", *p);
  }
  return 1;
}


x86 assembly (clang, -O0):
<q1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
lea    0xed4(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x38(%rbp)
cmpl   $0x5,(%rax)
jle    118f <q1f+0x6f>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <q1f+0x3e>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1f>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0xf03(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x6,0x8(%rsp)
jl     1195 <q1f+0x85>
lea    0xc(%rsp),%rbx
lea    0xec1(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x5,(%rbx)
lea    0x4(%rbx),%rbx
jg     1180 <q1f+0x70>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.q1f.a = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1f ------\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @q1f() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 7)
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 5
br i1 %7, label %8, label %17
8: ; preds = %0
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 3
br label %10
10: ; preds = %8, %10
%11 = phi i32* [ %9, %8 ], [ %14, %10 ]
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i32, i32* %11, i64 1
%15 = load i32, i32* %11
%16 = icmp sgt i32 %15, 5
br i1 %16, label %10, label %17
17: ; preds = %10, %0
ret i32 1
}