#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 >= 2147483647 / sizeof(int)) {
    Alen = 1;
  }
  if (Blen < 1 || Blen >= 2147483647 / sizeof(int)) {
    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)
jl     116d <main+0x3d>
movslq -0x8(%rbp),%rax
cmp    $0x1fffffff,%rax
jb     1174 <main+0x44>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     118e <main+0x5e>
movslq -0xc(%rbp),%rax
cmp    $0x1fffffff,%rax
jb     1195 <main+0x65>
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>
lea    -0x1fffffff(%r14),%ecx
cmp    $0xe0000002,%ecx
mov    $0x1,%ebx
cmovb  %ebx,%r14d
lea    -0x1fffffff(%rax),%ecx
cmp    $0xe0000002,%ecx
cmovae %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 %15, label %11
11: ; preds = %0
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp uge i64 %13, 536870911
br i1 %14, label %15, label %16
15: ; preds = %11, %0
store i32 1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 1
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = icmp uge i64 %21, 536870911
br i1 %22, label %23, label %24
23: ; preds = %19, %16
store i32 1, i32* %3
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = mul i64 %26, 4
%28 = trunc i64 %27 to i32
%29 = call i64 @alloca(i32 %28)
%30 = inttoptr i64 %29 to i32*
store i32* %30, i32** %4
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 4
%34 = trunc i64 %33 to i32
%35 = call i64 @alloca(i32 %34)
%36 = inttoptr i64 %35 to i32*
store i32* %36, i32** %5
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 4
%40 = trunc i64 %39 to i32
%41 = call i64 @alloca(i32 %40)
%42 = inttoptr i64 %41 to i32*
store i32* %42, i32** %6
%43 = load i32*, i32** %4
%44 = load i32, i32* %2
%45 = load i32*, i32** %5
%46 = load i32, i32* %3
%47 = load i32*, i32** %6
%48 = call i32 @diff(i32* %43, i32 %44, i32* %45, i32 %46, i32* %47)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = add i32 %1, -536870911
%4 = icmp ult i32 %3, -536870910
%5 = select i1 %4, i32 1, i32 %1
%6 = add i32 %2, -536870911
%7 = icmp ult i32 %6, -536870910
%8 = select i1 %7, i32 1, i32 %2
%9 = shl nuw nsw i32 %5, 2
%10 = tail call i64 @alloca(i32 %9)
%11 = inttoptr i64 %10 to i32*
%12 = shl nuw nsw i32 %8, 2
%13 = tail call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i32*
%15 = tail call i64 @alloca(i32 %9)
%16 = inttoptr i64 %15 to i32*
%17 = tail call i32 @diff(i32* %11, i32 %5, i32* %14, i32 %8, i32* %16)
ret i32 0
}