#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 katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int store_sensor_mode_katcp(
    struct katcp_dispatch *, unsigned int, char *,
    struct katcp_notice *(*)(struct katcp_dispatch *, char *, unsigned int,
                             unsigned int),
    int (*)(struct katcp_dispatch *, struct katcp_notice *, char *,
            unsigned int),
    void (*)(struct katcp_dispatch *, unsigned int), void *,
    void (*)(struct katcp_dispatch *, unsigned int), int /*<<< orphan*/);
int store_prepared_mode_katcp(
    struct katcp_dispatch *d, unsigned int mode, char *name,
    struct katcp_notice *(*prepare)(struct katcp_dispatch *d, char *flags,
                                    unsigned int from, unsigned int to),
    int (*enter)(struct katcp_dispatch *d, struct katcp_notice *n, char *flags,
                 unsigned int to),
    void (*leave)(struct katcp_dispatch *d, unsigned int to), void *state,
    void (*clear)(struct katcp_dispatch *d, unsigned int mode)) {
  return store_sensor_mode_katcp(d, mode, name, prepare, enter, leave, state,
                                 clear, 0);
}


x86 assembly (clang, -O0):
<store_prepared_mode_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
xor    %r11d,%r11d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <store_sensor_mode_katcp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_prepared_mode_katcp>:
sub    $0x18,%rsp
movaps 0x20(%rsp),%xmm0
movups %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <store_sensor_mode_katcp@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_notice = type opaque
%struct.katcp_notice.0 = type opaque
define i32 @store_prepared_mode_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)* %3, i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)* %4, void (%struct.katcp_dispatch*, i32)* %5, i8* %6, void (%struct.katcp_dispatch*, i32)* %7) {
%9 = alloca %struct.katcp_dispatch*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)*
%13 = alloca i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)*
%14 = alloca void (%struct.katcp_dispatch*, i32)*
%15 = alloca i8*
%16 = alloca void (%struct.katcp_dispatch*, i32)*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)* %3, %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)** %12
store i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)* %4, i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)** %13
store void (%struct.katcp_dispatch*, i32)* %5, void (%struct.katcp_dispatch*, i32)** %14
store i8* %6, i8** %15
store void (%struct.katcp_dispatch*, i32)* %7, void (%struct.katcp_dispatch*, i32)** %16
%17 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %9
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)*, %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)** %12
%21 = bitcast %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)* %20 to %struct.katcp_notice.0* (%struct.katcp_dispatch*, i8*, i32, i32)*
%22 = load i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)*, i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)** %13
%23 = bitcast i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)* %22 to i32 (%struct.katcp_dispatch*, %struct.katcp_notice.0*, i8*, i32)*
%24 = load void (%struct.katcp_dispatch*, i32)*, void (%struct.katcp_dispatch*, i32)** %14
%25 = load i8*, i8** %15
%26 = load void (%struct.katcp_dispatch*, i32)*, void (%struct.katcp_dispatch*, i32)** %16
%27 = call i32 @store_sensor_mode_katcp(%struct.katcp_dispatch* %17, i32 %18, i8* %19, %struct.katcp_notice.0* (%struct.katcp_dispatch*, i8*, i32, i32)* %21, i32 (%struct.katcp_dispatch*, %struct.katcp_notice.0*, i8*, i32)* %23, void (%struct.katcp_dispatch*, i32)* %24, i8* %25, void (%struct.katcp_dispatch*, i32)* %26, i32 0)
ret i32 %27
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
%struct.katcp_notice = type opaque
%struct.katcp_notice.0 = type opaque
define i32 @store_prepared_mode_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)* %3, i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)* %4, void (%struct.katcp_dispatch*, i32)* %5, i8* %6, void (%struct.katcp_dispatch*, i32)* %7) {
%9 = bitcast %struct.katcp_notice* (%struct.katcp_dispatch*, i8*, i32, i32)* %3 to %struct.katcp_notice.0* (%struct.katcp_dispatch*, i8*, i32, i32)*
%10 = bitcast i32 (%struct.katcp_dispatch*, %struct.katcp_notice*, i8*, i32)* %4 to i32 (%struct.katcp_dispatch*, %struct.katcp_notice.0*, i8*, i32)*
%11 = tail call i32 @store_sensor_mode_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, %struct.katcp_notice.0* (%struct.katcp_dispatch*, i8*, i32, i32)* %9, i32 (%struct.katcp_dispatch*, %struct.katcp_notice.0*, i8*, i32)* %10, void (%struct.katcp_dispatch*, i32)* %5, i8* %6, void (%struct.katcp_dispatch*, i32)* %7, i32 0)
ret i32 %11
}