#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_SYN(struct mypacket *, unsigned int);
int /*<<< orphan*/ usleep(int);
int x11_process_request(struct mypacket *packet) {
  unsigned int sflags, dflags;
  sflags = 1;
  dflags = (1 << 3) | (1 << 4) | (1 << 5);
  if (1) {
    dflags |= 1;
  }
  if (1) {
    sflags |= (1 << 1);
    dflags |= (1 << 1);
  }
  send_fake_SYN(packet, sflags);
  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):
<x11_process_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x38,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <send_fake_SYN@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):
<x11_process_request>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3,%esi
call   1040 <send_fake_SYN@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x3b,%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x3b,%esi
call   1030 <send_desync_data@plt>
mov    $0x4e20,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
mov    $0x3b,%esi
call   1030 <send_desync_data@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.mypacket = type { i32 }
define i32 @x11_process_request(%struct.mypacket* %0) {
%2 = tail call i32 @send_fake_SYN(%struct.mypacket* %0, i32 3)
%3 = tail call i32 @usleep(i32 20000)
%4 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 59)
%5 = tail call i32 @usleep(i32 20000)
%6 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 59)
%7 = tail call i32 @usleep(i32 20000)
%8 = tail call i32 @send_desync_data(%struct.mypacket* %0, i32 59)
ret i32 1
}