#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef TYPE_1__ *XdmAuthKeyPtr;
struct TYPE_3__ {
  int /*<<< orphan*/ *data;
};

/* Variables and functions */
void XdmcpDecrementKey(XdmAuthKeyPtr key) {
  int i;
  i = 7;
  while (key->data[i]-- == 0)
    if (--i < 0)
      break;
}


x86 assembly (clang, -O0):
<XdmcpDecrementKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%eax
mov    %eax,%esi
add    $0xffffffff,%esi
mov    %esi,(%rcx,%rdx,4)
cmp    $0x0,%eax
jne    114a <XdmcpDecrementKey+0x4a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1145 <XdmcpDecrementKey+0x45>
jmp    114a <XdmcpDecrementKey+0x4a>
jmp    110f <XdmcpDecrementKey+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<XdmcpDecrementKey>:
mov    (%rdi),%rax
subl   $0x1,0x1c(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0x18(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0x14(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0x10(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0xc(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0x8(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
subl   $0x1,0x4(%rax)
jae    1130 <XdmcpDecrementKey+0x30>
addl   $0xffffffff,(%rax)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32* }
define void @XdmcpDecrementKey(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
store i32 7, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, -1
store i32 %12, i32* %10
%13 = icmp eq i32 %11, 0
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %20
19: ; preds = %14
br label %4
20: ; preds = %18, %4
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32* }
define void @XdmcpDecrementKey(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = add nsw i32 %5, -1
store i32 %6, i32* %4
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %41
8: ; preds = %1
%9 = getelementptr inbounds i32, i32* %3, i64 6
%10 = load i32, i32* %9
%11 = add nsw i32 %10, -1
store i32 %11, i32* %9
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %41
13: ; preds = %8
%14 = getelementptr inbounds i32, i32* %3, i64 5
%15 = load i32, i32* %14
%16 = add nsw i32 %15, -1
store i32 %16, i32* %14
%17 = icmp eq i32 %15, 0
br i1 %17, label %18, label %41
18: ; preds = %13
%19 = getelementptr inbounds i32, i32* %3, i64 4
%20 = load i32, i32* %19
%21 = add nsw i32 %20, -1
store i32 %21, i32* %19
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %41
23: ; preds = %18
%24 = getelementptr inbounds i32, i32* %3, i64 3
%25 = load i32, i32* %24
%26 = add nsw i32 %25, -1
store i32 %26, i32* %24
%27 = icmp eq i32 %25, 0
br i1 %27, label %28, label %41
28: ; preds = %23
%29 = getelementptr inbounds i32, i32* %3, i64 2
%30 = load i32, i32* %29
%31 = add nsw i32 %30, -1
store i32 %31, i32* %29
%32 = icmp eq i32 %30, 0
br i1 %32, label %33, label %41
33: ; preds = %28
%34 = getelementptr inbounds i32, i32* %3, i64 1
%35 = load i32, i32* %34
%36 = add nsw i32 %35, -1
store i32 %36, i32* %34
%37 = icmp eq i32 %35, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i32, i32* %3
%40 = add nsw i32 %39, -1
store i32 %40, i32* %3
br label %41
41: ; preds = %38, %33, %28, %23, %18, %13, %8, %1
ret void
}