#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 trans {
  int dummy;
};
struct stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_time3();
int /*<<< orphan*/ g_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ g_writeln(char *, ...);
int scard_process_begin_transaction(struct trans *, struct stream *);
int scard_process_cancel(struct trans *, struct stream *);
int scard_process_connect(struct trans *, struct stream *);
int scard_process_control(struct trans *, struct stream *);
int scard_process_disconnect(struct trans *, struct stream *);
int scard_process_end_transaction(struct trans *, struct stream *);
int scard_process_establish_context(struct trans *, struct stream *);
int scard_process_get_status_change(struct trans *, struct stream *);
int scard_process_list_readers(struct trans *, struct stream *);
int scard_process_release_context(struct trans *, struct stream *);
int scard_process_status(struct trans *, struct stream *);
int scard_process_transmit(struct trans *, struct stream *);
int scard_process_msg(struct trans *con, struct stream *in_s, int command) {
  int rv;
  do {
    if (10 < 1) {
      g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
      g_writeln("scard_process_msg: command 0x%4.4x", command);
    }
  } while (0);
  rv = 0;
  switch (command) {
  case 0x01:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_ESTABLISH_CONTEXT");
      }
    } while (0);
    rv = scard_process_establish_context(con, in_s);
    break;
  case 0x02:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_RELEASE_CONTEXT");
      }
    } while (0);
    rv = scard_process_release_context(con, in_s);
    break;
  case 0x03:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_LIST_READERS");
      }
    } while (0);
    rv = scard_process_list_readers(con, in_s);
    break;
  case 0x04:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_CONNECT");
      }
    } while (0);
    rv = scard_process_connect(con, in_s);
    break;
  case 0x05:
    do {
      if (0 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_RECONNECT");
      }
    } while (0);
    break;
  case 0x06:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_DISCONNECT");
      }
    } while (0);
    rv = scard_process_disconnect(con, in_s);
    break;
  case 0x07:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_BEGIN_TRANSACTION");
      }
    } while (0);
    rv = scard_process_begin_transaction(con, in_s);
    break;
  case 0x08:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_END_TRANSACTION");
      }
    } while (0);
    rv = scard_process_end_transaction(con, in_s);
    break;
  case 0x09:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_TRANSMIT");
      }
    } while (0);
    rv = scard_process_transmit(con, in_s);
    break;
  case 0x0A:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_CONTROL");
      }
    } while (0);
    rv = scard_process_control(con, in_s);
    break;
  case 0x0B:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_STATUS");
      }
    } while (0);
    rv = scard_process_status(con, in_s);
    break;
  case 0x0C:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_GET_STATUS_CHANGE");
      }
    } while (0);
    rv = scard_process_get_status_change(con, in_s);
    break;
  case 0x0D:
    do {
      if (10 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_CANCEL");
      }
    } while (0);
    rv = scard_process_cancel(con, in_s);
    break;
  case 0x0E:
    do {
      if (0 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_CANCEL_TRANSACTION");
      }
    } while (0);
    break;
  case 0x0F:
    do {
      if (0 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_GET_ATTRIB");
      }
    } while (0);
    break;
  case 0x10:
    do {
      if (0 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: SCARD_SET_ATTRIB");
      }
    } while (0);
    break;
  default:
    do {
      if (0 < 1) {
        g_write("chansrv:smartcard_pcsc [%10.10u]: ", g_time3());
        g_writeln("scard_process_msg: unknown mtype 0x%4.4x", command);
      }
    } while (0);
    rv = 1;
    break;
  }
  return rv;
}


