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

/* Variables and functions */
int /*<<< orphan*/ LogPortSettings(unsigned long, unsigned char, unsigned char,
                                   unsigned char, unsigned char, unsigned char);
unsigned char Termios2TncomDataSize(struct termios *);
unsigned char Termios2TncomInFlow(struct termios *);
unsigned char Termios2TncomOutFlow(struct termios *);
unsigned char Termios2TncomParity(struct termios *);
unsigned long Termios2TncomSpeed(struct termios *);
unsigned char Termios2TncomStopSize(struct termios *);
void UnixLogPortSettings(struct termios *ti) {
  unsigned long speed;
  unsigned char datasize;
  unsigned char parity;
  unsigned char stopsize;
  unsigned char outflow, inflow;
  speed = Termios2TncomSpeed(ti);
  datasize = Termios2TncomDataSize(ti);
  parity = Termios2TncomParity(ti);
  stopsize = Termios2TncomStopSize(ti);
  outflow = Termios2TncomOutFlow(ti);
  inflow = Termios2TncomInFlow(ti);
  LogPortSettings(speed, datasize, parity, stopsize, outflow, inflow);
}


x86 assembly (clang, -O0):
<UnixLogPortSettings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Termios2TncomSpeed@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <Termios2TncomDataSize@plt>
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <Termios2TncomParity@plt>
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Termios2TncomStopSize@plt>
mov    %al,-0x13(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <Termios2TncomOutFlow@plt>
mov    %al,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <Termios2TncomInFlow@plt>
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%sil
mov    -0x12(%rbp),%dl
mov    -0x13(%rbp),%cl
mov    -0x14(%rbp),%al
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %al,%r8d
movzbl -0x15(%rbp),%r9d
call   1080 <LogPortSettings@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixLogPortSettings>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <Termios2TncomSpeed@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1070 <Termios2TncomDataSize@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <Termios2TncomParity@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <Termios2TncomStopSize@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1090 <Termios2TncomOutFlow@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <Termios2TncomInFlow@plt>
movzbl %bpl,%esi
movzbl %r15b,%edx
movzbl %r12b,%ecx
movzbl %r13b,%r8d
movzbl %al,%r9d
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <LogPortSettings@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
define void @UnixLogPortSettings(%struct.termios* %0) {
%2 = alloca %struct.termios*
%3 = alloca i64
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store %struct.termios* %0, %struct.termios** %2
%9 = load %struct.termios*, %struct.termios** %2
%10 = call i64 @Termios2TncomSpeed(%struct.termios* %9)
store i64 %10, i64* %3
%11 = load %struct.termios*, %struct.termios** %2
%12 = call zeroext i8 @Termios2TncomDataSize(%struct.termios* %11)
store i8 %12, i8* %4
%13 = load %struct.termios*, %struct.termios** %2
%14 = call zeroext i8 @Termios2TncomParity(%struct.termios* %13)
store i8 %14, i8* %5
%15 = load %struct.termios*, %struct.termios** %2
%16 = call zeroext i8 @Termios2TncomStopSize(%struct.termios* %15)
store i8 %16, i8* %6
%17 = load %struct.termios*, %struct.termios** %2
%18 = call zeroext i8 @Termios2TncomOutFlow(%struct.termios* %17)
store i8 %18, i8* %7
%19 = load %struct.termios*, %struct.termios** %2
%20 = call zeroext i8 @Termios2TncomInFlow(%struct.termios* %19)
store i8 %20, i8* %8
%21 = load i64, i64* %3
%22 = load i8, i8* %4
%23 = load i8, i8* %5
%24 = load i8, i8* %6
%25 = load i8, i8* %7
%26 = load i8, i8* %8
%27 = call i32 @LogPortSettings(i64 %21, i8 zeroext %22, i8 zeroext %23, i8 zeroext %24, i8 zeroext %25, i8 zeroext %26)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define void @UnixLogPortSettings(%struct.termios* %0) {
%2 = tail call i64 @Termios2TncomSpeed(%struct.termios* %0)
%3 = tail call zeroext i8 @Termios2TncomDataSize(%struct.termios* %0)
%4 = tail call zeroext i8 @Termios2TncomParity(%struct.termios* %0)
%5 = tail call zeroext i8 @Termios2TncomStopSize(%struct.termios* %0)
%6 = tail call zeroext i8 @Termios2TncomOutFlow(%struct.termios* %0)
%7 = tail call zeroext i8 @Termios2TncomInFlow(%struct.termios* %0)
%8 = tail call i32 @LogPortSettings(i64 %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7)
ret void
}