#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 */
typedef int /*<<< orphan*/ str;
typedef int /*<<< orphan*/ s3;
typedef int /*<<< orphan*/ s2;
typedef int /*<<< orphan*/ s1;

/* Variables and functions */
int /*<<< orphan*/ get_printer_config_string(int, char *, int);
int /*<<< orphan*/ get_printer_display_string(int, char *, int);
int get_reg_info(char *, char *, int, char *, int, char *, int);
int /*<<< orphan*/ get_serial_port_config_string(int, char *, int);
int /*<<< orphan*/ get_serial_port_display_string(int, char *, int);
int /*<<< orphan*/ get_tapi_config_string(int, char *, int);
int /*<<< orphan*/ get_tapi_display_string(int, char *, int);
int init_printer_list();
int init_serial_port_list();
int init_tapi_list();
int /*<<< orphan*/ printf(char *, ...);
int register_k95(char *, char *, char *, char *, int);
scalar_t__ validate_serial_no(char *);
int main(void) {
  char str[256], s1[64], s2[64], s3[64];
  int n;
  printf("Testing validate serial number ....\n");
  if (validate_serial_no("K95-00010038454-1.1"))
    printf("valid serial number test passed\n");
  else
    printf("valid serial number test failed\n");
  if (!validate_serial_no("K95-00010038450-1.1"))
    printf("invalid serial number test passed\n");
  else
    printf("invalid serial number test failed\n");
  printf("\nTesting Printers\n");
  n = init_printer_list();
  printf("%d printers\n");
  while (n-- > 0) {
    get_printer_display_string(n, str, sizeof(str));
    printf("%s\n", str);
    get_printer_config_string(n, str, sizeof(str));
    printf("%s\n", str);
  }
  printf("\nTesting Serial Devices\n");
  n = init_serial_port_list();
  printf("%d serials\n");
  while (n-- > 0) {
    get_serial_port_display_string(n, str, sizeof(str));
    printf("%s\n", str);
    get_serial_port_config_string(n, str, sizeof(str));
    printf("%s\n", str);
  }
  printf("\nTesting TAPI devices\n");
  n = init_tapi_list();
  printf("%d tapi devices\n");
  while (n-- > 0) {
    get_tapi_display_string(n, str, sizeof(str));
    printf("%s\n", str);
    get_tapi_config_string(n, str, sizeof(str));
    printf("%s\n", str);
  }
  n = register_k95("d:/kermit", "K95-00010038454-1.1", "Deborah Lerman",
                   "Girlfriend", 5);
  printf("register test = %d\n", n);
  n = get_reg_info("d:/kermit", s1, sizeof(s1), s2, sizeof(s2), s3, sizeof(s3));
  printf("get reg info = %d\n", n);
  if (!n) {
    printf("\n%s\n%s\n%s\n", s1, s2, s3);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe2e(%rip),%rdi
call   10f0 <validate_serial_no@plt>
cmp    $0x0,%rax
je     1219 <main+0x49>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1227 <main+0x57>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe0b(%rip),%rdi
call   10f0 <validate_serial_no@plt>
cmp    $0x0,%rax
jne    1250 <main+0x80>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    125e <main+0x8e>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <init_printer_list@plt>
mov    %eax,-0x1d4(%rbp)
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1d4(%rbp)
cmp    $0x0,%eax
jle    12fe <main+0x12e>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1080 <get_printer_display_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1030 <get_printer_config_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1287 <main+0xb7>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <init_serial_port_list@plt>
mov    %eax,-0x1d4(%rbp)
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1d4(%rbp)
cmp    $0x0,%eax
jle    139e <main+0x1ce>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   10e0 <get_serial_port_display_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   10c0 <get_serial_port_config_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1327 <main+0x157>
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <init_tapi_list@plt>
mov    %eax,-0x1d4(%rbp)
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1d4(%rbp)
cmp    $0x0,%eax
jle    143e <main+0x26e>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   10a0 <get_tapi_display_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1d4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <get_tapi_config_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13c7 <main+0x1f7>
lea    0xcbb(%rip),%rdi
lea    0xbd9(%rip),%rsi
lea    0xcb7(%rip),%rdx
lea    0xcbf(%rip),%rcx
mov    $0x5,%r8d
call   10d0 <register_k95@plt>
mov    %eax,-0x1d4(%rbp)
mov    -0x1d4(%rbp),%esi
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x150(%rbp),%rsi
lea    -0x190(%rbp),%rcx
lea    -0x1d0(%rbp),%r9
lea    0xc65(%rip),%rdi
mov    $0x40,%r8d
mov    %r8d,%edx
movl   $0x40,(%rsp)
call   1050 <get_reg_info@plt>
mov    %eax,-0x1d4(%rbp)
mov    -0x1d4(%rbp),%esi
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x1d4(%rbp)
jne    14fa <main+0x32a>
lea    -0x150(%rbp),%rsi
lea    -0x190(%rbp),%rdx
lea    -0x1d0(%rbp),%rcx
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1d0,%rsp
lea    0xeb6(%rip),%rdi
call   1050 <puts@plt>
lea    0xe02(%rip),%rdi
call   1100 <validate_serial_no@plt>
test   %rax,%rax
lea    0xf23(%rip),%rax
lea    0xeba(%rip),%rdi
cmove  %rax,%rdi
call   1050 <puts@plt>
lea    0xdf0(%rip),%rdi
call   1100 <validate_serial_no@plt>
test   %rax,%rax
lea    0xe99(%rip),%rax
lea    0xef4(%rip),%rdi
cmove  %rax,%rdi
call   1050 <puts@plt>
lea    0xea4(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10c0 <init_printer_list@plt>
mov    %eax,%ebx
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    12b9 <main+0xd9>
add    $0x1,%ebx
lea    0xd0(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1090 <get_printer_display_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1030 <get_printer_config_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1280 <main+0xa0>
lea    0xe40(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1080 <init_serial_port_list@plt>
mov    %eax,%ebx
lea    0xd60(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    1329 <main+0x149>
add    $0x1,%ebx
lea    0xd0(%rsp),%r14
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   10f0 <get_serial_port_display_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   10d0 <get_serial_port_config_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     12f0 <main+0x110>
lea    0xde8(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10a0 <init_tapi_list@plt>
mov    %eax,%ebx
lea    0xcfc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    1399 <main+0x1b9>
add    $0x1,%ebx
lea    0xd0(%rsp),%r14
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   10b0 <get_tapi_display_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1040 <get_tapi_config_string@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1360 <main+0x180>
lea    0xcb2(%rip),%rbx
lea    0xc59(%rip),%rsi
lea    0xcae(%rip),%rdx
lea    0xcb6(%rip),%rcx
mov    %rbx,%rdi
mov    $0x5,%r8d
call   10e0 <register_k95@plt>
lea    0xcac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x40,(%rsp)
lea    0x90(%rsp),%rsi
lea    0x50(%rsp),%rcx
lea    0x10(%rsp),%r9
mov    %rbx,%rdi
mov    $0x40,%edx
mov    $0x40,%r8d
call   1060 <get_reg_info@plt>
mov    %eax,%ebx
lea    0xc82(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jne    1435 <main+0x255>
lea    0xc81(%rip),%rdi
lea    0x90(%rsp),%rsi
lea    0x50(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Testing validate serial number ....\0A\00"
@.str.1 = [20 x i8] c"K95-00010038454-1.1\00"
@.str.2 = [33 x i8] c"valid serial number test passed\0A\00"
@.str.3 = [33 x i8] c"valid serial number test failed\0A\00"
@.str.4 = [20 x i8] c"K95-00010038450-1.1\00"
@.str.5 = [35 x i8] c"invalid serial number test passed\0A\00"
@.str.6 = [35 x i8] c"invalid serial number test failed\0A\00"
@.str.7 = [19 x i8] c"\0ATesting Printers\0A\00"
@.str.8 = [13 x i8] c"%d printers\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
@.str.10 = [25 x i8] c"\0ATesting Serial Devices\0A\00"
@.str.11 = [12 x i8] c"%d serials\0A\00"
@.str.12 = [23 x i8] c"\0ATesting TAPI devices\0A\00"
@.str.13 = [17 x i8] c"%d tapi devices\0A\00"
@.str.14 = [10 x i8] c"d:/kermit\00"
@.str.15 = [15 x i8] c"Deborah Lerman\00"
@.str.16 = [11 x i8] c"Girlfriend\00"
@.str.17 = [20 x i8] c"register test = %d\0A\00"
@.str.18 = [19 x i8] c"get reg info = %d\0A\00"
@.str.19 = [11 x i8] c"\0A%s\0A%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [64 x i8]
%4 = alloca [64 x i8]
%5 = alloca [64 x i8]
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i64 @validate_serial_no(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = call i64 @validate_serial_no(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (...) @init_printer_list()
store i32 %23, i32* %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %25
25: ; preds = %29, %21
%26 = load i32, i32* %6
%27 = add nsw i32 %26, -1
store i32 %27, i32* %6
%28 = icmp sgt i32 %26, 0
br i1 %28, label %29, label %40
29: ; preds = %25
%30 = load i32, i32* %6
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%32 = call i32 @get_printer_display_string(i32 %30, i8* %31, i32 256)
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %33)
%35 = load i32, i32* %6
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%37 = call i32 @get_printer_config_string(i32 %35, i8* %36, i32 256)
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %38)
br label %25
40: ; preds = %25
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%42 = call i32 (...) @init_serial_port_list()
store i32 %42, i32* %6
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %44
44: ; preds = %48, %40
%45 = load i32, i32* %6
%46 = add nsw i32 %45, -1
store i32 %46, i32* %6
%47 = icmp sgt i32 %45, 0
br i1 %47, label %48, label %59
48: ; preds = %44
%49 = load i32, i32* %6
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%51 = call i32 @get_serial_port_display_string(i32 %49, i8* %50, i32 256)
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %52)
%54 = load i32, i32* %6
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%56 = call i32 @get_serial_port_config_string(i32 %54, i8* %55, i32 256)
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %57)
br label %44
59: ; preds = %44
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%61 = call i32 (...) @init_tapi_list()
store i32 %61, i32* %6
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %63
63: ; preds = %67, %59
%64 = load i32, i32* %6
%65 = add nsw i32 %64, -1
store i32 %65, i32* %6
%66 = icmp sgt i32 %64, 0
br i1 %66, label %67, label %78
67: ; preds = %63
%68 = load i32, i32* %6
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%70 = call i32 @get_tapi_display_string(i32 %68, i8* %69, i32 256)
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %71)
%73 = load i32, i32* %6
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%75 = call i32 @get_tapi_config_string(i32 %73, i8* %74, i32 256)
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %76)
br label %63
78: ; preds = %63
%79 = call i32 @register_k95(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 5)
store i32 %79, i32* %6
%80 = load i32, i32* %6
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%83 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%84 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%85 = call i32 @get_reg_info(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* %82, i32 64, i8* %83, i32 64, i8* %84, i32 64)
store i32 %85, i32* %6
%86 = load i32, i32* %6
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0), i32 %86)
%88 = load i32, i32* %6
%89 = icmp ne i32 %88, 0
br i1 %89, label %95, label %90
90: ; preds = %78
%91 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%92 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%93 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* %91, i8* %92, i8* %93)
br label %95
95: ; preds = %90, %78
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"K95-00010038454-1.1\00"
@.str.4 = [20 x i8] c"K95-00010038450-1.1\00"
@.str.8 = [13 x i8] c"%d printers\0A\00"
@.str.11 = [12 x i8] c"%d serials\0A\00"
@.str.13 = [17 x i8] c"%d tapi devices\0A\00"
@.str.14 = [10 x i8] c"d:/kermit\00"
@.str.15 = [15 x i8] c"Deborah Lerman\00"
@.str.16 = [11 x i8] c"Girlfriend\00"
@.str.17 = [20 x i8] c"register test = %d\0A\00"
@.str.18 = [19 x i8] c"get reg info = %d\0A\00"
@.str.19 = [11 x i8] c"\0A%s\0A%s\0A%s\0A\00"
@str = [36 x i8] c"Testing validate serial number ....\00"
@str.20 = [32 x i8] c"valid serial number test failed\00"
@str.21 = [34 x i8] c"invalid serial number test passed\00"
@str.22 = [18 x i8] c"\0ATesting Printers\00"
@str.23 = [24 x i8] c"\0ATesting Serial Devices\00"
@str.24 = [22 x i8] c"\0ATesting TAPI devices\00"
@str.25 = [34 x i8] c"invalid serial number test failed\00"
@str.26 = [32 x i8] c"valid serial number test passed\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [64 x i8]
%3 = alloca [64 x i8]
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%10 = tail call i64 @validate_serial_no(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.20, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.26, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = tail call i64 @validate_serial_no(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.21, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.25, i64 0, i64 0)
%17 = tail call i32 @puts(i8* dereferenceable(1) %16)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.22, i64 0, i64 0))
%19 = tail call i32 (...) @init_printer_list()
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%21 = icmp sgt i32 %19, 0
br i1 %21, label %22, label %30
22: ; preds = %0, %22
%23 = phi i32 [ %24, %22 ], [ %19, %0 ]
%24 = add nsw i32 %23, -1
%25 = call i32 @get_printer_display_string(i32 %24, i8* %5, i32 256)
%26 = call i32 @puts(i8* %5)
%27 = call i32 @get_printer_config_string(i32 %24, i8* %5, i32 256)
%28 = call i32 @puts(i8* %5)
%29 = icmp ugt i32 %23, 1
br i1 %29, label %22, label %30
30: ; preds = %22, %0
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.23, i64 0, i64 0))
%32 = call i32 (...) @init_serial_port_list()
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%34 = icmp sgt i32 %32, 0
br i1 %34, label %35, label %43
35: ; preds = %30, %35
%36 = phi i32 [ %37, %35 ], [ %32, %30 ]
%37 = add nsw i32 %36, -1
%38 = call i32 @get_serial_port_display_string(i32 %37, i8* %5, i32 256)
%39 = call i32 @puts(i8* %5)
%40 = call i32 @get_serial_port_config_string(i32 %37, i8* %5, i32 256)
%41 = call i32 @puts(i8* %5)
%42 = icmp ugt i32 %36, 1
br i1 %42, label %35, label %43
43: ; preds = %35, %30
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.24, i64 0, i64 0))
%45 = call i32 (...) @init_tapi_list()
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%47 = icmp sgt i32 %45, 0
br i1 %47, label %48, label %56
48: ; preds = %43, %48
%49 = phi i32 [ %50, %48 ], [ %45, %43 ]
%50 = add nsw i32 %49, -1
%51 = call i32 @get_tapi_display_string(i32 %50, i8* %5, i32 256)
%52 = call i32 @puts(i8* %5)
%53 = call i32 @get_tapi_config_string(i32 %50, i8* %5, i32 256)
%54 = call i32 @puts(i8* %5)
%55 = icmp ugt i32 %49, 1
br i1 %55, label %48, label %56
56: ; preds = %48, %43
%57 = call i32 @register_k95(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 5)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i32 %57)
%59 = call i32 @get_reg_info(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* %6, i32 64, i8* %7, i32 64, i8* %8, i32 64)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0), i32 %59)
%61 = icmp eq i32 %59, 0
br i1 %61, label %62, label %64
62: ; preds = %56
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
br label %64
64: ; preds = %62, %56
ret i32 0
}