#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 __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int substring(char *, char *);
int main() {
  int length1 = __VERIFIER_nondet_int();
  int length2 = __VERIFIER_nondet_int();
  if (length1 < 1) {
    length1 = 1;
  }
  if (length2 < 1) {
    length2 = 1;
  }
  char *nondetString1 = (char *)alloca(length1 * sizeof(char));
  char *nondetString2 = (char *)alloca(length2 * sizeof(char));
  nondetString1[length1 - 1] = '\0';
  nondetString2[length2 - 1] = '\0';
  return substring(nondetString1, nondetString2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1164 <main+0x34>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1175 <main+0x45>
movl   $0x1,-0xc(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <substring@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %r14d,%r14d
mov    $0x1,%ebx
cmovle %ebx,%r14d
test   %eax,%eax
cmovg  %eax,%ebx
mov    %r14d,%edi
call   1040 <alloca@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1040 <alloca@plt>
add    $0xffffffff,%r14d
movb   $0x0,(%r15,%r14,1)
add    $0xffffffff,%ebx
movb   $0x0,(%rax,%rbx,1)
mov    %r15,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <substring@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %2
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %2
br label %11
11: ; preds = %10, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i64 @alloca(i32 %19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %4
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = mul i64 %23, 1
%25 = trunc i64 %24 to i32
%26 = call i64 @alloca(i32 %25)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %5
%28 = load i8*, i8** %4
%29 = load i32, i32* %2
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
store i8 0, i8* %32
%33 = load i8*, i8** %5
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
store i8 0, i8* %37
%38 = load i8*, i8** %4
%39 = load i8*, i8** %5
%40 = call i32 @substring(i8* %38, i8* %39)
ret i32 %40
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %1, 1
%4 = select i1 %3, i32 %1, i32 1
%5 = icmp sgt i32 %2, 1
%6 = select i1 %5, i32 %2, i32 1
%7 = tail call i64 @alloca(i32 %4)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i64 @alloca(i32 %6)
%10 = inttoptr i64 %9 to i8*
%11 = add nsw i32 %4, -1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
%14 = add nsw i32 %6, -1
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %10, i64 %15
store i8 0, i8* %16
%17 = tail call i32 @substring(i8* %8, i8* %10)
ret i32 %17
}