#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*/ diff(int *, int, int *, int, int *);
int main() {
  int Alen = __VERIFIER_nondet_int();
  int Blen = __VERIFIER_nondet_int();
  if (Alen < 1) {
    Alen = 1;
  }
  if (Blen < 1) {
    Blen = 1;
  }
  int *A = (int *)alloca(Alen * sizeof(int));
  int *B = (int *)alloca(Blen * sizeof(int));
  int *D = (int *)alloca(Alen * sizeof(int));
  diff(A, Alen, B, Blen, D);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
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    $0x2,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x20(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1050 <diff@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %r14d,%r14d
mov    $0x1,%ebx
cmovle %ebx,%r14d
test   %eax,%eax
cmovg  %eax,%ebx
lea    0x0(,%r14,4),%ebp
mov    %ebp,%edi
call   1030 <alloca@plt>
mov    %rax,%r15
lea    0x0(,%rbx,4),%edi
call   1030 <alloca@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1030 <alloca@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r12,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
call   1050 <diff@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
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 i32*
%6 = alloca i32*
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 = load i32, i32* %2
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %2
br label %12
12: ; preds = %11, %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 4
%20 = trunc i64 %19 to i32
%21 = call i64 @alloca(i32 %20)
%22 = inttoptr i64 %21 to i32*
store i32* %22, i32** %4
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 4
%26 = trunc i64 %25 to i32
%27 = call i64 @alloca(i32 %26)
%28 = inttoptr i64 %27 to i32*
store i32* %28, i32** %5
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = mul i64 %30, 4
%32 = trunc i64 %31 to i32
%33 = call i64 @alloca(i32 %32)
%34 = inttoptr i64 %33 to i32*
store i32* %34, i32** %6
%35 = load i32*, i32** %4
%36 = load i32, i32* %2
%37 = load i32*, i32** %5
%38 = load i32, i32* %3
%39 = load i32*, i32** %6
%40 = call i32 @diff(i32* %35, i32 %36, i32* %37, i32 %38, i32* %39)
ret i32 0
}

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 = shl i32 %4, 2
%8 = tail call i64 @alloca(i32 %7)
%9 = inttoptr i64 %8 to i32*
%10 = shl i32 %6, 2
%11 = tail call i64 @alloca(i32 %10)
%12 = inttoptr i64 %11 to i32*
%13 = tail call i64 @alloca(i32 %7)
%14 = inttoptr i64 %13 to i32*
%15 = tail call i32 @diff(i32* %9, i32 %4, i32* %12, i32 %6, i32* %14)
ret i32 0
}