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


x86 assembly (clang, -O0):
<q1g>:
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    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
lea    0xec9(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rcx
mov    (%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx)
cmp    $0x5,%eax
jle    1192 <q1g+0x82>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1165 <q1g+0x55>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1g>:
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    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.q1g.a = [8 x i32] [i32 12, i32 10, i32 8, i32 6, i32 4, i32 3, i32 2, i32 1]
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1g ------\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @q1g() {
%1 = alloca [8 x i32]
%2 = alloca i32*
%3 = bitcast [8 x i32]* %1 to i8*
%4 = getelementptr inbounds [8 x i32], [8 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 = load i32, i32* %8
%10 = add nsw i32 %9, -1
store i32 %10, 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):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [11 x i8] c"q1g ------\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @q1g() {
%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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 9)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 7)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 6)
ret i32 1
}