#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_iflag;
  int c_lflag;
  int c_cflag;
  int *c_cc;
  int /*<<< orphan*/ c_oflag;
};

/* Variables and functions */
int BRKINT;
int CREAD;
int CS8;
int CSIZE;
int ECHO;
int ECHOE;
int ECHOK;
int ECHONL;
int ICANON;
int ICRNL;
int IEXTEN;
int IGNBRK;
int IGNCR;
int IGNPAR;
int IMAXBEL;
int INLCR;
int INPCK;
int ISIG;
int ISTRIP;
int IXOFF;
int IXON;
int NOFLSH;
int /*<<< orphan*/ OPOST;
int PARENB;
int PARMRK;
int PENDIN;
int TOSTOP;
size_t VMIN;
size_t VTIME;
void cfmakeraw(struct termios *t) {
  t->c_iflag &= ~(IMAXBEL | IXOFF | INPCK | BRKINT | PARMRK | ISTRIP | INLCR |
                  IGNCR | ICRNL | IXON | IGNPAR);
  t->c_iflag |= IGNBRK;
  t->c_oflag &= ~OPOST;
  t->c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON | ISIG | IEXTEN |
                  NOFLSH | TOSTOP | PENDIN);
  t->c_cflag &= ~(CSIZE | PARENB);
  t->c_cflag |= CS8 | CREAD;
  t->c_cc[VMIN] = 1;
  t->c_cc[VTIME] = 0;
}


