#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 q1h() {
  int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  int *p;
  printf("\n%s\n", "q1h ------");
  for (p = a + 1; p < a + 8; p += 2) {
    printf("%d\n", *p);
  }
  return 1;
}


x86 assembly (clang, -O0):
<q1h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    0xee0(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
lea    -0x30(%rbp),%rcx
add    $0x20,%rcx
cmp    %rcx,%rax
jae    1198 <q1h+0x78>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
jmp    115e <q1h+0x3e>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1h>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.q1h.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1h ------\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @q1h() {
%1 = alloca [9 x i32]
%2 = alloca i32*
%3 = bitcast [9 x i32]* %1 to i8*
%4 = 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))
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32* %6, i32** %2
br label %7
7: ; preds = %16, %0
%8 = load i32*, i32** %2
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = icmp ult i32* %8, %10
br i1 %11, label %12, label %19
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 %16
16: ; preds = %12
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32* %18, i32** %2
br label %7
19: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1h ------\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @q1h() {
%1 = 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))
%2 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2)
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 6)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 1
}