#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*/ assert(int /*<<< orphan*/);
int find_char(char **strings, int value) {
  assert(strings != NULL);
  while (*strings != NULL) {
    while (**strings != '\0') {
      if (*(*strings)++ == value)
        return 1;
    }
    strings++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1196 <find_char+0x86>
jmp    1144 <find_char+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1185 <find_char+0x75>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1180 <find_char+0x70>
movl   $0x1,-0x4(%rbp)
jmp    119d <find_char+0x8d>
jmp    1144 <find_char+0x34>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1131 <find_char+0x21>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     115c <find_char+0x4c>
cmpb   $0x0,(%rcx)
je     1148 <find_char+0x38>
lea    0x1(%rcx),%rdx
mov    %rdx,(%rbx)
movsbl (%rcx),%esi
mov    %rdx,%rcx
cmp    %ebp,%esi
jne    1130 <find_char+0x20>
jmp    1157 <find_char+0x47>
mov    0x8(%rbx),%rcx
add    $0x8,%rbx
test   %rcx,%rcx
jne    1130 <find_char+0x20>
jmp    115c <find_char+0x4c>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @find_char(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%6 = load i8**, i8*** %4
%7 = icmp ne i8** %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
br label %10
10: ; preds = %31, %2
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %34
14: ; preds = %10
br label %15
15: ; preds = %30, %14
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %15
%22 = load i8**, i8*** %4
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %22
%25 = load i8, i8* %23
%26 = sext i8 %25 to i32
%27 = load i32, i32* %5
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 1, i32* %3
br label %35
30: ; preds = %21
br label %15
31: ; preds = %15
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i32 1
store i8** %33, i8*** %4
br label %10
34: ; preds = %10
store i32 0, i32* %3
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @find_char(i8** %0, i32 %1) {
%3 = icmp ne i8** %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %24, label %8
8: ; preds = %2, %20
%9 = phi i8* [ %22, %20 ], [ %6, %2 ]
%10 = phi i8** [ %21, %20 ], [ %0, %2 ]
br label %11
11: ; preds = %8, %15
%12 = phi i8* [ %9, %8 ], [ %16, %15 ]
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %16, i8** %10
%17 = load i8, i8* %12
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, %1
br i1 %19, label %24, label %11
20: ; preds = %11
%21 = getelementptr inbounds i8*, i8** %10, i64 1
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %8
24: ; preds = %20, %15, %2
%25 = phi i32 [ 0, %2 ], [ 1, %15 ], [ 0, %20 ]
ret i32 %25
}