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

/* Variables and functions */
int recv(int, char **, unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char **, int, int /*<<< orphan*/);
void warm_up(int sock) {
  unsigned int send_size = 100;
  char send_data_buffer[send_size];
  for (int k = 0; k < send_size; k++)
    send_data_buffer[k] = 'b';
  unsigned int receive_size = send_size;
  char receive_data_buffer[receive_size];
  int total_bytes_received = 0;
  int bytes_received = 0;
  send(sock, &send_data_buffer, 100, 0);
  while (total_bytes_received < receive_size) {
    bytes_received = recv(sock, &receive_data_buffer, receive_size, 0);
    total_bytes_received += bytes_received;
  }
}


x86 assembly (clang, -O0):
<warm_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1185 <warm_up+0x65>
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <warm_up+0x3f>
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    11f9 <warm_up+0xd9>
mov    -0x40(%rbp),%rsi
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11cb <warm_up+0xab>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warm_up>:
push   %rbp
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %edi,%ebx
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x62626262,0x60(%rsp)
62
mov    %rsp,%rsi
xor    %ebp,%ebp
mov    $0x64,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0x70(%rsp),%r14
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    %eax,%ebp
cmp    $0x64,%ebp
jb     1170 <warm_up+0x50>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @warm_up(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %2
store i32 100, i32* %3
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %4
%14 = alloca i8, i64 %12
store i64 %12, i64* %5
store i32 0, i32* %6
br label %15
15: ; preds = %23, %1
%16 = load i32, i32* %6
%17 = load i32, i32* %3
%18 = icmp ult i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %14, i64 %21
store i8 98, i8* %22
br label %23
23: ; preds = %19
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %15
26: ; preds = %15
%27 = load i32, i32* %3
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = zext i32 %28 to i64
%30 = alloca i8, i64 %29
store i64 %29, i64* %8
store i32 0, i32* %9
store i32 0, i32* %10
%31 = load i32, i32* %2
%32 = bitcast i8* %14 to i8**
%33 = call i32 @send(i32 %31, i8** %32, i32 100, i32 0)
br label %34
34: ; preds = %38, %26
%35 = load i32, i32* %9
%36 = load i32, i32* %7
%37 = icmp ult i32 %35, %36
br i1 %37, label %38, label %46
38: ; preds = %34
%39 = load i32, i32* %2
%40 = bitcast i8* %30 to i8**
%41 = load i32, i32* %7
%42 = call i32 @recv(i32 %39, i8** %40, i32 %41, i32 0)
store i32 %42, i32* %10
%43 = load i32, i32* %10
%44 = load i32, i32* %9
%45 = add nsw i32 %44, %43
store i32 %45, i32* %9
br label %34
46: ; preds = %34
%47 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @warm_up(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = alloca [100 x i8]
%5 = bitcast [100 x i8]* %2 to i8**
%6 = call i32 @send(i32 %0, i8** %5, i32 100, i32 0)
%7 = bitcast [100 x i8]* %4 to i8**
br label %8
8: ; preds = %1, %8
%9 = phi i32 [ 0, %1 ], [ %11, %8 ]
%10 = call i32 @recv(i32 %0, i8** %7, i32 100, i32 0)
%11 = add nsw i32 %10, %9
%12 = icmp ult i32 %11, 100
br i1 %12, label %8, label %13
13: ; preds = %8
ret void
}