#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 */
struct record_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ record_match(struct record_t *, char *);
bool record_match_all(struct record_t *re, char **matches) {
  while (*matches != NULL) {
    if (!record_match(re, *matches))
      return false;
    matches++;
  }
  return true;
}


x86 assembly (clang, -O0):
<record_match_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <record_match_all+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <record_match@plt>
cmp    $0x0,%eax
jne    1153 <record_match_all+0x43>
movl   $0x0,-0x4(%rbp)
jmp    116b <record_match_all+0x5b>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <record_match_all+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<record_match_all>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rsi
mov    $0x1,%r14d
test   %rsi,%rsi
je     114d <record_match_all+0x3d>
mov    %rdi,%rbp
add    $0x8,%rbx
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1030 <record_match@plt>
test   %eax,%eax
je     114a <record_match_all+0x3a>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <record_match_all+0x20>
jmp    114d <record_match_all+0x3d>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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