#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 CmpDrv {
  int dummy;
};
struct CmpAiSoul {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmp_ai_soul_gen_path(struct CmpAiSoul *, double **, int *);
int /*<<< orphan*/ soul_start_walking(struct CmpDrv *, double *, int,
                                      void (*)(struct CmpDrv *, void *),
                                      struct CmpAiSoul *);
void cmp_ai_soul_on_wp_drv_end(struct CmpDrv *drv, void *data) {
  struct CmpAiSoul *ai = (struct CmpAiSoul *)data;
  double *points;
  int points_count;
  cmp_ai_soul_gen_path(ai, &points, &points_count);
  soul_start_walking(drv, points, points_count, cmp_ai_soul_on_wp_drv_end, ai);
}


x86 assembly (clang, -O0):
<cmp_ai_soul_on_wp_drv_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1040 <cmp_ai_soul_gen_path@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    0x2e81(%rip),%rcx
call   1030 <soul_start_walking@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ai_soul_on_wp_drv_end>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <cmp_ai_soul_gen_path@plt>
mov    0x10(%rsp),%rsi
mov    0xc(%rsp),%edx
mov    0x2e91(%rip),%rcx
mov    %r14,%rdi
mov    %rbx,%r8
call   1030 <soul_start_walking@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.CmpDrv = type { i32 }
%struct.CmpAiSoul = type { i32 }
define void @cmp_ai_soul_on_wp_drv_end(%struct.CmpDrv* %0, i8* %1) {
%3 = alloca %struct.CmpDrv*
%4 = alloca i8*
%5 = alloca %struct.CmpAiSoul*
%6 = alloca double*
%7 = alloca i32
store %struct.CmpDrv* %0, %struct.CmpDrv** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.CmpAiSoul*
store %struct.CmpAiSoul* %9, %struct.CmpAiSoul** %5
%10 = load %struct.CmpAiSoul*, %struct.CmpAiSoul** %5
%11 = call i32 @cmp_ai_soul_gen_path(%struct.CmpAiSoul* %10, double** %6, i32* %7)
%12 = load %struct.CmpDrv*, %struct.CmpDrv** %3
%13 = load double*, double** %6
%14 = load i32, i32* %7
%15 = load %struct.CmpAiSoul*, %struct.CmpAiSoul** %5
%16 = call i32 @soul_start_walking(%struct.CmpDrv* %12, double* %13, i32 %14, void (%struct.CmpDrv*, i8*)* @cmp_ai_soul_on_wp_drv_end, %struct.CmpAiSoul* %15)
ret void
}

LLVM IR (-O2):
%struct.CmpDrv = type { i32 }
%struct.CmpAiSoul = type { i32 }
define void @cmp_ai_soul_on_wp_drv_end(%struct.CmpDrv* %0, i8* %1) {
%3 = alloca double*
%4 = alloca i32
%5 = bitcast i8* %1 to %struct.CmpAiSoul*
%6 = bitcast double** %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @cmp_ai_soul_gen_path(%struct.CmpAiSoul* %5, double** %3, i32* %4)
%9 = load double*, double** %3
%10 = load i32, i32* %4
%11 = call i32 @soul_start_walking(%struct.CmpDrv* %0, double* %9, i32 %10, void (%struct.CmpDrv*, i8*)* @cmp_ai_soul_on_wp_drv_end, %struct.CmpAiSoul* %5)
ret void
}