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

/* Variables and functions */
int /*<<< orphan*/ send_desync_data(struct mypacket *, unsigned int);
int /*<<< orphan*/ send_fake_RST(struct mypacket *, unsigned int);
int /*<<< orphan*/ usleep(int);
int x6_process_request(struct mypacket *packet) {
  unsigned int rflags, dflags;
  rflags = (1 << 4) | (1 << 5);
  dflags = (1 << 3) | (1 << 4) | (1 << 5);
  if (1) {
    rflags |= 1;
  }
  if (1) {
    dflags |= 1;
  }
  if (0) {
    rflags |= (1 << 1);
    dflags |= (1 << 1);
  }
  send_fake_RST(packet, rflags);
  usleep(20000);
  send_fake_RST(packet, rflags);
  usleep(20000);
  send_fake_RST(packet, rflags);
  usleep(20000);
  send_desync_data(packet, dflags);
  usleep(20000);
  send_desync_data(packet, dflags);
  usleep(20000);
  send_desync_data(packet, dflags);
  return 1;
}


x86 assembly (clang, -O0):
<x6_process_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x30,-0xc(%rbp)
movl   $0x38,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <send_desync_data@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x6_process_request>:
push   %rbx
mov    %rdi,%rbx
mov    $0x31,%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
call   1040 <send_fake_RST@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x39,%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x39,%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x39,%esi
call   1030 <send_desync_data@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mypacket = type { i32 }
define i32 @x6_process_request(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
%3 = alloca i32
%4 = alloca i32
store %struct.mypacket* %0, %struct.mypacket** %2
store i32 48, i32* %3
store i32 56, i32* %4
%5 = load i32, i32* %3
%6 = or i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = or i32 %7, 1
store i32 %8, i32* %4
%9 = load %struct.mypacket*, %struct.mypacket** %2
%10 = load i32, i32* %3
%11 = call i32 @send_fake_RST(%struct.mypacket* %9, i32 %10)
%12 = call i32 @usleep(i32 20000)
%13 = load %struct.mypacket*, %struct.mypacket** %2
%14 = load i32, i32* %3
%15 = call i32 @send_fake_RST(%struct.mypacket* %13, i32 %14)
%16 = call i32 @usleep(i32 20000)
%17 = load %struct.mypacket*, %struct.mypacket** %2
%18 = load i32, i32* %3
%19 = call i32 @send_fake_RST(%struct.mypacket* %17, i32 %18)
%20 = call i32 @usleep(i32 20000)
%21 = load %struct.mypacket*, %struct.mypacket** %2
%22 = load i32, i32* %4
%23 = call i32 @send_desync_data(%struct.mypacket* %21, i32 %22)
%24 = call i32 @usleep(i32 20000)
%25 = load %struct.mypacket*, %struct.mypacket** %2
%26 = load i32, i32* %4
%27 = call i32 @send_desync_data(%struct.mypacket* %25, i32 %26)
%28 = call i32 @usleep(i32 20000)
%29 = load %struct.mypacket*, %struct.mypacket** %2
%30 = load i32, i32* %4
%31 = call i32 @send_desync_data(%struct.mypacket* %29, i32 %30)
ret i32 1
}

LLVM IR (-O2):
%struct.mypacket = type { i32 }
define i32 @x6_process_request(%struct.mypacket* %0) {
%2 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 49)
%3 = tail call i32 @usleep(i32 20000)
%4 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 49)
%5 = tail call i32 @usleep(i32 20000)
%6 = tail call i32 @send_fake_RST(%struct.mypacket* %0, i32 49)
%7 = tail call i32 @usleep(i32 20000)
%8 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 57)
%9 = tail call i32 @usleep(i32 20000)
%10 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 57)
%11 = tail call i32 @usleep(i32 20000)
%12 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 57)
ret i32 1
}