void readsig(a, b, sig) int *a, *b;
char **sig;
{
  int t;
  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 (%rax),%eax
cmp    $0x43,%eax
je     115a <readsig+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1173 <readsig+0x53>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
jmp    1261 <readsig+0x141>
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     11ac <readsig+0x8c>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    11be <readsig+0x9e>
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     11eb <readsig+0xcb>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    11fe <readsig+0xde>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    1261 <readsig+0x141>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    125c <readsig+0x13c>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1249 <readsig+0x129>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1257 <readsig+0x137>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    1207 <readsig+0xe7>
jmp    1261 <readsig+0x141>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsig>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdx),%rax
mov    (%rax),%al
or     $0x20,%al
cmp    $0x63,%al
jne    114a <readsig+0x2a>
movl   $0x4,(%r15)
movl   $0x4,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rdx,%rbx
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <readnump@plt>
mov    %eax,(%r15)
mov    (%rbx),%rax
cmpb   $0x2f,(%rax)
jne    116b <readsig+0x4b>
add    $0x1,%rax
mov    %rax,(%rbx)
jmp    1179 <readsig+0x59>
lea    0xe8e(%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     11b1 <readsig+0x91>
test   %eax,%eax
je     11b1 <readsig+0x91>
cmp    $0x2,%eax
jl     1144 <readsig+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
test   $0x1,%al
jne    11c4 <readsig+0xa4>
mov    %eax,%ecx
shr    %ecx
cmp    $0x3,%eax
mov    %ecx,%eax
ja     11a0 <readsig+0x80>
jmp    1144 <readsig+0x24>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <event_error@plt>
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1040 <event_error@plt>
movl   $0x0,(%r14)
jmp    1144 <readsig+0x24>

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 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 67
br i1 %12, label %19, label %13
13: ; preds = %3
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 99
br i1 %18, label %19, label %22
19: ; preds = %13, %3
%20 = load i32*, i32** %4
store i32 4, i32* %20
%21 = load i32*, i32** %5
store i32 4, i32* %21
br label %69
22: ; preds = %13
%23 = load i8**, i8*** %6
%24 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %23)
%25 = load i32*, i32** %4
store i32 %24, i32* %25
%26 = load i8**, i8*** %6
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 47
br i1 %30, label %31, label %33
31: ; preds = %22
%32 = 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 %38
33: ; preds = %22
%34 = load i8**, i8*** %6
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8**, i8*** %6
store i8* %36, i8** %37
br label %38
38: ; preds = %33, %31
%39 = load i8**, i8*** %6
%40 = call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %39)
%41 = load i32*, i32** %5
store i32 %40, i32* %41
%42 = load i32*, i32** %4
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %38
%46 = load i32*, i32** %5
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45, %38
%50 = 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 %69
51: ; preds = %45
%52 = load i32*, i32** %5
%53 = load i32, i32* %52
store i32 %53, i32* %7
br label %54
54: ; preds = %67, %51
%55 = load i32, i32* %7
%56 = icmp sgt i32 %55, 1
br i1 %56, label %57, label %68
57: ; preds = %54
%58 = load i32, i32* %7
%59 = srem i32 %58, 2
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = 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
%63 = load i32*, i32** %5
store i32 0, i32* %63
br label %67
64: ; preds = %57
%65 = load i32, i32* %7
%66 = sdiv i32 %65, 2
store i32 %66, i32* %7
br label %67
67: ; preds = %64, %61
br label %54
68: ; preds = %54
br label %69
69: ; preds = %19, %68, %49
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 = load i8, i8* %4
switch i8 %5, label %7 [
i8 67, label %6
i8 99, label %6
]
6: ; preds = %3, %3
store i32 4, i32* %0
store i32 4, i32* %1
br label %35
7: ; preds = %3
%8 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
store i32 %8, i32* %0
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 47
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = 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 %16
14: ; preds = %7
%15 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %12
%17 = tail call i32 (i8**, ...) bitcast (i32 (...)* @readnump to i32 (i8**, ...)*)(i8** %2)
store i32 %17, i32* %1
%18 = load i32, i32* %0
%19 = icmp eq i32 %18, 0
%20 = icmp eq i32 %17, 0
%21 = select i1 %19, i1 true, i1 %20
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = icmp sgt i32 %17, 1
br i1 %23, label %26, label %35
24: ; preds = %16
%25 = 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 %35
26: ; preds = %22, %32
%27 = phi i32 [ %33, %32 ], [ %17, %22 ]
%28 = and i32 %27, 1
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = 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 %35
32: ; preds = %26
%33 = lshr i32 %27, 1
%34 = icmp ugt i32 %27, 3
br i1 %34, label %26, label %35
35: ; preds = %32, %30, %22, %24, %6
ret void
}