#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 /*<<< orphan*/ get_racetrack_params(int *, int *, int *, int *, int *,
                                        int *, double *);
void get_start_pos(int *start_x, int *start_y) {
  int x0, y0, xr_outer, yr_outer, xr_inner, yr_inner;
  double p;
  get_racetrack_params(&x0, &xr_outer, &xr_inner, &y0, &yr_outer, &yr_inner,
                       &p);
  (*start_x) = x0 - xr_outer + (xr_outer - xr_inner) / 2;
  (*start_y) = y0;
}


x86 assembly (clang, -O0):
<get_start_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x28(%rbp),%r9
lea    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <get_racetrack_params@plt>
mov    -0x14(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_start_pos>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
call   1030 <get_racetrack_params@plt>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%ecx
sub    %ecx,%eax
sub    0x8(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
add    %eax,%edx
mov    %edx,(%rbx)
mov    0x10(%rsp),%eax
mov    %eax,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @get_start_pos(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32* %0, i32** %3
store i32* %1, i32** %4
%12 = call i32 @get_racetrack_params(i32* %5, i32* %7, i32* %9, i32* %6, i32* %8, i32* %10, double* %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = sub nsw i32 %16, %17
%19 = sdiv i32 %18, 2
%20 = add nsw i32 %15, %19
%21 = load i32*, i32** %3
store i32 %20, i32* %21
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @get_start_pos(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast double* %9 to i8*
%17 = call i32 @get_racetrack_params(i32* %3, i32* %5, i32* %7, i32* %4, i32* %6, i32* %8, double* %9)
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = sub i32 %18, %19
%21 = load i32, i32* %7
%22 = sub nsw i32 %19, %21
%23 = sdiv i32 %22, 2
%24 = add nsw i32 %20, %23
store i32 %24, i32* %0
%25 = load i32, i32* %4
store i32 %25, i32* %1
ret void
}