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

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, char *,
                           char *, char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int ntohs(unsigned short);
void log_response(FILE *log_file, char *ip, unsigned short port,
                  char *file_name, time_t start, char *result) {
  fprintf(log_file, "%s %d %s %s %s\n", ip, ntohs(port), file_name,
          asctime(localtime(&start)), result);
  fflush(log_file);
}


x86 assembly (clang, -O0):
<log_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
movzwl -0x12(%rbp),%edi
call   1070 <ntohs@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x24(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8
mov    %rax,%r9
mov    -0x30(%rbp),%rax
lea    0xe3c(%rip),%rsi
mov    %rax,(%rsp)
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <fflush@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_response>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r9,%r14
mov    %rcx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %r8d,0xc(%rsp)
mov    %edx,%edi
call   1070 <ntohs@plt>
mov    %eax,%ebp
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %r14,(%rsp)
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
mov    %rax,%r9
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <fflush@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s %d %s %s %s\0A\00"
define void @log_response(i32* %0, i8* %1, i16 zeroext %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i16
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i32* %0, i32** %7
store i8* %1, i8** %8
store i16 %2, i16* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i16, i16* %9
%16 = call i32 @ntohs(i16 zeroext %15)
%17 = load i8*, i8** %10
%18 = call i32 @localtime(i32* %11)
%19 = call i8* @asctime(i32 %18)
%20 = load i8*, i8** %12
%21 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %16, i8* %17, i8* %19, i8* %20)
%22 = load i32*, i32** %7
%23 = call i32 @fflush(i32* %22)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s %d %s %s %s\0A\00"
define void @log_response(i32* nocapture %0, i8* %1, i16 zeroext %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
store i32 %4, i32* %7
%8 = tail call i32 @ntohs(i16 zeroext %2)
%9 = call i32 @localtime(i32* %7)
%10 = call i8* @asctime(i32 %9)
%11 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %8, i8* %3, i8* %10, i8* %5)
%12 = call i32 @fflush(i32* %0)
ret void
}