#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 termios {
  int c_cflag;
  int *c_cc;
};

/* Variables and functions */
int CLOCAL;
int CREAD;
int CRTSCTS;
int IXANY;
int IXOFF;
int IXON;
size_t VMIN;
size_t VTIME;
void _flowcontrol_off(struct termios *t) {
  t->c_cflag &= ~CRTSCTS;
  t->c_cflag |= CREAD | CLOCAL;
  t->c_cflag &= ~(IXON | IXOFF | IXANY);
  t->c_cc[VMIN] = 43;
  t->c_cc[VTIME] = 0;
}


x86 assembly (clang, -O0):
<_flowcontrol_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
mov    0x2e74(%rip),%rax
or     (%rax),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea2(%rip),%rax
or     (%rax),%ecx
mov    0x2e71(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e65(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x2b,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2e34(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_flowcontrol_off>:
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
not    %eax
and    (%rdi),%eax
mov    %eax,(%rdi)
mov    0x2ec2(%rip),%rcx
mov    0x2e83(%rip),%rdx
or     (%rcx),%eax
or     (%rdx),%eax
mov    %eax,(%rdi)
mov    0x2eb6(%rip),%rcx
mov    0x2eb7(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2e84(%rip),%rcx
or     (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %edx,(%rdi)
mov    0x8(%rdi),%rax
mov    0x2e81(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x2b,(%rax,%rcx,4)
mov    0x2e58(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32* }
@CRTSCTS = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@IXON = global i32 0
@IXOFF = global i32 0
@IXANY = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
define void @_flowcontrol_off(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @CRTSCTS
%4 = xor i32 %3, -1
%5 = load %struct.termios*, %struct.termios** %2
%6 = getelementptr inbounds %struct.termios, %struct.termios* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, %4
store i32 %8, i32* %6
%9 = load i32, i32* @CREAD
%10 = load i32, i32* @CLOCAL
%11 = or i32 %9, %10
%12 = load %struct.termios*, %struct.termios** %2
%13 = getelementptr inbounds %struct.termios, %struct.termios* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32, i32* @IXON
%17 = load i32, i32* @IXOFF
%18 = or i32 %16, %17
%19 = load i32, i32* @IXANY
%20 = or i32 %18, %19
%21 = xor i32 %20, -1
%22 = load %struct.termios*, %struct.termios** %2
%23 = getelementptr inbounds %struct.termios, %struct.termios* %22, i32 0, i32 0
%24 = load i32, i32* %23
%25 = and i32 %24, %21
store i32 %25, i32* %23
%26 = load %struct.termios*, %struct.termios** %2
%27 = getelementptr inbounds %struct.termios, %struct.termios* %26, i32 0, i32 1
%28 = load i32*, i32** %27
%29 = load i64, i64* @VMIN
%30 = getelementptr inbounds i32, i32* %28, i64 %29
store i32 43, i32* %30
%31 = load %struct.termios*, %struct.termios** %2
%32 = getelementptr inbounds %struct.termios, %struct.termios* %31, i32 0, i32 1
%33 = load i32*, i32** %32
%34 = load i64, i64* @VTIME
%35 = getelementptr inbounds i32, i32* %33, i64 %34
store i32 0, i32* %35
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32, i32* }
@CRTSCTS = global i32 0
@CREAD = global i32 0
@CLOCAL = global i32 0
@IXON = global i32 0
@IXOFF = global i32 0
@IXANY = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
define void @_flowcontrol_off(%struct.termios* nocapture %0) {
%2 = load i32, i32* @CRTSCTS
%3 = xor i32 %2, -1
%4 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = and i32 %5, %3
store i32 %6, i32* %4
%7 = load i32, i32* @CREAD
%8 = load i32, i32* @CLOCAL
%9 = or i32 %7, %6
%10 = or i32 %9, %8
store i32 %10, i32* %4
%11 = load i32, i32* @IXON
%12 = load i32, i32* @IXOFF
%13 = or i32 %12, %11
%14 = load i32, i32* @IXANY
%15 = or i32 %13, %14
%16 = xor i32 %15, -1
%17 = and i32 %10, %16
store i32 %17, i32* %4
%18 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
%19 = load i32*, i32** %18
%20 = load i64, i64* @VMIN
%21 = getelementptr inbounds i32, i32* %19, i64 %20
store i32 43, i32* %21
%22 = load i64, i64* @VTIME
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32 0, i32* %23
ret void
}