x86 assembly (clang, -O0):
<scard_process_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
jmp    1208 <scard_process_msg+0x18>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xf,%eax
ja     1460 <scard_process_msg+0x270>
mov    -0x20(%rbp),%rax
lea    0xdd1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    123d <scard_process_msg+0x4d>
jmp    1242 <scard_process_msg+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <scard_process_establish_context@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    125c <scard_process_msg+0x6c>
jmp    1261 <scard_process_msg+0x71>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1110 <scard_process_release_context@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    127b <scard_process_msg+0x8b>
jmp    1280 <scard_process_msg+0x90>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <scard_process_list_readers@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    129a <scard_process_msg+0xaa>
jmp    129f <scard_process_msg+0xaf>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <scard_process_connect@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    12b9 <scard_process_msg+0xc9>
mov    $0x0,%al
call   1040 <g_time3@plt>
mov    %eax,%esi
lea    0xd77(%rip),%rdi
call   10c0 <g_write@plt>
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1060 <g_writeln@plt>
jmp    1492 <scard_process_msg+0x2a2>
jmp    12e6 <scard_process_msg+0xf6>
jmp    12eb <scard_process_msg+0xfb>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <scard_process_disconnect@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    1305 <scard_process_msg+0x115>
jmp    130a <scard_process_msg+0x11a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1100 <scard_process_begin_transaction@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    1324 <scard_process_msg+0x134>
jmp    1329 <scard_process_msg+0x139>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <scard_process_end_transaction@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    1343 <scard_process_msg+0x153>
jmp    1348 <scard_process_msg+0x158>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10e0 <scard_process_transmit@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    1362 <scard_process_msg+0x172>
jmp    1367 <scard_process_msg+0x177>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10d0 <scard_process_control@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    1381 <scard_process_msg+0x191>
jmp    1386 <scard_process_msg+0x196>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <scard_process_status@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    13a0 <scard_process_msg+0x1b0>
jmp    13a5 <scard_process_msg+0x1b5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <scard_process_get_status_change@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    13bf <scard_process_msg+0x1cf>
jmp    13c4 <scard_process_msg+0x1d4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10f0 <scard_process_cancel@plt>
mov    %eax,-0x18(%rbp)
jmp    1492 <scard_process_msg+0x2a2>
jmp    13de <scard_process_msg+0x1ee>
mov    $0x0,%al
call   1040 <g_time3@plt>
mov    %eax,%esi
lea    0xc52(%rip),%rdi
call   10c0 <g_write@plt>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1060 <g_writeln@plt>
jmp    1492 <scard_process_msg+0x2a2>
jmp    140b <scard_process_msg+0x21b>
mov    $0x0,%al
call   1040 <g_time3@plt>
mov    %eax,%esi
lea    0xc25(%rip),%rdi
call   10c0 <g_write@plt>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1060 <g_writeln@plt>
jmp    1492 <scard_process_msg+0x2a2>
jmp    1438 <scard_process_msg+0x248>
mov    $0x0,%al
call   1040 <g_time3@plt>
mov    %eax,%esi
lea    0xbf8(%rip),%rdi
call   10c0 <g_write@plt>
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1060 <g_writeln@plt>
jmp    1492 <scard_process_msg+0x2a2>
jmp    1465 <scard_process_msg+0x275>
mov    $0x0,%al
call   1040 <g_time3@plt>
mov    %eax,%esi
lea    0xbcb(%rip),%rdi
call   10c0 <g_write@plt>
mov    -0x14(%rbp),%esi
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1060 <g_writeln@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scard_process_msg>:
push   %rbx
mov    %edx,%ebx
lea    -0x1(%rbx),%eax
cmp    $0xf,%eax
ja     1211 <scard_process_msg+0x21>
lea    0xdfe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
pop    %rbx
jmp    10a0 <scard_process_establish_context@plt>
xor    %eax,%eax
call   1040 <g_time3@plt>
lea    0xe21(%rip),%rdi
mov    %eax,%esi
call   10c0 <g_write@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <g_writeln@plt>
mov    $0x1,%ebx
jmp    130a <scard_process_msg+0x11a>
pop    %rbx
jmp    1110 <scard_process_release_context@plt>
pop    %rbx
jmp    1030 <scard_process_list_readers@plt>
pop    %rbx
jmp    1090 <scard_process_connect@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <g_time3@plt>
lea    0xdde(%rip),%rdi
mov    %eax,%esi
call   10c0 <g_write@plt>
lea    0xdf3(%rip),%rdi
jmp    1303 <scard_process_msg+0x113>
pop    %rbx
jmp    1080 <scard_process_disconnect@plt>
pop    %rbx
jmp    1100 <scard_process_begin_transaction@plt>
pop    %rbx
jmp    1050 <scard_process_end_transaction@plt>
pop    %rbx
jmp    10e0 <scard_process_transmit@plt>
pop    %rbx
jmp    10d0 <scard_process_control@plt>
pop    %rbx
jmp    10b0 <scard_process_status@plt>
pop    %rbx
jmp    1070 <scard_process_get_status_change@plt>
pop    %rbx
jmp    10f0 <scard_process_cancel@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <g_time3@plt>
lea    0xd8b(%rip),%rdi
mov    %eax,%esi
call   10c0 <g_write@plt>
lea    0xdc3(%rip),%rdi
jmp    1303 <scard_process_msg+0x113>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <g_time3@plt>
lea    0xd6b(%rip),%rdi
mov    %eax,%esi
call   10c0 <g_write@plt>
lea    0xdcf(%rip),%rdi
jmp    1303 <scard_process_msg+0x113>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <g_time3@plt>
lea    0xd4b(%rip),%rdi
mov    %eax,%esi
call   10c0 <g_write@plt>
lea    0xdd3(%rip),%rdi
xor    %eax,%eax
call   1060 <g_writeln@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.trans = type { i32 }
%struct.stream = type { i32 }
@.str = [35 x i8] c"chansrv:smartcard_pcsc [%10.10u]: \00"
@.str.1 = [35 x i8] c"scard_process_msg: SCARD_RECONNECT\00"
@.str.2 = [44 x i8] c"scard_process_msg: SCARD_CANCEL_TRANSACTION\00"
@.str.3 = [36 x i8] c"scard_process_msg: SCARD_GET_ATTRIB\00"
@.str.4 = [36 x i8] c"scard_process_msg: SCARD_SET_ATTRIB\00"
@.str.5 = [41 x i8] c"scard_process_msg: unknown mtype 0x%4.4x\00"
define i32 @scard_process_msg(%struct.trans* %0, %struct.stream* %1, i32 %2) {
%4 = alloca %struct.trans*
%5 = alloca %struct.stream*
%6 = alloca i32
%7 = alloca i32
store %struct.trans* %0, %struct.trans** %4
store %struct.stream* %1, %struct.stream** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %3
br label %9
9: ; preds = %8
store i32 0, i32* %7
%10 = load i32, i32* %6
switch i32 %10, label %107 [
i32 1, label %11
i32 2, label %17
i32 3, label %23
i32 4, label %29
i32 5, label %35
i32 6, label %41
i32 7, label %47
i32 8, label %53
i32 9, label %59
i32 10, label %65
i32 11, label %71
i32 12, label %77
i32 13, label %83
i32 14, label %89
i32 15, label %95
i32 16, label %101
]
11: ; preds = %9
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
%14 = load %struct.trans*, %struct.trans** %4
%15 = load %struct.stream*, %struct.stream** %5
%16 = call i32 @scard_process_establish_context(%struct.trans* %14, %struct.stream* %15)
store i32 %16, i32* %7
br label %114
17: ; preds = %9
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
%20 = load %struct.trans*, %struct.trans** %4
%21 = load %struct.stream*, %struct.stream** %5
%22 = call i32 @scard_process_release_context(%struct.trans* %20, %struct.stream* %21)
store i32 %22, i32* %7
br label %114
23: ; preds = %9
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
%26 = load %struct.trans*, %struct.trans** %4
%27 = load %struct.stream*, %struct.stream** %5
%28 = call i32 @scard_process_list_readers(%struct.trans* %26, %struct.stream* %27)
store i32 %28, i32* %7
br label %114
29: ; preds = %9
br label %30
30: ; preds = %29
br label %31
31: ; preds = %30
%32 = load %struct.trans*, %struct.trans** %4
%33 = load %struct.stream*, %struct.stream** %5
%34 = call i32 @scard_process_connect(%struct.trans* %32, %struct.stream* %33)
store i32 %34, i32* %7
br label %114
35: ; preds = %9
br label %36
36: ; preds = %35
%37 = call i32 (...) @g_time3()
%38 = call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %36
br label %114
41: ; preds = %9
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
%44 = load %struct.trans*, %struct.trans** %4
%45 = load %struct.stream*, %struct.stream** %5
%46 = call i32 @scard_process_disconnect(%struct.trans* %44, %struct.stream* %45)
store i32 %46, i32* %7
br label %114
47: ; preds = %9
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
%50 = load %struct.trans*, %struct.trans** %4
%51 = load %struct.stream*, %struct.stream** %5
%52 = call i32 @scard_process_begin_transaction(%struct.trans* %50, %struct.stream* %51)
store i32 %52, i32* %7
br label %114
53: ; preds = %9
br label %54
54: ; preds = %53
br label %55
55: ; preds = %54
%56 = load %struct.trans*, %struct.trans** %4
%57 = load %struct.stream*, %struct.stream** %5
%58 = call i32 @scard_process_end_transaction(%struct.trans* %56, %struct.stream* %57)
store i32 %58, i32* %7
br label %114
59: ; preds = %9
br label %60
60: ; preds = %59
br label %61
61: ; preds = %60
%62 = load %struct.trans*, %struct.trans** %4
%63 = load %struct.stream*, %struct.stream** %5
%64 = call i32 @scard_process_transmit(%struct.trans* %62, %struct.stream* %63)
store i32 %64, i32* %7
br label %114
65: ; preds = %9
br label %66
66: ; preds = %65
br label %67
67: ; preds = %66
%68 = load %struct.trans*, %struct.trans** %4
%69 = load %struct.stream*, %struct.stream** %5
%70 = call i32 @scard_process_control(%struct.trans* %68, %struct.stream* %69)
store i32 %70, i32* %7
br label %114
71: ; preds = %9
br label %72
72: ; preds = %71
br label %73
73: ; preds = %72
%74 = load %struct.trans*, %struct.trans** %4
%75 = load %struct.stream*, %struct.stream** %5
%76 = call i32 @scard_process_status(%struct.trans* %74, %struct.stream* %75)
store i32 %76, i32* %7
br label %114
77: ; preds = %9
br label %78
78: ; preds = %77
br label %79
79: ; preds = %78
%80 = load %struct.trans*, %struct.trans** %4
%81 = load %struct.stream*, %struct.stream** %5
%82 = call i32 @scard_process_get_status_change(%struct.trans* %80, %struct.stream* %81)
store i32 %82, i32* %7
br label %114
83: ; preds = %9
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84
%86 = load %struct.trans*, %struct.trans** %4
%87 = load %struct.stream*, %struct.stream** %5
%88 = call i32 @scard_process_cancel(%struct.trans* %86, %struct.stream* %87)
store i32 %88, i32* %7
br label %114
89: ; preds = %9
br label %90
90: ; preds = %89
%91 = call i32 (...) @g_time3()
%92 = call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %91)
%93 = call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
br label %94
94: ; preds = %90
br label %114
95: ; preds = %9
br label %96
96: ; preds = %95
%97 = call i32 (...) @g_time3()
%98 = call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %97)
%99 = call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %100
100: ; preds = %96
br label %114
101: ; preds = %9
br label %102
102: ; preds = %101
%103 = call i32 (...) @g_time3()
%104 = call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %103)
%105 = call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %106
106: ; preds = %102
br label %114
107: ; preds = %9
br label %108
108: ; preds = %107
%109 = call i32 (...) @g_time3()
%110 = call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %109)
%111 = load i32, i32* %6
%112 = call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %111)
br label %113
113: ; preds = %108
store i32 1, i32* %7
br label %114
114: ; preds = %113, %106, %100, %94, %85, %79, %73, %67, %61, %55, %49, %43, %40, %31, %25, %19, %13
%115 = load i32, i32* %7
ret i32 %115
}

