#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 */
char strlen(char *);
char IsItDiscovered(char Discover[], char MotSecret[]) {
  char i = 0, ok = 1;
  for (i = 0; i < strlen(MotSecret); i++) {
    if (Discover[i] == 0) {
      ok = 0;
    }
  }
  return ok;
}


x86 assembly (clang, -O0):
<IsItDiscovered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0x1,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,%cl
mov    -0x18(%rbp),%eax
movsbl %cl,%ecx
cmp    %ecx,%eax
jge    1178 <IsItDiscovered+0x68>
mov    -0x8(%rbp),%rax
movsbq -0x11(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1166 <IsItDiscovered+0x56>
movb   $0x0,-0x12(%rbp)
jmp    116b <IsItDiscovered+0x5b>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    112c <IsItDiscovered+0x1c>
movsbl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsItDiscovered>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    $0x1,%bpl
test   %al,%al
jle    1162 <IsItDiscovered+0x52>
xor    %r15d,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%r14,%rbx,1)
movzbl %bpl,%ebp
cmove  %r15d,%ebp
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
movsbq %al,%rax
cmp    %rax,%rbx
jl     1140 <IsItDiscovered+0x30>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @IsItDiscovered(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 0, i8* %5
store i8 1, i8* %6
store i8 0, i8* %5
br label %7
7: ; preds = %24, %2
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = call signext i8 @strlen(i8* %10)
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %9, %12
br i1 %13, label %14, label %27
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = load i8, i8* %5
%17 = sext i8 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %14
store i8 0, i8* %6
br label %23
23: ; preds = %22, %14
br label %24
24: ; preds = %23
%25 = load i8, i8* %5
%26 = add i8 %25, 1
store i8 %26, i8* %5
br label %7
27: ; preds = %7
%28 = load i8, i8* %6
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @IsItDiscovered(i8* nocapture %0, i8* %1) {
%3 = tail call signext i8 @strlen(i8* %1)
%4 = icmp sgt i8 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ 1, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i8 0, i8 %7
%12 = add nuw nsw i64 %6, 1
%13 = tail call signext i8 @strlen(i8* %1)
%14 = sext i8 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %5, label %16
16: ; preds = %5, %2
%17 = phi i8 [ 1, %2 ], [ %11, %5 ]
ret i8 %17
}