#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 {
  unsigned short c_cflag;
  int *c_cc;
  scalar_t__ c_lflag;
  scalar_t__ c_oflag;
  int /*<<< orphan*/ c_iflag;
};

/* Variables and functions */
unsigned short CLOCAL;
unsigned short CREAD;
unsigned short CS8;
int /*<<< orphan*/ IGNPAR;
size_t VDISCARD;
size_t VEOF;
size_t VEOL;
size_t VEOL2;
size_t VERASE;
size_t VINTR;
size_t VKILL;
size_t VLNEXT;
size_t VMIN;
size_t VQUIT;
size_t VREPRINT;
size_t VSTART;
size_t VSTOP;
size_t VSUSP;
size_t VSWTC;
size_t VTIME;
size_t VWERASE;
int /*<<< orphan*/ bzero(struct termios *, int);
void setTermios(struct termios *pNewtio, unsigned short uBaudRate) {
  bzero(pNewtio, sizeof(struct termios));
  pNewtio->c_cflag = uBaudRate | CS8 | CREAD | CLOCAL;
  pNewtio->c_iflag = IGNPAR;
  pNewtio->c_oflag = 0;
  pNewtio->c_lflag = 0;
  pNewtio->c_cc[VINTR] = 0;
  pNewtio->c_cc[VQUIT] = 0;
  pNewtio->c_cc[VERASE] = 0;
  pNewtio->c_cc[VKILL] = 0;
  pNewtio->c_cc[VEOF] = 4;
  pNewtio->c_cc[VTIME] = 5;
  pNewtio->c_cc[VMIN] = 0;
  pNewtio->c_cc[VSWTC] = 0;
  pNewtio->c_cc[VSTART] = 0;
  pNewtio->c_cc[VSTOP] = 0;
  pNewtio->c_cc[VSUSP] = 0;
  pNewtio->c_cc[VEOL] = 0;
  pNewtio->c_cc[VREPRINT] = 0;
  pNewtio->c_cc[VDISCARD] = 0;
  pNewtio->c_cc[VWERASE] = 0;
  pNewtio->c_cc[VLNEXT] = 0;
  pNewtio->c_cc[VEOL2] = 0;
}