LLVM IR (-O2):
%struct.trans = type { i32 }
%struct.stream = type { i32 }
@.str = [35 x i8] c"chansrv:smartcard_pcsc [%10.10u]: \00"
@.str.1 = [35 x i8] c"scard_process_msg: SCARD_RECONNECT\00"
@.str.2 = [44 x i8] c"scard_process_msg: SCARD_CANCEL_TRANSACTION\00"
@.str.3 = [36 x i8] c"scard_process_msg: SCARD_GET_ATTRIB\00"
@.str.4 = [36 x i8] c"scard_process_msg: SCARD_SET_ATTRIB\00"
@.str.5 = [41 x i8] c"scard_process_msg: unknown mtype 0x%4.4x\00"
define i32 @scard_process_msg(%struct.trans* %0, %struct.stream* %1, i32 %2) {
switch i32 %2, label %44 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %16
i32 7, label %18
i32 8, label %20
i32 9, label %22
i32 10, label %24
i32 11, label %26
i32 12, label %28
i32 13, label %30
i32 14, label %32
i32 15, label %36
i32 16, label %40
]
4: ; preds = %3
%5 = tail call i32 @scard_process_establish_context(%struct.trans* %0, %struct.stream* %1)
br label %48
6: ; preds = %3
%7 = tail call i32 @scard_process_release_context(%struct.trans* %0, %struct.stream* %1)
br label %48
8: ; preds = %3
%9 = tail call i32 @scard_process_list_readers(%struct.trans* %0, %struct.stream* %1)
br label %48
10: ; preds = %3
%11 = tail call i32 @scard_process_connect(%struct.trans* %0, %struct.stream* %1)
br label %48
12: ; preds = %3
%13 = tail call i32 (...) @g_time3()
%14 = tail call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = tail call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %48
16: ; preds = %3
%17 = tail call i32 @scard_process_disconnect(%struct.trans* %0, %struct.stream* %1)
br label %48
18: ; preds = %3
%19 = tail call i32 @scard_process_begin_transaction(%struct.trans* %0, %struct.stream* %1)
br label %48
20: ; preds = %3
%21 = tail call i32 @scard_process_end_transaction(%struct.trans* %0, %struct.stream* %1)
br label %48
22: ; preds = %3
%23 = tail call i32 @scard_process_transmit(%struct.trans* %0, %struct.stream* %1)
br label %48
24: ; preds = %3
%25 = tail call i32 @scard_process_control(%struct.trans* %0, %struct.stream* %1)
br label %48
26: ; preds = %3
%27 = tail call i32 @scard_process_status(%struct.trans* %0, %struct.stream* %1)
br label %48
28: ; preds = %3
%29 = tail call i32 @scard_process_get_status_change(%struct.trans* %0, %struct.stream* %1)
br label %48
30: ; preds = %3
%31 = tail call i32 @scard_process_cancel(%struct.trans* %0, %struct.stream* %1)
br label %48
32: ; preds = %3
%33 = tail call i32 (...) @g_time3()
%34 = tail call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = tail call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
br label %48
36: ; preds = %3
%37 = tail call i32 (...) @g_time3()
%38 = tail call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = tail call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %48
40: ; preds = %3
%41 = tail call i32 (...) @g_time3()
%42 = tail call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = tail call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %48
44: ; preds = %3
%45 = tail call i32 (...) @g_time3()
%46 = tail call i32 @g_write(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = tail call i32 (i8*, ...) @g_writeln(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %2)
br label %48
48: ; preds = %44, %40, %36, %32, %30, %28, %26, %24, %22, %20, %18, %16, %12, %10, %8, %6, %4
%49 = phi i32 [ 1, %44 ], [ 0, %40 ], [ 0, %36 ], [ 0, %32 ], [ %31, %30 ], [ %29, %28 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ 0, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ]
ret i32 %49
}