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

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ get_internet_address(char *, int, int *,
                                        struct sockaddr_in *);
int /*<<< orphan*/ printf(char *, char *, int);
extern void say_who_called(struct sockaddr_in saddr) {
  char host[BUFSIZ];
  int port;
  get_internet_address(host, BUFSIZ, &port, &saddr);
  printf("from: %s:%d\n", host, port);
}


x86 assembly (clang, -O0):
<say_who_called>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
lea    -0x1c(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <get_internet_address@plt>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_who_called>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x14(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    %rbx,%rdi
call   1040 <get_internet_address@plt>
mov    -0x14(%rbp),%edx
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@BUFSIZ = global i32 0
@.str = [13 x i8] c"from: %s:%d\0A\00"
define void @say_who_called(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = load i32, i32* @BUFSIZ
%12 = call i32 @get_internet_address(i8* %10, i32 %11, i32* %5, %struct.sockaddr_in* %2)
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %13)
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@BUFSIZ = global i32 0
@.str = [13 x i8] c"from: %s:%d\0A\00"
define void @say_who_called(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = bitcast i32* %3 to i8*
%9 = call i32 @get_internet_address(i8* %7, i32 %5, i32* %3, %struct.sockaddr_in* %2)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %10)
ret void
}