#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);
int isprefix(char *, char *);
int main(int argc, char **argv) {
  assert(isprefix("foo", "foobar"));
  assert(isprefix("", "foobar"));
  assert(isprefix("foobar", "foobar"));
  assert(isprefix("", ""));
  assert(isprefix("f", "foorbar"));
  assert(!isprefix("foobar", "foo"));
  assert(!isprefix("goo", "foo"));
  assert(!isprefix("foo", ""));
  assert(!isprefix("f", "g"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xeb5(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe93(%rip),%rsi
mov    %rsi,%rdi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe85(%rip),%rsi
mov    %rsi,%rdi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe6e(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe4d(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1030 <isprefix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe39(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   1030 <isprefix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdff(%rip),%rdi
lea    0xe04(%rip),%rsi
call   1030 <isprefix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xde5(%rip),%rdi
lea    0xdec(%rip),%rsi
call   1030 <isprefix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r14
lea    0xece(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xebd(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %r12,%rdi
mov    %r12,%rsi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe7f(%rip),%r15
lea    0xe7a(%rip),%rsi
mov    %r15,%rdi
call   1030 <isprefix@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <isprefix@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe54(%rip),%rdi
mov    %r14,%rsi
call   1030 <isprefix@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <isprefix@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe24(%rip),%rsi
mov    %r15,%rdi
call   1030 <isprefix@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [7 x i8] c"foobar\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"f\00"
@.str.4 = [8 x i8] c"foorbar\00"
@.str.5 = [4 x i8] c"goo\00"
@.str.6 = [2 x i8] c"g\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @assert(i32 %6)
%8 = call i32 @isprefix(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @assert(i32 %8)
%10 = call i32 @isprefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @assert(i32 %10)
%12 = call i32 @isprefix(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @assert(i32 %12)
%14 = call i32 @isprefix(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @assert(i32 %14)
%16 = call i32 @isprefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @isprefix(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [7 x i8] c"foobar\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"f\00"
@.str.4 = [8 x i8] c"foorbar\00"
@.str.5 = [4 x i8] c"goo\00"
@.str.6 = [2 x i8] c"g\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @isprefix(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @isprefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @isprefix(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @isprefix(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @isprefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @isprefix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @isprefix(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
ret i32 0
}