#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 */
struct navigation_itm {
  int dummy;
};
struct navigation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int maneuver_required2(struct navigation *, struct navigation_itm *,
                       struct navigation_itm *, int *, int *, char **);
int /*<<< orphan*/ tests_dbg(int /*<<< orphan*/, char *, ...);
void main() {
  int res = 0;
  char *r;
  r = malloc(10000);
  struct navigation *nav;
  struct navigation_itm *old;
  struct navigation_itm *new;
  int delta;
  int delta_real;
  tests_dbg(0, "-- START UNIT TEST 001 --\n");
  res = maneuver_required2(nav, old, new, &delta, &delta_real, &r);
  tests_dbg(0, "res=%d\n", res);
  tests_dbg(0, "--   END UNIT TEST 001 --\n");
  free(r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2710,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1060 <tests_dbg@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x10(%rbp),%r9
call   1040 <maneuver_required2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1060 <tests_dbg@plt>
xor    %edi,%edi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1060 <tests_dbg@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x2710,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
lea    0xea6(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1060 <tests_dbg@plt>
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
call   1040 <maneuver_required2@plt>
lea    0xe9d(%rip),%rsi
xor    %edi,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <tests_dbg@plt>
lea    0xe93(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1060 <tests_dbg@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.navigation = type { i32 }
%struct.navigation_itm = type { i32 }
@.str = [27 x i8] c"-- START UNIT TEST 001 --\0A\00"
@.str.1 = [8 x i8] c"res=%d\0A\00"
@.str.2 = [27 x i8] c"-- END UNIT TEST 001 --\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca %struct.navigation*
%4 = alloca %struct.navigation_itm*
%5 = alloca %struct.navigation_itm*
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i8* @malloc(i32 10000)
store i8* %8, i8** %2
%9 = call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load %struct.navigation*, %struct.navigation** %3
%11 = load %struct.navigation_itm*, %struct.navigation_itm** %4
%12 = load %struct.navigation_itm*, %struct.navigation_itm** %5
%13 = call i32 @maneuver_required2(%struct.navigation* %10, %struct.navigation_itm* %11, %struct.navigation_itm* %12, i32* %6, i32* %7, i8** %2)
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%17 = load i8*, i8** %2
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
%struct.navigation = type { i32 }
%struct.navigation_itm = type { i32 }
@.str = [27 x i8] c"-- START UNIT TEST 001 --\0A\00"
@.str.1 = [8 x i8] c"res=%d\0A\00"
@.str.2 = [27 x i8] c"-- END UNIT TEST 001 --\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i8** %1 to i8*
%5 = tail call dereferenceable_or_null(10000) i8* @malloc(i32 10000)
store i8* %5, i8** %1
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = tail call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @maneuver_required2(%struct.navigation* undef, %struct.navigation_itm* undef, %struct.navigation_itm* undef, i32* %2, i32* %3, i8** %1)
%10 = call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (i32, i8*, ...) @tests_dbg(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%12 = load i8*, i8** %1
%13 = call i32 @free(i8* %12)
ret void
}