#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 */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ ipsec_decode_id(char *, int, int /*<<< orphan*/ *, size_t,
                                   int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
char *ipsec_decode_ids(char *fmt, u_int8_t *id1, size_t id1_len, u_int8_t *id2,
                       size_t id2_len, int isakmpform) {
  static char result[1024];
  char s_id1[256], s_id2[256];
  ipsec_decode_id(s_id1, sizeof s_id1, id1, id1_len, isakmpform);
  ipsec_decode_id(s_id2, sizeof s_id2, id2, id2_len, isakmpform);
  snprintf(result, sizeof result, fmt, s_id1, s_id2);
  return result;
}


x86 assembly (clang, -O0):
<ipsec_decode_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
mov    $0x100,%esi
call   1040 <ipsec_decode_id@plt>
lea    -0x230(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
mov    $0x100,%esi
call   1040 <ipsec_decode_id@plt>
mov    -0x8(%rbp),%rdx
lea    -0x130(%rbp),%rcx
lea    -0x230(%rbp),%r8
lea    0x2eaa(%rip),%rdi
mov    $0x400,%esi
call   1030 <snprintf@plt>
lea    0x2e99(%rip),%rax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipsec_decode_ids>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %r9d,%ebx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%r12
lea    0x100(%rsp),%r13
mov    %r13,%rdi
mov    $0x100,%esi
mov    %r9d,%r8d
call   1040 <ipsec_decode_id@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %ebx,%r8d
call   1040 <ipsec_decode_id@plt>
lea    0x2ec5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@ipsec_decode_ids.result = internal global [1024 x i8] zeroinitializer
define i8* @ipsec_decode_ids(i8* %0, i32* %1, i64 %2, i32* %3, i64 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca [256 x i8]
store i8* %0, i8** %7
store i32* %1, i32** %8
store i64 %2, i64* %9
store i32* %3, i32** %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%16 = load i32*, i32** %8
%17 = load i64, i64* %9
%18 = load i32, i32* %12
%19 = call i32 @ipsec_decode_id(i8* %15, i32 256, i32* %16, i64 %17, i32 %18)
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%21 = load i32*, i32** %10
%22 = load i64, i64* %11
%23 = load i32, i32* %12
%24 = call i32 @ipsec_decode_id(i8* %20, i32 256, i32* %21, i64 %22, i32 %23)
%25 = load i8*, i8** %7
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%28 = call i32 @snprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ipsec_decode_ids.result, i64 0, i64 0), i32 1024, i8* %25, i8* %26, i8* %27)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ipsec_decode_ids.result, i64 0, i64 0)
}

LLVM IR (-O2):
@ipsec_decode_ids.result = internal global [1024 x i8] zeroinitializer
define i8* @ipsec_decode_ids(i8* %0, i32* %1, i64 %2, i32* %3, i64 %4, i32 %5) {
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%11 = call i32 @ipsec_decode_id(i8* %9, i32 256, i32* %1, i64 %2, i32 %5)
%12 = call i32 @ipsec_decode_id(i8* %10, i32 256, i32* %3, i64 %4, i32 %5)
%13 = call i32 @snprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ipsec_decode_ids.result, i64 0, i64 0), i32 1024, i8* %0, i8* %9, i8* %10)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ipsec_decode_ids.result, i64 0, i64 0)
}