#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 {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr const *, int);
int /*<<< orphan*/ stdin;
void udp_respon(int sockfd, const struct sockaddr *addr, int size) {
  char buffer[80];
  while (1) {
    bzero(buffer, sizeof(buffer));
    puts("please input:");
    fgets(buffer, sizeof(buffer), stdin);
    sendto(sockfd, buffer, sizeof(buffer), 0, addr, size);
  }
}


x86 assembly (clang, -O0):
<udp_respon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x50,%esi
call   1060 <bzero@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x50,%edx
xor    %ecx,%ecx
call   1040 <sendto@plt>
jmp    1152 <udp_respon+0x12>

x86 assembly (clang, -O2):
<udp_respon>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
mov    %rsp,%rbx
lea    0xea0(%rip),%r12
mov    0x2e81(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <bzero@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
mov    %r15,%r8
mov    %r14d,%r9d
call   1040 <sendto@plt>
jmp    1170 <udp_respon+0x30>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"please input:\00"
@stdin = global i32 0
define void @udp_respon(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca [80 x i8]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %3, %8
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%10 = call i32 @bzero(i8* %9, i32 80)
%11 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 80, i32 %13)
%15 = load i32, i32* %4
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%17 = load %struct.sockaddr*, %struct.sockaddr** %5
%18 = load i32, i32* %6
%19 = call i32 @sendto(i32 %15, i8* %16, i32 80, i32 0, %struct.sockaddr* %17, i32 %18)
br label %8
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"please input:\00"
@stdin = global i32 0
define void @udp_respon(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
br label %6
6: ; preds = %6, %3
%7 = call i32 @bzero(i8* %5, i32 80)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %5, i32 80, i32 %9)
%11 = call i32 @sendto(i32 %0, i8* %5, i32 80, i32 0, %struct.sockaddr* %1, i32 %2)
br label %6
}