x86 assembly (clang, -O0):
<cfmakeraw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2df9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
or     (%rax),%ecx
mov    0x2e27(%rip),%rax
or     (%rax),%ecx
mov    0x2e5e(%rip),%rax
or     (%rax),%ecx
mov    0x2ebd(%rip),%rax
or     (%rax),%ecx
mov    0x2dfc(%rip),%rax
or     (%rax),%ecx
mov    0x2e8b(%rip),%rax
or     (%rax),%ecx
mov    0x2e72(%rip),%rax
or     (%rax),%ecx
mov    0x2e81(%rip),%rax
or     (%rax),%ecx
mov    0x2e50(%rip),%rax
or     (%rax),%ecx
mov    0x2daf(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2dab(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2e2a(%rip),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
mov    0x2dfc(%rip),%rax
mov    (%rax),%ecx
mov    0x2deb(%rip),%rax
or     (%rax),%ecx
mov    0x2d8a(%rip),%rax
or     (%rax),%ecx
mov    0x2d71(%rip),%rax
or     (%rax),%ecx
mov    0x2d48(%rip),%rax
or     (%rax),%ecx
mov    0x2dbf(%rip),%rax
or     (%rax),%ecx
mov    0x2d7e(%rip),%rax
or     (%rax),%ecx
mov    0x2d7d(%rip),%rax
or     (%rax),%ecx
mov    0x2df4(%rip),%rax
or     (%rax),%ecx
mov    0x2d03(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    0x2d5d(%rip),%rax
mov    (%rax),%ecx
mov    0x2d94(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    0x2d4e(%rip),%rax
mov    (%rax),%ecx
mov    0x2d4d(%rip),%rax
or     (%rax),%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x2d22(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x2cb9(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfmakeraw>:
mov    0x2e01(%rip),%rcx
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2e2f(%rip),%rcx
or     (%rcx),%eax
mov    0x2e66(%rip),%rcx
or     (%rcx),%eax
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    0x2e04(%rip),%rcx
or     (%rcx),%eax
mov    0x2e93(%rip),%rcx
or     (%rcx),%eax
mov    0x2e7a(%rip),%rcx
or     (%rcx),%eax
mov    0x2e89(%rip),%rcx
or     (%rcx),%eax
mov    0x2e58(%rip),%rcx
or     (%rcx),%eax
mov    0x2db7(%rip),%rcx
or     (%rcx),%eax
not    %eax
and    (%rdi),%eax
mov    %eax,(%rdi)
mov    0x2db8(%rip),%rcx
or     (%rcx),%eax
mov    %eax,(%rdi)
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,0x18(%rdi)
mov    0x2e17(%rip),%rax
mov    0x2e08(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2da5(%rip),%rax
or     (%rax),%ecx
mov    0x2d8c(%rip),%rax
or     (%rax),%ecx
mov    0x2d63(%rip),%rax
or     (%rax),%ecx
mov    0x2dda(%rip),%rax
or     (%rax),%ecx
mov    0x2d99(%rip),%rax
or     (%rax),%ecx
mov    0x2d98(%rip),%rax
or     (%rax),%ecx
mov    0x2e0f(%rip),%rax
or     (%rax),%ecx
mov    0x2d1e(%rip),%rax
or     (%rax),%ecx
not    %ecx
and    %ecx,0x4(%rdi)
mov    0x2d80(%rip),%rax
mov    0x2db9(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
not    %ecx
and    0x8(%rdi),%ecx
mov    0x2d79(%rip),%rax
mov    0x2d7a(%rip),%rdx
or     (%rax),%ecx
or     (%rdx),%ecx
mov    %ecx,0x8(%rdi)
mov    0x10(%rdi),%rax
mov    0x2d58(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    0x2cf7(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@IMAXBEL = global i32 0
@IXOFF = global i32 0
@INPCK = global i32 0
@BRKINT = global i32 0
@PARMRK = global i32 0
@ISTRIP = global i32 0
@INLCR = global i32 0
@IGNCR = global i32 0
@ICRNL = global i32 0
@IXON = global i32 0
@IGNPAR = global i32 0
@IGNBRK = global i32 0
@OPOST = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ECHOK = global i32 0
@ECHONL = global i32 0
@ICANON = global i32 0
@ISIG = global i32 0
@IEXTEN = global i32 0
@NOFLSH = global i32 0
@TOSTOP = global i32 0
@PENDIN = global i32 0
@CSIZE = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CREAD = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
define void @cfmakeraw(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @IMAXBEL
%4 = load i32, i32* @IXOFF
%5 = or i32 %3, %4
%6 = load i32, i32* @INPCK
%7 = or i32 %5, %6
%8 = load i32, i32* @BRKINT
%9 = or i32 %7, %8
%10 = load i32, i32* @PARMRK
%11 = or i32 %9, %10
%12 = load i32, i32* @ISTRIP
%13 = or i32 %11, %12
%14 = load i32, i32* @INLCR
%15 = or i32 %13, %14
%16 = load i32, i32* @IGNCR
%17 = or i32 %15, %16
%18 = load i32, i32* @ICRNL
%19 = or i32 %17, %18
%20 = load i32, i32* @IXON
%21 = or i32 %19, %20
%22 = load i32, i32* @IGNPAR
%23 = or i32 %21, %22
%24 = xor i32 %23, -1
%25 = load %struct.termios*, %struct.termios** %2
%26 = getelementptr inbounds %struct.termios, %struct.termios* %25, i32 0, i32 0
%27 = load i32, i32* %26
%28 = and i32 %27, %24
store i32 %28, i32* %26
%29 = load i32, i32* @IGNBRK
%30 = load %struct.termios*, %struct.termios** %2
%31 = getelementptr inbounds %struct.termios, %struct.termios* %30, i32 0, i32 0
%32 = load i32, i32* %31
%33 = or i32 %32, %29
store i32 %33, i32* %31
%34 = load i32, i32* @OPOST
%35 = xor i32 %34, -1
%36 = load %struct.termios*, %struct.termios** %2
%37 = getelementptr inbounds %struct.termios, %struct.termios* %36, i32 0, i32 4
%38 = load i32, i32* %37
%39 = and i32 %38, %35
store i32 %39, i32* %37
%40 = load i32, i32* @ECHO
%41 = load i32, i32* @ECHOE
%42 = or i32 %40, %41
%43 = load i32, i32* @ECHOK
%44 = or i32 %42, %43
%45 = load i32, i32* @ECHONL
%46 = or i32 %44, %45
%47 = load i32, i32* @ICANON
%48 = or i32 %46, %47
%49 = load i32, i32* @ISIG
%50 = or i32 %48, %49
%51 = load i32, i32* @IEXTEN
%52 = or i32 %50, %51
%53 = load i32, i32* @NOFLSH
%54 = or i32 %52, %53
%55 = load i32, i32* @TOSTOP
%56 = or i32 %54, %55
%57 = load i32, i32* @PENDIN
%58 = or i32 %56, %57
%59 = xor i32 %58, -1
%60 = load %struct.termios*, %struct.termios** %2
%61 = getelementptr inbounds %struct.termios, %struct.termios* %60, i32 0, i32 1
%62 = load i32, i32* %61
%63 = and i32 %62, %59
store i32 %63, i32* %61
%64 = load i32, i32* @CSIZE
%65 = load i32, i32* @PARENB
%66 = or i32 %64, %65
%67 = xor i32 %66, -1
%68 = load %struct.termios*, %struct.termios** %2
%69 = getelementptr inbounds %struct.termios, %struct.termios* %68, i32 0, i32 2
%70 = load i32, i32* %69
%71 = and i32 %70, %67
store i32 %71, i32* %69
%72 = load i32, i32* @CS8
%73 = load i32, i32* @CREAD
%74 = or i32 %72, %73
%75 = load %struct.termios*, %struct.termios** %2
%76 = getelementptr inbounds %struct.termios, %struct.termios* %75, i32 0, i32 2
%77 = load i32, i32* %76
%78 = or i32 %77, %74
store i32 %78, i32* %76
%79 = load %struct.termios*, %struct.termios** %2
%80 = getelementptr inbounds %struct.termios, %struct.termios* %79, i32 0, i32 3
%81 = load i32*, i32** %80
%82 = load i64, i64* @VMIN
%83 = getelementptr inbounds i32, i32* %81, i64 %82
store i32 1, i32* %83
%84 = load %struct.termios*, %struct.termios** %2
%85 = getelementptr inbounds %struct.termios, %struct.termios* %84, i32 0, i32 3
%86 = load i32*, i32** %85
%87 = load i64, i64* @VTIME
%88 = getelementptr inbounds i32, i32* %86, i64 %87
store i32 0, i32* %88
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32, i32, i32, i32*, i32 }
@IMAXBEL = global i32 0
@IXOFF = global i32 0
@INPCK = global i32 0
@BRKINT = global i32 0
@PARMRK = global i32 0
@ISTRIP = global i32 0
@INLCR = global i32 0
@IGNCR = global i32 0
@ICRNL = global i32 0
@IXON = global i32 0
@IGNPAR = global i32 0
@IGNBRK = global i32 0
@OPOST = global i32 0
@ECHO = global i32 0
@ECHOE = global i32 0
@ECHOK = global i32 0
@ECHONL = global i32 0
@ICANON = global i32 0
@ISIG = global i32 0
@IEXTEN = global i32 0
@NOFLSH = global i32 0
@TOSTOP = global i32 0
@PENDIN = global i32 0
@CSIZE = global i32 0
@PARENB = global i32 0
@CS8 = global i32 0
@CREAD = global i32 0
@VMIN = global i64 0
@VTIME = global i64 0
define void @cfmakeraw(%struct.termios* nocapture %0) {
%2 = load i32, i32* @IMAXBEL
%3 = load i32, i32* @IXOFF
%4 = or i32 %3, %2
%5 = load i32, i32* @INPCK
%6 = or i32 %4, %5
%7 = load i32, i32* @BRKINT
%8 = or i32 %6, %7
%9 = load i32, i32* @PARMRK
%10 = or i32 %8, %9
%11 = load i32, i32* @ISTRIP
%12 = or i32 %10, %11
%13 = load i32, i32* @INLCR
%14 = or i32 %12, %13
%15 = load i32, i32* @IGNCR
%16 = or i32 %14, %15
%17 = load i32, i32* @ICRNL
%18 = or i32 %16, %17
%19 = load i32, i32* @IXON
%20 = or i32 %18, %19
%21 = load i32, i32* @IGNPAR
%22 = or i32 %20, %21
%23 = xor i32 %22, -1
%24 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%25 = load i32, i32* %24
%26 = and i32 %25, %23
store i32 %26, i32* %24
%27 = load i32, i32* @IGNBRK
%28 = or i32 %27, %26
store i32 %28, i32* %24
%29 = load i32, i32* @OPOST
%30 = xor i32 %29, -1
%31 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 4
%32 = load i32, i32* %31
%33 = and i32 %32, %30
store i32 %33, i32* %31
%34 = load i32, i32* @ECHO
%35 = load i32, i32* @ECHOE
%36 = or i32 %35, %34
%37 = load i32, i32* @ECHOK
%38 = or i32 %36, %37
%39 = load i32, i32* @ECHONL
%40 = or i32 %38, %39
%41 = load i32, i32* @ICANON
%42 = or i32 %40, %41
%43 = load i32, i32* @ISIG
%44 = or i32 %42, %43
%45 = load i32, i32* @IEXTEN
%46 = or i32 %44, %45
%47 = load i32, i32* @NOFLSH
%48 = or i32 %46, %47
%49 = load i32, i32* @TOSTOP
%50 = or i32 %48, %49
%51 = load i32, i32* @PENDIN
%52 = or i32 %50, %51
%53 = xor i32 %52, -1
%54 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
%55 = load i32, i32* %54
%56 = and i32 %55, %53
store i32 %56, i32* %54
%57 = load i32, i32* @CSIZE
%58 = load i32, i32* @PARENB
%59 = or i32 %58, %57
%60 = xor i32 %59, -1
%61 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 2
%62 = load i32, i32* %61
%63 = and i32 %62, %60
%64 = load i32, i32* @CS8
%65 = load i32, i32* @CREAD
%66 = or i32 %64, %63
%67 = or i32 %66, %65
store i32 %67, i32* %61
%68 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 3
%69 = load i32*, i32** %68
%70 = load i64, i64* @VMIN
%71 = getelementptr inbounds i32, i32* %69, i64 %70
store i32 1, i32* %71
%72 = load i64, i64* @VTIME
%73 = getelementptr inbounds i32, i32* %69, i64 %72
store i32 0, i32* %73
ret void
}