#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 */

/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
int /*<<< orphan*/ lputs(int, char *);
int tio_get_rs232_lines(int fd) {
  int flags;
  flags = -1;
  if (flags != -1) {
    lprintf(5, "tio_get_rs232_lines: status:");
    if (flags & 0x004)
      lputs(5, " RTS");
    if (flags & 0x008)
      lputs(5, " CTS");
    if (flags & 0x002)
      lputs(5, " DSR");
    if (flags & 0x001)
      lputs(5, " DTR");
    if (flags & 0x010)
      lputs(5, " DCD");
    if (flags & 0x020)
      lputs(5, " RI");
  }
  return flags;
}


x86 assembly (clang, -O0):
<tio_get_rs232_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1212 <tio_get_rs232_lines+0xf2>
mov    $0x5,%edi
lea    0xeb8(%rip),%rsi
call   1040 <lprintf@plt>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     116d <tio_get_rs232_lines+0x4d>
mov    $0x5,%edi
lea    0xeb5(%rip),%rsi
call   1030 <lputs@plt>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     118d <tio_get_rs232_lines+0x6d>
mov    $0x5,%edi
lea    0xe9a(%rip),%rsi
call   1030 <lputs@plt>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11ad <tio_get_rs232_lines+0x8d>
mov    $0x5,%edi
lea    0xe7f(%rip),%rsi
call   1030 <lputs@plt>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11cd <tio_get_rs232_lines+0xad>
mov    $0x5,%edi
lea    0xe64(%rip),%rsi
call   1030 <lputs@plt>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11ed <tio_get_rs232_lines+0xcd>
mov    $0x5,%edi
lea    0xe49(%rip),%rsi
call   1030 <lputs@plt>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     120d <tio_get_rs232_lines+0xed>
mov    $0x5,%edi
lea    0xe2e(%rip),%rsi
call   1030 <lputs@plt>
jmp    1212 <tio_get_rs232_lines+0xf2>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_get_rs232_lines>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"tio_get_rs232_lines: status:\00"
@.str.1 = [5 x i8] c" RTS\00"
@.str.2 = [5 x i8] c" CTS\00"
@.str.3 = [5 x i8] c" DSR\00"
@.str.4 = [5 x i8] c" DTR\00"
@.str.5 = [5 x i8] c" DCD\00"
@.str.6 = [4 x i8] c" RI\00"
define i32 @tio_get_rs232_lines(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %44
6: ; preds = %1
%7 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = and i32 %8, 4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
%14 = load i32, i32* %3
%15 = and i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
%21 = and i32 %20, 2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
%26 = load i32, i32* %3
%27 = and i32 %26, 1
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
%32 = load i32, i32* %3
%33 = and i32 %32, 16
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %31
%38 = load i32, i32* %3
%39 = and i32 %38, 32
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @lputs(i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %43
43: ; preds = %41, %37
br label %44
44: ; preds = %43, %1
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
define i32 @tio_get_rs232_lines(i32 %0) {
ret i32 -1
}