#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*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sadb_add_sa(int, int, int /*<<< orphan*/ *, int,
                               int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int main() {
  char *spi = "123";
  char *ky = "1234567899874563214785236985214785236985214785";
  sadb_add_sa(0, 1, (uint8_t *)spi, 4, 0, NULL, NULL, (uint8_t *)ky, 44);
  sadb_add_sa(1, 1, (uint8_t *)spi, 4, 0, NULL, NULL, (uint8_t *)ky, 44);
  printf("Socket has port #%d\n", 3333);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
xor    %r8d,%r8d
mov    $0x1,%esi
mov    $0x4,%ecx
xor    %edi,%edi
mov    %edi,%r9d
mov    %r8d,%edi
movq   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x2c,0x10(%rsp)
call   1040 <sadb_add_sa@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    $0x1,%esi
mov    $0x4,%ecx
xor    %r8d,%r8d
xor    %edi,%edi
mov    %edi,%r9d
mov    %esi,%edi
movq   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x2c,0x10(%rsp)
call   1040 <sadb_add_sa@plt>
lea    0xe81(%rip),%rdi
mov    $0xd05,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
sub    $0x8,%rsp
lea    0xed5(%rip),%r14
lea    0xeca(%rip),%rbx
xor    %edi,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x4,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x2c
push   %r14
push   $0x0
call   1040 <sadb_add_sa@plt>
add    $0x18,%rsp
mov    $0x1,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x4,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x2c
push   %r14
push   $0x0
call   1040 <sadb_add_sa@plt>
add    $0x20,%rsp
lea    0xeab(%rip),%rdi
mov    $0xd05,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [47 x i8] c"1234567899874563214785236985214785236985214785\00"
@.str.2 = [21 x i8] c"Socket has port #%d\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = bitcast i8* %3 to i32*
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = call i32 @sadb_add_sa(i32 0, i32 1, i32* %4, i32 4, i32 0, i32* null, i32* null, i32* %6, i32 44)
%8 = load i8*, i8** %1
%9 = bitcast i8* %8 to i32*
%10 = load i8*, i8** %2
%11 = bitcast i8* %10 to i32*
%12 = call i32 @sadb_add_sa(i32 1, i32 1, i32* %9, i32 4, i32 0, i32* null, i32* null, i32* %11, i32 44)
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 3333)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [47 x i8] c"1234567899874563214785236985214785236985214785\00"
@.str.2 = [21 x i8] c"Socket has port #%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sadb_add_sa(i32 0, i32 1, i32* bitcast ([4 x i8]* @.str to i32*), i32 4, i32 0, i32* null, i32* null, i32* bitcast ([47 x i8]* @.str.1 to i32*), i32 44)
%2 = tail call i32 @sadb_add_sa(i32 1, i32 1, i32* bitcast ([4 x i8]* @.str to i32*), i32 4, i32 0, i32* null, i32* null, i32* bitcast ([47 x i8]* @.str.1 to i32*), i32 44)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 3333)
ret i32 0
}