void readsig(a, b, sig) int *a, *b;
char **sig;
{
  int t;
  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);
  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    12b4 <readsig+0x194>
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    12b4 <readsig+0x194>
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    $0x2f,%eax
je     11ff <readsig+0xdf>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    1211 <readsig+0xf1>
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     123e <readsig+0x11e>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1251 <readsig+0x131>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    12b4 <readsig+0x194>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    12af <readsig+0x18f>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     129c <readsig+0x17c>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    12aa <readsig+0x18a>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    125a <readsig+0x13a>
jmp    12b4 <readsig+0x194>
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>
mov    %eax,(%r15)
mov    (%rbx),%rax
cmpb   $0x2f,(%rax)
jne    1187 <readsig+0x67>
add    $0x1,%rax
mov    %rax,(%rbx)
jmp    1195 <readsig+0x75>
lea    0xe72(%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     11d1 <readsig+0xb1>
test   %eax,%eax
je     11d1 <readsig+0xb1>
cmp    $0x2,%eax
jl     1163 <readsig+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%al
jne    11e4 <readsig+0xc4>
mov    %eax,%ecx
shr    %ecx
cmp    $0x3,%eax
mov    %ecx,%eax
ja     11c0 <readsig+0xa0>
jmp    1163 <readsig+0x43>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <event_error@plt>
lea    0xe3f(%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
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8** %2, i8*** %6
%8 = load i8**, i8*** %6
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 124
br i1 %13, label %14, label %29
14: ; preds = %3
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 67
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load i8**, i8*** %6
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 99
br i1 %25, label %26, label %29
26: ; preds = %20, %14
%27 = load i32*, i32** %4
store i32 2, i32* %27
%28 = load i32*, i32** %5
store i32 2, i32* %28
br label %91
29: ; preds = %20, %3
%30 = load i8**, i8*** %6
%31 = load i8*, i8** %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 67
br i1 %34, label %41, label %35
35: ; preds = %29
%36 = load i8**, i8*** %6
%37 = load i8*, i8** %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 99
br i1 %40, label %41, label %44
41: ; preds = %35, %29
%42 = load i32*, i32** %4
store i32 4, i32* %42
%43 = load i32*, i32** %5
store i32 4, i32* %43
br label %91
44: ; preds = %35
%45 = load i8**, i8*** %6
%46 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %45)
%47 = load i32*, i32** %4
store i32 %46, i32* %47
%48 = load i8**, i8*** %6
%49 = load i8*, i8** %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 47
br i1 %52, label %53, label %55
53: ; preds = %44
%54 = 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 %60
55: ; preds = %44
%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
br label %60
60: ; preds = %55, %53
%61 = load i8**, i8*** %6
%62 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %61)
%63 = load i32*, i32** %5
store i32 %62, i32* %63
%64 = load i32*, i32** %4
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %60
%68 = load i32*, i32** %5
%69 = load i32, i32* %68
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67, %60
%72 = 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 %91
73: ; preds = %67
%74 = load i32*, i32** %5
%75 = load i32, i32* %74
store i32 %75, i32* %7
br label %76
76: ; preds = %89, %73
%77 = load i32, i32* %7
%78 = icmp sgt i32 %77, 1
br i1 %78, label %79, label %90
79: ; preds = %76
%80 = load i32, i32* %7
%81 = srem i32 %80, 2
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %79
%84 = 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
%85 = load i32*, i32** %5
store i32 0, i32* %85
br label %89
86: ; preds = %79
%87 = load i32, i32* %7
%88 = sdiv i32 %87, 2
store i32 %88, i32* %7
br label %89
89: ; preds = %86, %83
br label %76
90: ; preds = %76
br label %91
91: ; preds = %26, %41, %90, %71
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 %41
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 %41
13: ; preds = %9, %11
%14 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
store i32 %14, i32* %0
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 47
br i1 %17, label %20, label %18
18: ; preds = %13
%19 = 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 %22
20: ; preds = %13
%21 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %21, i8** %2
br label %22
22: ; preds = %20, %18
%23 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
store i32 %23, i32* %1
%24 = load i32, i32* %0
%25 = icmp eq i32 %24, 0
%26 = icmp eq i32 %23, 0
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %30, label %28
28: ; preds = %22
%29 = icmp sgt i32 %23, 1
br i1 %29, label %32, label %41
30: ; preds = %22
%31 = 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 %41
32: ; preds = %28, %38
%33 = phi i32 [ %39, %38 ], [ %23, %28 ]
%34 = and i32 %33, 1
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = 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 %41
38: ; preds = %32
%39 = lshr i32 %33, 1
%40 = icmp ugt i32 %33, 3
br i1 %40, label %32, label %41
41: ; preds = %38, %36, %28, %30, %12, %10
ret void
}