long cur_setterm(option, setflag)
long option;
long setflag;
{
  if ((((option) & (2L * 1L)) == (2L * 1L))) {
    if ((((setflag) & (2L * 1L)) == (2L * 1L))) {
      cbreak();
    } else {
      nocbreak();
    }
  }
  if ((((option) & (2L * 2L * 1L)) == (2L * 2L * 1L))) {
    if ((((setflag) & (2L * 2L * 1L)) == (2L * 2L * 1L))) {
      echo();
    } else {
      noecho();
    }
  }
  if ((((option) & (1L)) == (1L))) {
    if ((((setflag) & (1L)) == (1L))) {
      nl();
    } else {
      nonl();
    }
  }
  if ((((option) & (2L * 2L * 2L * 1L)) == (2L * 2L * 2L * 1L))) {
    if ((((setflag) & (2L * 2L * 2L * 1L)) == (2L * 2L * 2L * 1L))) {
      raw();
    } else {
      noraw();
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<cur_setterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x2,%rax
cmp    $0x2,%rax
jne    11cc <cur_setterm+0x4c>
mov    -0x10(%rbp),%rax
and    $0x2,%rax
cmp    $0x2,%rax
jne    11c0 <cur_setterm+0x40>
mov    $0x0,%al
call   1050 <cbreak@plt>
jmp    11c7 <cur_setterm+0x47>
mov    $0x0,%al
call   1090 <nocbreak@plt>
jmp    11cc <cur_setterm+0x4c>
mov    -0x8(%rbp),%rax
and    $0x4,%rax
cmp    $0x4,%rax
jne    1208 <cur_setterm+0x88>
mov    -0x10(%rbp),%rax
and    $0x4,%rax
cmp    $0x4,%rax
jne    11fc <cur_setterm+0x7c>
mov    $0x0,%al
call   1030 <echo@plt>
jmp    1203 <cur_setterm+0x83>
mov    $0x0,%al
call   10a0 <noecho@plt>
jmp    1208 <cur_setterm+0x88>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    1244 <cur_setterm+0xc4>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    1238 <cur_setterm+0xb8>
mov    $0x0,%al
call   1040 <nl@plt>
jmp    123f <cur_setterm+0xbf>
mov    $0x0,%al
call   1080 <nonl@plt>
jmp    1244 <cur_setterm+0xc4>
mov    -0x8(%rbp),%rax
and    $0x8,%rax
cmp    $0x8,%rax
jne    1280 <cur_setterm+0x100>
mov    -0x10(%rbp),%rax
and    $0x8,%rax
cmp    $0x8,%rax
jne    1274 <cur_setterm+0xf4>
mov    $0x0,%al
call   1060 <raw@plt>
jmp    127b <cur_setterm+0xfb>
mov    $0x0,%al
call   1070 <noraw@plt>
jmp    1280 <cur_setterm+0x100>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_setterm>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   $0x2,%bl
jne    11a0 <cur_setterm+0x20>
test   $0x4,%bl
jne    11be <cur_setterm+0x3e>
test   $0x1,%bl
jne    11dc <cur_setterm+0x5c>
test   $0x8,%bl
jne    11fa <cur_setterm+0x7a>
jmp    120e <cur_setterm+0x8e>
xor    %eax,%eax
test   $0x2,%r14b
jne    11b4 <cur_setterm+0x34>
call   1090 <nocbreak@plt>
test   $0x4,%bl
je     1194 <cur_setterm+0x14>
jmp    11be <cur_setterm+0x3e>
call   1050 <cbreak@plt>
test   $0x4,%bl
je     1194 <cur_setterm+0x14>
xor    %eax,%eax
test   $0x4,%r14b
jne    11d2 <cur_setterm+0x52>
call   10a0 <noecho@plt>
test   $0x1,%bl
je     1199 <cur_setterm+0x19>
jmp    11dc <cur_setterm+0x5c>
call   1030 <echo@plt>
test   $0x1,%bl
je     1199 <cur_setterm+0x19>
xor    %eax,%eax
test   $0x1,%r14b
jne    11f0 <cur_setterm+0x70>
call   1080 <nonl@plt>
test   $0x8,%bl
jne    11fa <cur_setterm+0x7a>
jmp    120e <cur_setterm+0x8e>
call   1040 <nl@plt>
test   $0x8,%bl
je     120e <cur_setterm+0x8e>
xor    %eax,%eax
test   $0x8,%r14b
jne    1209 <cur_setterm+0x89>
call   1070 <noraw@plt>
jmp    120e <cur_setterm+0x8e>
call   1060 <raw@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @cur_setterm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, 2
%7 = icmp eq i64 %6, 2
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i64, i64* %4
%10 = and i64 %9, 2
%11 = icmp eq i64 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @cbreak()
br label %16
14: ; preds = %8
%15 = call i32 (...) @nocbreak()
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %2
%18 = load i64, i64* %3
%19 = and i64 %18, 4
%20 = icmp eq i64 %19, 4
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i64, i64* %4
%23 = and i64 %22, 4
%24 = icmp eq i64 %23, 4
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @echo()
br label %29
27: ; preds = %21
%28 = call i32 (...) @noecho()
br label %29
29: ; preds = %27, %25
br label %30
30: ; preds = %29, %17
%31 = load i64, i64* %3
%32 = and i64 %31, 1
%33 = icmp eq i64 %32, 1
br i1 %33, label %34, label %43
34: ; preds = %30
%35 = load i64, i64* %4
%36 = and i64 %35, 1
%37 = icmp eq i64 %36, 1
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (...) @nl()
br label %42
40: ; preds = %34
%41 = call i32 (...) @nonl()
br label %42
42: ; preds = %40, %38
br label %43
43: ; preds = %42, %30
%44 = load i64, i64* %3
%45 = and i64 %44, 8
%46 = icmp eq i64 %45, 8
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = load i64, i64* %4
%49 = and i64 %48, 8
%50 = icmp eq i64 %49, 8
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (...) @raw()
br label %55
53: ; preds = %47
%54 = call i32 (...) @noraw()
br label %55
55: ; preds = %53, %51
br label %56
56: ; preds = %55, %43
ret i64 1
}

LLVM IR (-O2):
define i64 @cur_setterm(i64 %0, i64 %1) {
%3 = and i64 %0, 2
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = and i64 %1, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @cbreak()
br label %12
10: ; preds = %5
%11 = tail call i32 (...) @nocbreak()
br label %12
12: ; preds = %8, %10, %2
%13 = and i64 %0, 4
%14 = icmp eq i64 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = and i64 %1, 4
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @echo()
br label %22
20: ; preds = %15
%21 = tail call i32 (...) @noecho()
br label %22
22: ; preds = %18, %20, %12
%23 = and i64 %0, 1
%24 = icmp eq i64 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = and i64 %1, 1
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 (...) @nl()
br label %32
30: ; preds = %25
%31 = tail call i32 (...) @nonl()
br label %32
32: ; preds = %28, %30, %22
%33 = and i64 %0, 8
%34 = icmp eq i64 %33, 0
br i1 %34, label %42, label %35
35: ; preds = %32
%36 = and i64 %1, 8
%37 = icmp eq i64 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = tail call i32 (...) @raw()
br label %42
40: ; preds = %35
%41 = tail call i32 (...) @noraw()
br label %42
42: ; preds = %38, %40, %32
ret i64 1
}