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


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)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    116e <main+0x3e>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    117f <main+0x4f>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    1190 <main+0x60>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11ab <main+0x7b>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b7 <main+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1219 <main+0xe9>
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    -0x10(%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
mov    -0x10(%rbp),%edx
call   1030 <cstrncat@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   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
mov    $0x1,%ebp
cmovle %ebp,%ebx
test   %r14d,%r14d
cmovle %ebp,%r14d
test   %eax,%eax
cmovg  %eax,%ebp
mov    %ebx,%r15d
sub    %ebp,%r15d
jb     11a4 <main+0x74>
cmp    %r14d,%r15d
jl     11a4 <main+0x74>
mov    %ebx,%edi
call   1040 <alloca@plt>
mov    %rax,%rbx
mov    %r14d,%edi
call   1040 <alloca@plt>
movslq %r15d,%rcx
movb   $0x0,-0x1(%rcx,%rbx,1)
add    $0xffffffff,%r14d
movb   $0x0,(%rax,%r14,1)
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1030 <cstrncat@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, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, 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* %2
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %31, label %25
25: ; preds = %21
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = sub nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %25, %21
store i32 0, i32* %1
br label %61
32: ; preds = %25
%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 = load i32, i32* %4
%48 = sub nsw i32 %46, %47
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %45, i64 %50
store i8 0, i8* %51
%52 = load i8*, i8** %6
%53 = load i32, i32* %3
%54 = sub nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %52, i64 %55
store i8 0, i8* %56
%57 = load i8*, i8** %5
%58 = load i8*, i8** %6
%59 = load i32, i32* %4
%60 = call i32 @cstrncat(i8* %57, i8* %58, i32 %59)
store i32 0, i32* %1
br label %61
61: ; preds = %32, %31
%62 = load i32, i32* %1
ret i32 %62
}

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, 1
%7 = select i1 %6, i32 %2, i32 1
%8 = icmp sgt i32 %3, 1
%9 = select i1 %8, i32 %3, i32 1
%10 = icmp ult i32 %5, %9
br i1 %10, label %26, label %11
11: ; preds = %0
%12 = sub nsw i32 %5, %9
%13 = icmp slt i32 %12, %7
br i1 %13, label %26, label %14
14: ; preds = %11
%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 %12, -1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8 0, i8* %21
%22 = add nsw i32 %7, -1
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %18, i64 %23
store i8 0, i8* %24
%25 = tail call i32 @cstrncat(i8* %16, i8* %18, i32 %9)
br label %26
26: ; preds = %0, %11, %14
ret i32 0
}