x86 assembly (clang, -O0):
<setTermios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1030 <bzero@plt>
movzwl -0xa(%rbp),%eax
mov    0x2e6c(%rip),%rcx
movzwl (%rcx),%ecx
or     %ecx,%eax
mov    0x2e68(%rip),%rcx
movzwl (%rcx),%ecx
or     %ecx,%eax
mov    0x2dec(%rip),%rcx
movzwl (%rcx),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    0x2e06(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2dbe(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2dd5(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2df4(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2df3(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d3a(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x4,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d69(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d70(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d2f(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ce6(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d55(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ccc(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ca3(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2cf2(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ce9(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2ce8(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2c7f(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2cbe(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTermios>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x28,%esi
call   1030 <bzero@plt>
mov    0x2e7e(%rip),%rax
or     (%rax),%bx
mov    0x2e7c(%rip),%rax
or     (%rax),%bx
mov    0x2e02(%rip),%rax
or     (%rax),%bx
mov    %bx,(%r14)
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%r14)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%r14)
mov    0x8(%r14),%rax
mov    0x2df3(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2e12(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2e39(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2e40(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d8f(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x4,(%rax,%rcx,4)
mov    0x2dc6(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    0x2dd5(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d9c(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d5b(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2dd2(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d51(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d30(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d87(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d86(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d8d(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d2c(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    0x2d73(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.termios = type { i16, i32*, i64, i64, i32 }
@CS8 = global i16 0
@CREAD = global i16 0
@CLOCAL = global i16 0
@IGNPAR = global i32 0
@VINTR = global i64 0
@VQUIT = global i64 0
@VERASE = global i64 0
@VKILL = global i64 0
@VEOF = global i64 0
@VTIME = global i64 0
@VMIN = global i64 0
@VSWTC = global i64 0
@VSTART = global i64 0
@VSTOP = global i64 0
@VSUSP = global i64 0
@VEOL = global i64 0
@VREPRINT = global i64 0
@VDISCARD = global i64 0
@VWERASE = global i64 0
@VLNEXT = global i64 0
@VEOL2 = global i64 0
define void @setTermios(%struct.termios* %0, i16 zeroext %1) {
%3 = alloca %struct.termios*
%4 = alloca i16
store %struct.termios* %0, %struct.termios** %3
store i16 %1, i16* %4
%5 = load %struct.termios*, %struct.termios** %3
%6 = call i32 @bzero(%struct.termios* %5, i32 40)
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = load i16, i16* @CS8
%10 = zext i16 %9 to i32
%11 = or i32 %8, %10
%12 = load i16, i16* @CREAD
%13 = zext i16 %12 to i32
%14 = or i32 %11, %13
%15 = load i16, i16* @CLOCAL
%16 = zext i16 %15 to i32
%17 = or i32 %14, %16
%18 = trunc i32 %17 to i16
%19 = load %struct.termios*, %struct.termios** %3
%20 = getelementptr inbounds %struct.termios, %struct.termios* %19, i32 0, i32 0
store i16 %18, i16* %20
%21 = load i32, i32* @IGNPAR
%22 = load %struct.termios*, %struct.termios** %3
%23 = getelementptr inbounds %struct.termios, %struct.termios* %22, i32 0, i32 4
store i32 %21, i32* %23
%24 = load %struct.termios*, %struct.termios** %3
%25 = getelementptr inbounds %struct.termios, %struct.termios* %24, i32 0, i32 3
store i64 0, i64* %25
%26 = load %struct.termios*, %struct.termios** %3
%27 = getelementptr inbounds %struct.termios, %struct.termios* %26, i32 0, i32 2
store i64 0, i64* %27
%28 = load %struct.termios*, %struct.termios** %3
%29 = getelementptr inbounds %struct.termios, %struct.termios* %28, i32 0, i32 1
%30 = load i32*, i32** %29
%31 = load i64, i64* @VINTR
%32 = getelementptr inbounds i32, i32* %30, i64 %31
store i32 0, i32* %32
%33 = load %struct.termios*, %struct.termios** %3
%34 = getelementptr inbounds %struct.termios, %struct.termios* %33, i32 0, i32 1
%35 = load i32*, i32** %34
%36 = load i64, i64* @VQUIT
%37 = getelementptr inbounds i32, i32* %35, i64 %36
store i32 0, i32* %37
%38 = load %struct.termios*, %struct.termios** %3
%39 = getelementptr inbounds %struct.termios, %struct.termios* %38, i32 0, i32 1
%40 = load i32*, i32** %39
%41 = load i64, i64* @VERASE
%42 = getelementptr inbounds i32, i32* %40, i64 %41
store i32 0, i32* %42
%43 = load %struct.termios*, %struct.termios** %3
%44 = getelementptr inbounds %struct.termios, %struct.termios* %43, i32 0, i32 1
%45 = load i32*, i32** %44
%46 = load i64, i64* @VKILL
%47 = getelementptr inbounds i32, i32* %45, i64 %46
store i32 0, i32* %47
%48 = load %struct.termios*, %struct.termios** %3
%49 = getelementptr inbounds %struct.termios, %struct.termios* %48, i32 0, i32 1
%50 = load i32*, i32** %49
%51 = load i64, i64* @VEOF
%52 = getelementptr inbounds i32, i32* %50, i64 %51
store i32 4, i32* %52
%53 = load %struct.termios*, %struct.termios** %3
%54 = getelementptr inbounds %struct.termios, %struct.termios* %53, i32 0, i32 1
%55 = load i32*, i32** %54
%56 = load i64, i64* @VTIME
%57 = getelementptr inbounds i32, i32* %55, i64 %56
store i32 5, i32* %57
%58 = load %struct.termios*, %struct.termios** %3
%59 = getelementptr inbounds %struct.termios, %struct.termios* %58, i32 0, i32 1
%60 = load i32*, i32** %59
%61 = load i64, i64* @VMIN
%62 = getelementptr inbounds i32, i32* %60, i64 %61
store i32 0, i32* %62
%63 = load %struct.termios*, %struct.termios** %3
%64 = getelementptr inbounds %struct.termios, %struct.termios* %63, i32 0, i32 1
%65 = load i32*, i32** %64
%66 = load i64, i64* @VSWTC
%67 = getelementptr inbounds i32, i32* %65, i64 %66
store i32 0, i32* %67
%68 = load %struct.termios*, %struct.termios** %3
%69 = getelementptr inbounds %struct.termios, %struct.termios* %68, i32 0, i32 1
%70 = load i32*, i32** %69
%71 = load i64, i64* @VSTART
%72 = getelementptr inbounds i32, i32* %70, i64 %71
store i32 0, i32* %72
%73 = load %struct.termios*, %struct.termios** %3
%74 = getelementptr inbounds %struct.termios, %struct.termios* %73, i32 0, i32 1
%75 = load i32*, i32** %74
%76 = load i64, i64* @VSTOP
%77 = getelementptr inbounds i32, i32* %75, i64 %76
store i32 0, i32* %77
%78 = load %struct.termios*, %struct.termios** %3
%79 = getelementptr inbounds %struct.termios, %struct.termios* %78, i32 0, i32 1
%80 = load i32*, i32** %79
%81 = load i64, i64* @VSUSP
%82 = getelementptr inbounds i32, i32* %80, i64 %81
store i32 0, i32* %82
%83 = load %struct.termios*, %struct.termios** %3
%84 = getelementptr inbounds %struct.termios, %struct.termios* %83, i32 0, i32 1
%85 = load i32*, i32** %84
%86 = load i64, i64* @VEOL
%87 = getelementptr inbounds i32, i32* %85, i64 %86
store i32 0, i32* %87
%88 = load %struct.termios*, %struct.termios** %3
%89 = getelementptr inbounds %struct.termios, %struct.termios* %88, i32 0, i32 1
%90 = load i32*, i32** %89
%91 = load i64, i64* @VREPRINT
%92 = getelementptr inbounds i32, i32* %90, i64 %91
store i32 0, i32* %92
%93 = load %struct.termios*, %struct.termios** %3
%94 = getelementptr inbounds %struct.termios, %struct.termios* %93, i32 0, i32 1
%95 = load i32*, i32** %94
%96 = load i64, i64* @VDISCARD
%97 = getelementptr inbounds i32, i32* %95, i64 %96
store i32 0, i32* %97
%98 = load %struct.termios*, %struct.termios** %3
%99 = getelementptr inbounds %struct.termios, %struct.termios* %98, i32 0, i32 1
%100 = load i32*, i32** %99
%101 = load i64, i64* @VWERASE
%102 = getelementptr inbounds i32, i32* %100, i64 %101
store i32 0, i32* %102
%103 = load %struct.termios*, %struct.termios** %3
%104 = getelementptr inbounds %struct.termios, %struct.termios* %103, i32 0, i32 1
%105 = load i32*, i32** %104
%106 = load i64, i64* @VLNEXT
%107 = getelementptr inbounds i32, i32* %105, i64 %106
store i32 0, i32* %107
%108 = load %struct.termios*, %struct.termios** %3
%109 = getelementptr inbounds %struct.termios, %struct.termios* %108, i32 0, i32 1
%110 = load i32*, i32** %109
%111 = load i64, i64* @VEOL2
%112 = getelementptr inbounds i32, i32* %110, i64 %111
store i32 0, i32* %112
ret void
}

LLVM IR (-O2):
%struct.termios = type { i16, i32*, i64, i64, i32 }
@CS8 = global i16 0
@CREAD = global i16 0
@CLOCAL = global i16 0
@IGNPAR = global i32 0
@VINTR = global i64 0
@VQUIT = global i64 0
@VERASE = global i64 0
@VKILL = global i64 0
@VEOF = global i64 0
@VTIME = global i64 0
@VMIN = global i64 0
@VSWTC = global i64 0
@VSTART = global i64 0
@VSTOP = global i64 0
@VSUSP = global i64 0
@VEOL = global i64 0
@VREPRINT = global i64 0
@VDISCARD = global i64 0
@VWERASE = global i64 0
@VLNEXT = global i64 0
@VEOL2 = global i64 0
define void @setTermios(%struct.termios* nocapture %0, i16 zeroext %1) {
%3 = tail call i32 @bzero(%struct.termios* %0, i32 40)
%4 = load i16, i16* @CS8
%5 = or i16 %4, %1
%6 = load i16, i16* @CREAD
%7 = or i16 %5, %6
%8 = load i16, i16* @CLOCAL
%9 = or i16 %7, %8
%10 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
store i16 %9, i16* %10
%11 = load i32, i32* @IGNPAR
%12 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 4
store i32 %11, i32* %12
%13 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 2
%14 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
%15 = bitcast i64* %13 to i8*
%16 = load i32*, i32** %14
%17 = load i64, i64* @VINTR
%18 = getelementptr inbounds i32, i32* %16, i64 %17
store i32 0, i32* %18
%19 = load i64, i64* @VQUIT
%20 = getelementptr inbounds i32, i32* %16, i64 %19
store i32 0, i32* %20
%21 = load i64, i64* @VERASE
%22 = getelementptr inbounds i32, i32* %16, i64 %21
store i32 0, i32* %22
%23 = load i64, i64* @VKILL
%24 = getelementptr inbounds i32, i32* %16, i64 %23
store i32 0, i32* %24
%25 = load i64, i64* @VEOF
%26 = getelementptr inbounds i32, i32* %16, i64 %25
store i32 4, i32* %26
%27 = load i64, i64* @VTIME
%28 = getelementptr inbounds i32, i32* %16, i64 %27
store i32 5, i32* %28
%29 = load i64, i64* @VMIN
%30 = getelementptr inbounds i32, i32* %16, i64 %29
store i32 0, i32* %30
%31 = load i64, i64* @VSWTC
%32 = getelementptr inbounds i32, i32* %16, i64 %31
store i32 0, i32* %32
%33 = load i64, i64* @VSTART
%34 = getelementptr inbounds i32, i32* %16, i64 %33
store i32 0, i32* %34
%35 = load i64, i64* @VSTOP
%36 = getelementptr inbounds i32, i32* %16, i64 %35
store i32 0, i32* %36
%37 = load i64, i64* @VSUSP
%38 = getelementptr inbounds i32, i32* %16, i64 %37
store i32 0, i32* %38
%39 = load i64, i64* @VEOL
%40 = getelementptr inbounds i32, i32* %16, i64 %39
store i32 0, i32* %40
%41 = load i64, i64* @VREPRINT
%42 = getelementptr inbounds i32, i32* %16, i64 %41
store i32 0, i32* %42
%43 = load i64, i64* @VDISCARD
%44 = getelementptr inbounds i32, i32* %16, i64 %43
store i32 0, i32* %44
%45 = load i64, i64* @VWERASE
%46 = getelementptr inbounds i32, i32* %16, i64 %45
store i32 0, i32* %46
%47 = load i64, i64* @VLNEXT
%48 = getelementptr inbounds i32, i32* %16, i64 %47
store i32 0, i32* %48
%49 = load i64, i64* @VEOL2
%50 = getelementptr inbounds i32, i32* %16, i64 %49
store i32 0, i32* %50
ret void
}