#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int ext_nid;
};
typedef TYPE_1__ X509V3_EXT_METHOD;

/* Variables and functions */
int /*<<< orphan*/ X509V3_EXT_add(TYPE_1__ *);
int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist) {
  for (; extlist->ext_nid != -1; extlist++)
    if (!X509V3_EXT_add(extlist))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<X509V3_EXT_add_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     115d <X509V3_EXT_add_list+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <X509V3_EXT_add@plt>
cmp    $0x0,%eax
jne    1147 <X509V3_EXT_add_list+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1164 <X509V3_EXT_add_list+0x54>
jmp    114c <X509V3_EXT_add_list+0x3c>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <X509V3_EXT_add_list+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509V3_EXT_add_list>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmpl   $0xffffffff,(%rdi)
je     113a <X509V3_EXT_add_list+0x2a>
mov    %rdi,%rbx
mov    %rbx,%rdi
call   1030 <X509V3_EXT_add@plt>
test   %eax,%eax
je     1138 <X509V3_EXT_add_list+0x28>
cmpl   $0xffffffff,0x4(%rbx)
lea    0x4(%rbx),%rbx
jne    1120 <X509V3_EXT_add_list+0x10>
jmp    113a <X509V3_EXT_add_list+0x2a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @X509V3_EXT_add_list(%struct.TYPE_4__* %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %3
br label %4
4: ; preds = %15, %1
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%11 = call i32 @X509V3_EXT_add(%struct.TYPE_4__* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9
store i32 0, i32* %2
br label %19
14: ; preds = %9
br label %15
15: ; preds = %14
%16 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%17 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %16, i32 1
store %struct.TYPE_4__* %17, %struct.TYPE_4__** %3
br label %4
18: ; preds = %4
store i32 1, i32* %2
br label %19
19: ; preds = %18, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @X509V3_EXT_add_list(%struct.TYPE_4__* %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %14, label %9
9: ; preds = %1, %5
%10 = phi %struct.TYPE_4__* [ %13, %5 ], [ %0, %1 ]
%11 = tail call i32 @X509V3_EXT_add(%struct.TYPE_4__* %10)
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %1
%15 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %15
}