void readsig(a, b, sig) int *a, *b;
char **sig;
{
  int t;
  char c;
  if ((*(*sig + 1) == '|') && ((**sig == 'C') || (**sig == 'c'))) {
    *a = 2;
    *b = 2;
    return;
  }
  if ((**sig == 'C') || (**sig == 'c')) {
    *a = 4;
    *b = 4;
    return;
  };
  *a = readnump(sig);
  while ((int)**sig == '+') {
    *sig = *sig + 1;
    c = readnump(sig);
    *a = *a + c;
  }
  if ((int)**sig != '/') {
    event_error("Missing / ");
  } else {
    *sig = *sig + 1;
  };
  *b = readnump(sig);
  if ((*a == 0) || (*b == 0)) {
    event_error("Expecting fraction in form A/B");
  } else {
    t = *b;
    while (t > 1) {
      if (t % 2 != 0) {
        event_error("divisor must be a power of 2");
        t = 1;
        *b = 0;
      } else {
        t = t / 2;
      };
    };
  };
}


x86 assembly (clang, -O0):
<readsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x7c,%eax
jne    1187 <readsig+0x67>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
je     116e <readsig+0x4e>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1187 <readsig+0x67>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
jmp    12fe <readsig+0x1de>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
je     11ad <readsig+0x8d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    11c6 <readsig+0xa6>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
jmp    12fe <readsig+0x1de>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readnump@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1223 <readsig+0x103>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readnump@plt>
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
movsbl -0x1d(%rbp),%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    11d9 <readsig+0xb9>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1249 <readsig+0x129>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    125b <readsig+0x13b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readnump@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1288 <readsig+0x168>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    129b <readsig+0x17b>
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    12fe <readsig+0x1de>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    12f9 <readsig+0x1d9>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     12e6 <readsig+0x1c6>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    12f4 <readsig+0x1d4>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    12a4 <readsig+0x184>
jmp    12fe <readsig+0x1de>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsig>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdx),%rcx
mov    (%rcx),%al
cmpb   $0x7c,0x1(%rcx)
jne    114f <readsig+0x2f>
or     $0x20,%al
cmp    $0x63,%al
jne    1169 <readsig+0x49>
movl   $0x2,(%r15)
movl   $0x2,(%r14)
jmp    1163 <readsig+0x43>
or     $0x20,%al
cmp    $0x63,%al
jne    1169 <readsig+0x49>
movl   $0x4,(%r15)
movl   $0x4,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <readnump@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,(%r15)
mov    (%rbx),%rax
movzbl (%rax),%ecx
cmp    $0x2b,%cl
jne    11a7 <readsig+0x87>
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <readnump@plt>
movsbl %al,%eax
add    (%r15),%eax
jmp    1180 <readsig+0x60>
cmp    $0x2f,%cl
jne    11b5 <readsig+0x95>
add    $0x1,%rax
mov    %rax,(%rbx)
jmp    11c3 <readsig+0xa3>
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1040 <event_error@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <readnump@plt>
mov    %eax,(%r14)
cmpl   $0x0,(%r15)
je     11f4 <readsig+0xd4>
test   %eax,%eax
je     11f4 <readsig+0xd4>
cmp    $0x2,%eax
jl     1163 <readsig+0x43>
nop
test   $0x1,%al
jne    1207 <readsig+0xe7>
mov    %eax,%ecx
shr    %ecx
cmp    $0x3,%eax
mov    %ecx,%eax
ja     11e0 <readsig+0xc0>
jmp    1163 <readsig+0x43>
lea    0xe10(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <event_error@plt>
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1040 <event_error@plt>
movl   $0x0,(%r14)
jmp    1163 <readsig+0x43>

LLVM IR (-O0):
@.str = [11 x i8] c"Missing / \00"
@.str.1 = [31 x i8] c"Expecting fraction in form A/B\00"
@.str.2 = [29 x i8] c"divisor must be a power of 2\00"
define void @readsig(i32* %0, i32* %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8** %2, i8*** %6
%9 = load i8**, i8*** %6
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 124
br i1 %14, label %15, label %30
15: ; preds = %3
%16 = load i8**, i8*** %6
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 67
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8**, i8*** %6
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 99
br i1 %26, label %27, label %30
27: ; preds = %21, %15
%28 = load i32*, i32** %4
store i32 2, i32* %28
%29 = load i32*, i32** %5
store i32 2, i32* %29
br label %113
30: ; preds = %21, %3
%31 = load i8**, i8*** %6
%32 = load i8*, i8** %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 67
br i1 %35, label %42, label %36
36: ; preds = %30
%37 = load i8**, i8*** %6
%38 = load i8*, i8** %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 99
br i1 %41, label %42, label %45
42: ; preds = %36, %30
%43 = load i32*, i32** %4
store i32 4, i32* %43
%44 = load i32*, i32** %5
store i32 4, i32* %44
br label %113
45: ; preds = %36
%46 = load i8**, i8*** %6
%47 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %46)
%48 = load i32*, i32** %4
store i32 %47, i32* %48
br label %49
49: ; preds = %55, %45
%50 = load i8**, i8*** %6
%51 = load i8*, i8** %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 43
br i1 %54, label %55, label %69
55: ; preds = %49
%56 = load i8**, i8*** %6
%57 = load i8*, i8** %56
%58 = getelementptr inbounds i8, i8* %57, i64 1
%59 = load i8**, i8*** %6
store i8* %58, i8** %59
%60 = load i8**, i8*** %6
%61 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %60)
%62 = trunc i32 %61 to i8
store i8 %62, i8* %8
%63 = load i32*, i32** %4
%64 = load i32, i32* %63
%65 = load i8, i8* %8
%66 = sext i8 %65 to i32
%67 = add nsw i32 %64, %66
%68 = load i32*, i32** %4
store i32 %67, i32* %68
br label %49
69: ; preds = %49
%70 = load i8**, i8*** %6
%71 = load i8*, i8** %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %73, 47
br i1 %74, label %75, label %77
75: ; preds = %69
%76 = call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %82
77: ; preds = %69
%78 = load i8**, i8*** %6
%79 = load i8*, i8** %78
%80 = getelementptr inbounds i8, i8* %79, i64 1
%81 = load i8**, i8*** %6
store i8* %80, i8** %81
br label %82
82: ; preds = %77, %75
%83 = load i8**, i8*** %6
%84 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %83)
%85 = load i32*, i32** %5
store i32 %84, i32* %85
%86 = load i32*, i32** %4
%87 = load i32, i32* %86
%88 = icmp eq i32 %87, 0
br i1 %88, label %93, label %89
89: ; preds = %82
%90 = load i32*, i32** %5
%91 = load i32, i32* %90
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %89, %82
%94 = call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %113
95: ; preds = %89
%96 = load i32*, i32** %5
%97 = load i32, i32* %96
store i32 %97, i32* %7
br label %98
98: ; preds = %111, %95
%99 = load i32, i32* %7
%100 = icmp sgt i32 %99, 1
br i1 %100, label %101, label %112
101: ; preds = %98
%102 = load i32, i32* %7
%103 = srem i32 %102, 2
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %101
%106 = call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %7
%107 = load i32*, i32** %5
store i32 0, i32* %107
br label %111
108: ; preds = %101
%109 = load i32, i32* %7
%110 = sdiv i32 %109, 2
store i32 %110, i32* %7
br label %111
111: ; preds = %108, %105
br label %98
112: ; preds = %98
br label %113
113: ; preds = %27, %42, %112, %93
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Missing / \00"
@.str.1 = [31 x i8] c"Expecting fraction in form A/B\00"
@.str.2 = [29 x i8] c"divisor must be a power of 2\00"
define void @readsig(i32* nocapture %0, i32* nocapture writeonly %1, i8** %2) {
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 124
%8 = load i8, i8* %4
br i1 %7, label %9, label %11
9: ; preds = %3
switch i8 %8, label %13 [
i8 67, label %10
i8 99, label %10
]
10: ; preds = %9, %9
store i32 2, i32* %0
store i32 2, i32* %1
br label %49
11: ; preds = %3
switch i8 %8, label %13 [
i8 67, label %12
i8 99, label %12
]
12: ; preds = %11, %11
store i32 4, i32* %0
store i32 4, i32* %1
br label %49
13: ; preds = %9, %11
%14 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
br label %15
15: ; preds = %19, %13
%16 = phi i32 [ %14, %13 ], [ %25, %19 ]
store i32 %16, i32* %0
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
switch i8 %18, label %26 [
i8 43, label %19
i8 47, label %28
]
19: ; preds = %15
%20 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %20, i8** %2
%21 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
%22 = load i32, i32* %0
%23 = shl i32 %21, 24
%24 = ashr exact i32 %23, 24
%25 = add nsw i32 %24, %22
br label %15
26: ; preds = %15
%27 = tail call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %30
28: ; preds = %15
%29 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %29, i8** %2
br label %30
30: ; preds = %28, %26
%31 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
store i32 %31, i32* %1
%32 = load i32, i32* %0
%33 = icmp eq i32 %32, 0
%34 = icmp eq i32 %31, 0
%35 = select i1 %33, i1 true, i1 %34
br i1 %35, label %38, label %36
36: ; preds = %30
%37 = icmp sgt i32 %31, 1
br i1 %37, label %40, label %49
38: ; preds = %30
%39 = tail call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %49
40: ; preds = %36, %46
%41 = phi i32 [ %47, %46 ], [ %31, %36 ]
%42 = and i32 %41, 1
%43 = icmp eq i32 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %40
%45 = tail call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %49
46: ; preds = %40
%47 = lshr i32 %41, 1
%48 = icmp ugt i32 %41, 3
br i1 %48, label %40, label %49
49: ; preds = %46, %44, %36, %38, %12, %10
ret void
}