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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    116e <main+0x3e>
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    117f <main+0x4f>
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    1190 <main+0x60>
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     11ab <main+0x7b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b7 <main+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1213 <main+0xe3>
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <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    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <cstrcat@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %r15d,%r15d
mov    $0x1,%ebx
cmovle %ebx,%r15d
cmp    $0x3,%r14d
mov    $0x2,%ebp
cmovge %r14d,%ebp
test   %eax,%eax
cmovg  %eax,%ebx
mov    %ebp,%eax
sub    %ebx,%eax
jb     11a8 <main+0x78>
cmp    %r15d,%eax
jl     11a8 <main+0x78>
mov    %r15d,%edi
call   1030 <alloca@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1030 <alloca@plt>
add    $0xffffffff,%r15d
movb   $0x0,(%r14,%r15,1)
add    $0xffffffff,%ebx
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <cstrcat@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %2
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %3
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %0
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %4
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = sub nsw i32 %22, %23
%25 = load i32, i32* %2
%26 = icmp slt i32 %24, %25
br i1 %26, label %31, label %27
27: ; preds = %21
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %27, %21
store i32 0, i32* %1
br label %58
32: ; preds = %27
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 1
%36 = trunc i64 %35 to i32
%37 = call i64 @alloca(i32 %36)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %5
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 1
%42 = trunc i64 %41 to i32
%43 = call i64 @alloca(i32 %42)
%44 = inttoptr i64 %43 to i8*
store i8* %44, i8** %6
%45 = load i8*, i8** %5
%46 = load i32, i32* %2
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %45, i64 %48
store i8 0, i8* %49
%50 = load i8*, i8** %6
%51 = load i32, i32* %4
%52 = sub nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %50, i64 %53
store i8 0, i8* %54
%55 = load i8*, i8** %6
%56 = load i8*, i8** %5
%57 = call i32 @cstrcat(i8* %55, i8* %56)
store i32 0, i32* %1
br label %58
58: ; preds = %32, %31
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = icmp sgt i32 %1, 1
%5 = select i1 %4, i32 %1, i32 1
%6 = icmp sgt i32 %2, 2
%7 = select i1 %6, i32 %2, i32 2
%8 = icmp sgt i32 %3, 1
%9 = select i1 %8, i32 %3, i32 1
%10 = sub nsw i32 %7, %9
%11 = icmp slt i32 %10, %5
%12 = icmp ult i32 %7, %9
%13 = or i1 %12, %11
br i1 %13, label %26, label %14
14: ; preds = %0
%15 = tail call i64 @alloca(i32 %5)
%16 = inttoptr i64 %15 to i8*
%17 = tail call i64 @alloca(i32 %7)
%18 = inttoptr i64 %17 to i8*
%19 = add nsw i32 %5, -1
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8 0, i8* %21
%22 = add nsw i32 %9, -1
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %18, i64 %23
store i8 0, i8* %24
%25 = tail call i32 @cstrcat(i8* %18, i8* %16)
br label %26
26: ; preds = %0, %14
ret i32 0
}