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

/* Variables and functions */
scalar_t__ ike_phase_1_recv_ID(struct message *);
int ike_phase_1_recv_KE_NONCE(struct message *);
scalar_t__ ike_phase_1_responder_recv_SA(struct message *);
int responder_recv_SA_KE_NONCE_ID(struct message *msg) {
  if (ike_phase_1_responder_recv_SA(msg))
    return -1;
  if (ike_phase_1_recv_ID(msg))
    return -1;
  return ike_phase_1_recv_KE_NONCE(msg);
}


x86 assembly (clang, -O0):
<responder_recv_SA_KE_NONCE_ID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ike_phase_1_responder_recv_SA@plt>
cmp    $0x0,%rax
je     115b <responder_recv_SA_KE_NONCE_ID+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <responder_recv_SA_KE_NONCE_ID+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <ike_phase_1_recv_ID@plt>
cmp    $0x0,%rax
je     117a <responder_recv_SA_KE_NONCE_ID+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <responder_recv_SA_KE_NONCE_ID+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <ike_phase_1_recv_KE_NONCE@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<responder_recv_SA_KE_NONCE_ID>:
push   %rbx
mov    %rdi,%rbx
call   1050 <ike_phase_1_responder_recv_SA@plt>
test   %rax,%rax
jne    114b <responder_recv_SA_KE_NONCE_ID+0x1b>
mov    %rbx,%rdi
call   1040 <ike_phase_1_recv_ID@plt>
test   %rax,%rax
je     1152 <responder_recv_SA_KE_NONCE_ID+0x22>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ike_phase_1_recv_KE_NONCE@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
define i32 @responder_recv_SA_KE_NONCE_ID(%struct.message* %0) {
%2 = alloca i32
%3 = alloca %struct.message*
store %struct.message* %0, %struct.message** %3
%4 = load %struct.message*, %struct.message** %3
%5 = call i64 @ike_phase_1_responder_recv_SA(%struct.message* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %16
8: ; preds = %1
%9 = load %struct.message*, %struct.message** %3
%10 = call i64 @ike_phase_1_recv_ID(%struct.message* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %16
13: ; preds = %8
%14 = load %struct.message*, %struct.message** %3
%15 = call i32 @ike_phase_1_recv_KE_NONCE(%struct.message* %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.message = type { i32 }
define i32 @responder_recv_SA_KE_NONCE_ID(%struct.message* %0) {
%2 = tail call i64 @ike_phase_1_responder_recv_SA(%struct.message* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @ike_phase_1_recv_ID(%struct.message* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @ike_phase_1_recv_KE_NONCE(%struct.message* %0)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ %8, %7 ], [ -1, %1 ], [ -1, %4 ]
ret i32 %10
}