#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 */
unsigned int inb(int);
int /*<<< orphan*/ iopl(int);
int /*<<< orphan*/ outb(int, unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int set_clock(unsigned int ChipType, unsigned int ClockType,
              unsigned int ProgClock, unsigned int M, unsigned int N,
              unsigned int P, unsigned int PSN) {
  unsigned int tmp, idx;
  iopl(3);
  idx = inb(0x3D6);
  if (ChipType & 0x20) {
    if (ClockType & 0x1) {
      printf("XRCC = 0x%02X\n", M - 2);
      printf("XRCD = 0x%02X\n", N - 2);
      printf("XRCE = 0x%02X\n", (0x80 | (P * 16 + (PSN == 1))));
      outb(0x3D6, 0xCE);
      tmp = inb(0x3D7);
      outb(0x3D7, tmp & 0x7F);
      outb(0x3D6, 0xCC);
      outb(0x3D7, (M - 2));
      outb(0x3D6, 0xCD);
      outb(0x3D7, (N - 2));
      outb(0x3D6, 0xCE);
      outb(0x3D7, (0x80 | (P * 16 + (PSN == 1))));
    } else {
      printf("XR%X = 0x%02X\n", 0xC0 + 4 * ProgClock, M - 2);
      printf("XR%X = 0x%02X\n", 0xC1 + 4 * ProgClock, N - 2);
      printf("XR%X = 0x%02X\n", 0xC2 + 4 * ProgClock, 0);
      printf("XR%X = 0x%02X\n", 0xC3 + 4 * ProgClock, P * 16 + (PSN == 1));
      outb(0x3D6, 0xC0 + 4 * ProgClock);
      outb(0x3D7, (M - 2));
      outb(0x3D6, 0xC1 + 4 * ProgClock);
      outb(0x3D7, (N - 2));
      outb(0x3D6, 0xC2 + 4 * ProgClock);
      outb(0x3D7, 0x0);
      outb(0x3D6, 0xC3 + 4 * ProgClock);
      outb(0x3D7, (P * 16 + (PSN == 1)));
    }
  } else {
    printf("XR30 = 0x%02X\n", P * 2 + (PSN == 1));
    printf("XR31 = 0x%02X\n", M - 2);
    printf("XR32 = 0x%02X\n", N - 2);
    outb(0x3D6, 0x33);
    tmp = inb(0x3D7);
    if (ClockType & 0x1) {
      outb(0x3D7, tmp | 0x20);
    } else {
      outb(0x3D7, tmp & ~0x20);
    }
    outb(0x3D6, 0x30);
    outb(0x3D7, (P * 2 + (PSN == 1)));
    outb(0x3D6, 0x31);
    outb(0x3D7, (M - 2));
    outb(0x3D6, 0x32);
    outb(0x3D7, (N - 2));
    outb(0x3D6, 0x33);
    outb(0x3D7, tmp);
  }
  outb(0x3D6, idx);
  iopl(0);
  return 0;
}


x86 assembly (clang, -O0):
<set_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0x3,%edi
call   1040 <iopl@plt>
mov    $0x3d6,%edi
call   1060 <inb@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     13b7 <set_clock+0x277>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1286 <set_clock+0x146>
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
shl    $0x4,%esi
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
or     $0x80,%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3d6,%edi
mov    $0xce,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
call   1060 <inb@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
and    $0x7f,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0xcc,%esi
call   1050 <outb@plt>
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0xcd,%esi
call   1050 <outb@plt>
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0xce,%esi
call   1050 <outb@plt>
mov    -0x18(%rbp),%esi
shl    $0x4,%esi
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
or     $0x80,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
jmp    13b2 <set_clock+0x272>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc0,%esi
mov    -0x10(%rbp),%edx
sub    $0x2,%edx
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc1,%esi
mov    -0x14(%rbp),%edx
sub    $0x2,%edx
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc2,%esi
lea    0xd54(%rip),%rdi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc3,%esi
mov    -0x18(%rbp),%edx
shl    $0x4,%edx
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edx
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc0,%esi
mov    $0x3d6,%edi
call   1050 <outb@plt>
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc1,%esi
mov    $0x3d6,%edi
call   1050 <outb@plt>
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc2,%esi
mov    $0x3d6,%edi
call   1050 <outb@plt>
mov    $0x3d7,%edi
xor    %esi,%esi
call   1050 <outb@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
add    $0xc3,%esi
mov    $0x3d6,%edi
call   1050 <outb@plt>
mov    -0x18(%rbp),%esi
shl    $0x4,%esi
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
jmp    14d8 <set_clock+0x398>
mov    -0x18(%rbp),%esi
shl    $0x1,%esi
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
lea    0xc6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3d6,%edi
mov    $0x33,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
call   1060 <inb@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1441 <set_clock+0x301>
mov    -0x1c(%rbp),%esi
or     $0x20,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
jmp    1451 <set_clock+0x311>
mov    -0x1c(%rbp),%esi
and    $0xffffffdf,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0x30,%esi
call   1050 <outb@plt>
mov    -0x18(%rbp),%esi
shl    $0x1,%esi
cmpl   $0x1,0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0x31,%esi
call   1050 <outb@plt>
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0x32,%esi
call   1050 <outb@plt>
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0x33,%esi
call   1050 <outb@plt>
mov    -0x1c(%rbp),%esi
mov    $0x3d7,%edi
call   1050 <outb@plt>
mov    -0x20(%rbp),%esi
mov    $0x3d6,%edi
call   1050 <outb@plt>
xor    %edi,%edi
call   1040 <iopl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_clock>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r15d
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x3,%edi
call   1040 <iopl@plt>
mov    $0x3d6,%edi
call   1060 <inb@plt>
mov    %eax,0x14(%rsp)
test   $0x20,%bl
jne    1221 <set_clock+0xe1>
xor    %eax,%eax
cmpl   $0x1,0x50(%rsp)
sete   %al
lea    (%rax,%r15,2),%r15d
lea    0xea8(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xfffffffe,%r12d
lea    0xea2(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xfffffffe,%r14d
lea    0xe9c(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x33,%r13d
mov    $0x3d6,%edi
mov    $0x33,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
call   1060 <inb@plt>
mov    %eax,%ebx
and    $0xffffffdf,%eax
shl    $0x5,%ebp
and    $0x20,%ebp
or     %eax,%ebp
mov    $0x3d7,%edi
mov    %ebp,%esi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    $0x30,%esi
call   1050 <outb@plt>
movl   $0x32,0xc(%rsp)
mov    $0x31,%ebp
jmp    134e <set_clock+0x20e>
test   $0x1,%bpl
jne    12ca <set_clock+0x18a>
lea    0xc0(,%r13,4),%esi
mov    %esi,0x10(%rsp)
add    $0xfffffffe,%r12d
lea    0xdeb(%rip),%rbx
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc1(,%r13,4),%ebp
add    $0xfffffffe,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc2(,%r13,4),%esi
mov    %rbx,%rdi
mov    %esi,0xc(%rsp)
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc3(,%r13,4),%r13d
shl    $0x4,%r15d
xor    %ebx,%ebx
cmpl   $0x1,0x50(%rsp)
sete   %bl
or     %r15d,%ebx
lea    0xd8b(%rip),%rdi
mov    %r13d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3d6,%edi
mov    0x10(%rsp),%esi
call   1050 <outb@plt>
mov    %r12d,%r15d
mov    %r14d,%r12d
xor    %r14d,%r14d
jmp    134e <set_clock+0x20e>
add    $0xfffffffe,%r12d
lea    0xd2b(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xfffffffe,%r14d
lea    0xd25(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
shl    $0x4,%r15d
xor    %ebx,%ebx
cmpl   $0x1,0x50(%rsp)
sete   %bl
or     %r15d,%ebx
or     $0x80,%ebx
lea    0xd0c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xce,%r13d
mov    $0x3d6,%edi
mov    $0xce,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
call   1060 <inb@plt>
mov    %eax,%r15d
and    $0x7f,%r15d
movl   $0xcd,0xc(%rsp)
mov    $0xcc,%ebp
mov    $0x3d7,%edi
mov    %r15d,%esi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    %ebp,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
mov    %r12d,%esi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    0xc(%rsp),%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
mov    %r14d,%esi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    %r13d,%esi
call   1050 <outb@plt>
mov    $0x3d7,%edi
mov    %ebx,%esi
call   1050 <outb@plt>
mov    $0x3d6,%edi
mov    0x14(%rsp),%esi
call   1050 <outb@plt>
xor    %edi,%edi
call   1040 <iopl@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"XRCC = 0x%02X\0A\00"
@.str.1 = [15 x i8] c"XRCD = 0x%02X\0A\00"
@.str.2 = [15 x i8] c"XRCE = 0x%02X\0A\00"
@.str.3 = [15 x i8] c"XR%X = 0x%02X\0A\00"
@.str.4 = [15 x i8] c"XR30 = 0x%02X\0A\00"
@.str.5 = [15 x i8] c"XR31 = 0x%02X\0A\00"
@.str.6 = [15 x i8] c"XR32 = 0x%02X\0A\00"
define i32 @set_clock(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%17 = call i32 @iopl(i32 3)
%18 = call i32 @inb(i32 982)
store i32 %18, i32* %16
%19 = load i32, i32* %8
%20 = and i32 %19, 32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %121
22: ; preds = %7
%23 = load i32, i32* %9
%24 = and i32 %23, 1
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %63
26: ; preds = %22
%27 = load i32, i32* %11
%28 = sub i32 %27, 2
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %12
%31 = sub i32 %30, 2
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %13
%34 = mul i32 %33, 16
%35 = load i32, i32* %14
%36 = icmp eq i32 %35, 1
%37 = zext i1 %36 to i32
%38 = add i32 %34, %37
%39 = or i32 128, %38
%40 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = call i32 @outb(i32 982, i32 206)
%42 = call i32 @inb(i32 983)
store i32 %42, i32* %15
%43 = load i32, i32* %15
%44 = and i32 %43, 127
%45 = call i32 @outb(i32 983, i32 %44)
%46 = call i32 @outb(i32 982, i32 204)
%47 = load i32, i32* %11
%48 = sub i32 %47, 2
%49 = call i32 @outb(i32 983, i32 %48)
%50 = call i32 @outb(i32 982, i32 205)
%51 = load i32, i32* %12
%52 = sub i32 %51, 2
%53 = call i32 @outb(i32 983, i32 %52)
%54 = call i32 @outb(i32 982, i32 206)
%55 = load i32, i32* %13
%56 = mul i32 %55, 16
%57 = load i32, i32* %14
%58 = icmp eq i32 %57, 1
%59 = zext i1 %58 to i32
%60 = add i32 %56, %59
%61 = or i32 128, %60
%62 = call i32 @outb(i32 983, i32 %61)
br label %120
63: ; preds = %22
%64 = load i32, i32* %10
%65 = mul i32 4, %64
%66 = add i32 192, %65
%67 = load i32, i32* %11
%68 = sub i32 %67, 2
%69 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %66, i32 %68)
%70 = load i32, i32* %10
%71 = mul i32 4, %70
%72 = add i32 193, %71
%73 = load i32, i32* %12
%74 = sub i32 %73, 2
%75 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %72, i32 %74)
%76 = load i32, i32* %10
%77 = mul i32 4, %76
%78 = add i32 194, %77
%79 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %78, i32 0)
%80 = load i32, i32* %10
%81 = mul i32 4, %80
%82 = add i32 195, %81
%83 = load i32, i32* %13
%84 = mul i32 %83, 16
%85 = load i32, i32* %14
%86 = icmp eq i32 %85, 1
%87 = zext i1 %86 to i32
%88 = add i32 %84, %87
%89 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %82, i32 %88)
%90 = load i32, i32* %10
%91 = mul i32 4, %90
%92 = add i32 192, %91
%93 = call i32 @outb(i32 982, i32 %92)
%94 = load i32, i32* %11
%95 = sub i32 %94, 2
%96 = call i32 @outb(i32 983, i32 %95)
%97 = load i32, i32* %10
%98 = mul i32 4, %97
%99 = add i32 193, %98
%100 = call i32 @outb(i32 982, i32 %99)
%101 = load i32, i32* %12
%102 = sub i32 %101, 2
%103 = call i32 @outb(i32 983, i32 %102)
%104 = load i32, i32* %10
%105 = mul i32 4, %104
%106 = add i32 194, %105
%107 = call i32 @outb(i32 982, i32 %106)
%108 = call i32 @outb(i32 983, i32 0)
%109 = load i32, i32* %10
%110 = mul i32 4, %109
%111 = add i32 195, %110
%112 = call i32 @outb(i32 982, i32 %111)
%113 = load i32, i32* %13
%114 = mul i32 %113, 16
%115 = load i32, i32* %14
%116 = icmp eq i32 %115, 1
%117 = zext i1 %116 to i32
%118 = add i32 %114, %117
%119 = call i32 @outb(i32 983, i32 %118)
br label %120
120: ; preds = %63, %26
br label %168
121: ; preds = %7
%122 = load i32, i32* %13
%123 = mul i32 %122, 2
%124 = load i32, i32* %14
%125 = icmp eq i32 %124, 1
%126 = zext i1 %125 to i32
%127 = add i32 %123, %126
%128 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %127)
%129 = load i32, i32* %11
%130 = sub i32 %129, 2
%131 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %130)
%132 = load i32, i32* %12
%133 = sub i32 %132, 2
%134 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %133)
%135 = call i32 @outb(i32 982, i32 51)
%136 = call i32 @inb(i32 983)
store i32 %136, i32* %15
%137 = load i32, i32* %9
%138 = and i32 %137, 1
%139 = icmp ne i32 %138, 0
br i1 %139, label %140, label %144
140: ; preds = %121
%141 = load i32, i32* %15
%142 = or i32 %141, 32
%143 = call i32 @outb(i32 983, i32 %142)
br label %148
144: ; preds = %121
%145 = load i32, i32* %15
%146 = and i32 %145, -33
%147 = call i32 @outb(i32 983, i32 %146)
br label %148
148: ; preds = %144, %140
%149 = call i32 @outb(i32 982, i32 48)
%150 = load i32, i32* %13
%151 = mul i32 %150, 2
%152 = load i32, i32* %14
%153 = icmp eq i32 %152, 1
%154 = zext i1 %153 to i32
%155 = add i32 %151, %154
%156 = call i32 @outb(i32 983, i32 %155)
%157 = call i32 @outb(i32 982, i32 49)
%158 = load i32, i32* %11
%159 = sub i32 %158, 2
%160 = call i32 @outb(i32 983, i32 %159)
%161 = call i32 @outb(i32 982, i32 50)
%162 = load i32, i32* %12
%163 = sub i32 %162, 2
%164 = call i32 @outb(i32 983, i32 %163)
%165 = call i32 @outb(i32 982, i32 51)
%166 = load i32, i32* %15
%167 = call i32 @outb(i32 983, i32 %166)
br label %168
168: ; preds = %148, %120
%169 = load i32, i32* %16
%170 = call i32 @outb(i32 982, i32 %169)
%171 = call i32 @iopl(i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"XRCC = 0x%02X\0A\00"
@.str.1 = [15 x i8] c"XRCD = 0x%02X\0A\00"
@.str.2 = [15 x i8] c"XRCE = 0x%02X\0A\00"
@.str.3 = [15 x i8] c"XR%X = 0x%02X\0A\00"
@.str.4 = [15 x i8] c"XR30 = 0x%02X\0A\00"
@.str.5 = [15 x i8] c"XR31 = 0x%02X\0A\00"
@.str.6 = [15 x i8] c"XR32 = 0x%02X\0A\00"
define i32 @set_clock(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @iopl(i32 3)
%9 = tail call i32 @inb(i32 982)
%10 = and i32 %0, 32
%11 = icmp eq i32 %10, 0
br i1 %11, label %46, label %12
12: ; preds = %7
%13 = and i32 %1, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %29, label %15
15: ; preds = %12
%16 = add i32 %3, -2
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = add i32 %4, -2
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = shl i32 %5, 4
%21 = icmp eq i32 %6, 1
%22 = zext i1 %21 to i32
%23 = or i32 %20, %22
%24 = or i32 %23, 128
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = tail call i32 @outb(i32 982, i32 206)
%27 = tail call i32 @inb(i32 983)
%28 = and i32 %27, 127
br label %64
29: ; preds = %12
%30 = shl i32 %2, 2
%31 = add i32 %30, 192
%32 = add i32 %3, -2
%33 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %32)
%34 = add i32 %30, 193
%35 = add i32 %4, -2
%36 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32 %35)
%37 = add i32 %30, 194
%38 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %37, i32 0)
%39 = add i32 %30, 195
%40 = shl i32 %5, 4
%41 = icmp eq i32 %6, 1
%42 = zext i1 %41 to i32
%43 = or i32 %40, %42
%44 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %43)
%45 = tail call i32 @outb(i32 982, i32 %31)
br label %64
46: ; preds = %7
%47 = shl i32 %5, 1
%48 = icmp eq i32 %6, 1
%49 = zext i1 %48 to i32
%50 = or i32 %47, %49
%51 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = add i32 %3, -2
%53 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = add i32 %4, -2
%55 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%56 = tail call i32 @outb(i32 982, i32 51)
%57 = tail call i32 @inb(i32 983)
%58 = and i32 %57, -33
%59 = shl i32 %1, 5
%60 = and i32 %59, 32
%61 = or i32 %58, %60
%62 = tail call i32 @outb(i32 983, i32 %61)
%63 = tail call i32 @outb(i32 982, i32 48)
br label %64
64: ; preds = %15, %29, %46
%65 = phi i32 [ %28, %15 ], [ %32, %29 ], [ %50, %46 ]
%66 = phi i32 [ 204, %15 ], [ %34, %29 ], [ 49, %46 ]
%67 = phi i32 [ %16, %15 ], [ %35, %29 ], [ %52, %46 ]
%68 = phi i32 [ 205, %15 ], [ %37, %29 ], [ 50, %46 ]
%69 = phi i32 [ %18, %15 ], [ 0, %29 ], [ %54, %46 ]
%70 = phi i32 [ 206, %15 ], [ %39, %29 ], [ 51, %46 ]
%71 = phi i32 [ %24, %15 ], [ %43, %29 ], [ %57, %46 ]
%72 = tail call i32 @outb(i32 983, i32 %65)
%73 = tail call i32 @outb(i32 982, i32 %66)
%74 = tail call i32 @outb(i32 983, i32 %67)
%75 = tail call i32 @outb(i32 982, i32 %68)
%76 = tail call i32 @outb(i32 983, i32 %69)
%77 = tail call i32 @outb(i32 982, i32 %70)
%78 = tail call i32 @outb(i32 983, i32 %71)
%79 = tail call i32 @outb(i32 982, i32 %9)
%80 = tail call i32 @iopl(i32 0)
ret i32 0
}