#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 */

/* Variables and functions */
int getword(char *, char *);
int /*<<< orphan*/ skip_white(char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ troff_tex(char *, char *, int /*<<< orphan*/, int);
char *get_over_arg(char *pin, char *ww) {
  char w[250], tmp1[250], tmp2[250];
  int len;
  w[0] = '\0';
  tmp1[0] = '\0';
  tmp2[0] = '\0';
  pin += getword(pin, tmp1);
  pin += skip_white(pin);
  len = getword(pin, tmp2);
  strcat(w, tmp1);
  strcat(w, " ");
  while (strcmp(tmp2, "sub") == 0 || strcmp(tmp2, "sup") == 0) {
    pin += len;
    strcat(w, tmp2);
    strcat(w, " ");
    pin += skip_white(pin);
    pin += getword(pin, tmp1);
    strcat(w, tmp1);
    strcat(w, " ");
    pin += skip_white(pin);
    len = getword(pin, tmp2);
  }
  troff_tex(w, ww, 0, 1);
  return (pin);
}


x86 assembly (clang, -O0):
<get_over_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x110(%rbp)
movb   $0x0,-0x210(%rbp)
movb   $0x0,-0x310(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <getword@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <skip_white@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1050 <getword@plt>
mov    %eax,-0x314(%rbp)
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x310(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x315(%rbp)
je     1235 <get_over_arg+0xe5>
lea    -0x310(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x315(%rbp)
mov    -0x315(%rbp),%al
test   $0x1,%al
jne    1248 <get_over_arg+0xf8>
jmp    1315 <get_over_arg+0x1c5>
mov    -0x314(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1070 <skip_white@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <getword@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xd24(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1070 <skip_white@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1050 <getword@plt>
mov    %eax,-0x314(%rbp)
jmp    11ed <get_over_arg+0x9d>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <troff_tex@plt>
mov    -0x8(%rbp),%rax
add    $0x320,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_over_arg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x318,%rsp
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
movb   $0x0,0x10(%rsp)
movb   $0x0,0x110(%rsp)
movb   $0x0,0x210(%rsp)
lea    0x110(%rsp),%r12
mov    %r12,%rsi
call   1050 <getword@plt>
movslq %eax,%rbp
add    %rbx,%rbp
mov    %rbp,%rdi
call   1070 <skip_white@plt>
movslq %eax,%r15
add    %rbp,%r15
lea    0x210(%rsp),%r13
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <getword@plt>
mov    %eax,%r14d
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
lea    0xe31(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcat@plt>
jmp    1266 <get_over_arg+0x116>
nopl   0x0(%rax)
movslq %r14d,%rax
add    %rax,%r15
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   1060 <strcat@plt>
mov    %rbp,%rdi
lea    0xe00(%rip),%r12
mov    %r12,%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
call   1070 <skip_white@plt>
movslq %eax,%rbp
add    %r15,%rbp
mov    %rbp,%rdi
lea    0x110(%rsp),%r14
mov    %r14,%rsi
call   1050 <getword@plt>
movslq %eax,%rbx
add    %rbp,%rbx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1070 <skip_white@plt>
movslq %eax,%r15
add    %rbx,%r15
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <getword@plt>
mov    %eax,%r14d
mov    %r13,%rdi
lea    0xd92(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e0 <get_over_arg+0x90>
mov    %r13,%rdi
lea    0xd7e(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e0 <get_over_arg+0x90>
lea    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <troff_tex@plt>
mov    %r15,%rax
add    $0x318,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"sub\00"
@.str.2 = [4 x i8] c"sup\00"
define i8* @get_over_arg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [250 x i8]
%6 = alloca [250 x i8]
%7 = alloca [250 x i8]
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
store i8 0, i8* %9
%10 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
store i8 0, i8* %10
%11 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
store i8 0, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%14 = call i32 @getword(i8* %12, i8* %13)
%15 = load i8*, i8** %3
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8* %17, i8** %3
%18 = load i8*, i8** %3
%19 = call i32 @skip_white(i8* %18)
%20 = load i8*, i8** %3
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8* %22, i8** %3
%23 = load i8*, i8** %3
%24 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%25 = call i32 @getword(i8* %23, i8* %24)
store i32 %25, i32* %8
%26 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%27 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%28 = call i32 @strcat(i8* %26, i8* %27)
%29 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%30 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %31
31: ; preds = %41, %2
%32 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %31
%36 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br label %39
39: ; preds = %35, %31
%40 = phi i1 [ true, %31 ], [ %38, %35 ]
br i1 %40, label %41, label %75
41: ; preds = %39
%42 = load i32, i32* %8
%43 = load i8*, i8** %3
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds i8, i8* %43, i64 %44
store i8* %45, i8** %3
%46 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%47 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%48 = call i32 @strcat(i8* %46, i8* %47)
%49 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%50 = call i32 @strcat(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%51 = load i8*, i8** %3
%52 = call i32 @skip_white(i8* %51)
%53 = load i8*, i8** %3
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds i8, i8* %53, i64 %54
store i8* %55, i8** %3
%56 = load i8*, i8** %3
%57 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%58 = call i32 @getword(i8* %56, i8* %57)
%59 = load i8*, i8** %3
%60 = sext i32 %58 to i64
%61 = getelementptr inbounds i8, i8* %59, i64 %60
store i8* %61, i8** %3
%62 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%63 = getelementptr inbounds [250 x i8], [250 x i8]* %6, i64 0, i64 0
%64 = call i32 @strcat(i8* %62, i8* %63)
%65 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%66 = call i32 @strcat(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%67 = load i8*, i8** %3
%68 = call i32 @skip_white(i8* %67)
%69 = load i8*, i8** %3
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds i8, i8* %69, i64 %70
store i8* %71, i8** %3
%72 = load i8*, i8** %3
%73 = getelementptr inbounds [250 x i8], [250 x i8]* %7, i64 0, i64 0
%74 = call i32 @getword(i8* %72, i8* %73)
store i32 %74, i32* %8
br label %31
75: ; preds = %39
%76 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%77 = load i8*, i8** %4
%78 = call i32 @troff_tex(i8* %76, i8* %77, i32 0, i32 1)
%79 = load i8*, i8** %3
ret i8* %79
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"sub\00"
@.str.2 = [4 x i8] c"sup\00"
define i8* @get_over_arg(i8* %0, i8* %1) {
%3 = alloca [250 x i8]
%4 = alloca [250 x i8]
%5 = alloca [250 x i8]
%6 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [250 x i8], [250 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
store i8 0, i8* %6
store i8 0, i8* %7
store i8 0, i8* %8
%9 = call i32 @getword(i8* %0, i8* %7)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = call i32 @skip_white(i8* %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = call i32 @getword(i8* %14, i8* %8)
%16 = call i32 @strcat(i8* %6, i8* %7)
%17 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %26, %2
%19 = phi i8* [ %14, %2 ], [ %41, %26 ]
%20 = phi i32 [ %15, %2 ], [ %42, %26 ]
%21 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %18
%24 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %43
26: ; preds = %18, %23
%27 = sext i32 %20 to i64
%28 = getelementptr inbounds i8, i8* %19, i64 %27
%29 = call i32 @strcat(i8* %6, i8* %8)
%30 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @skip_white(i8* %28)
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %28, i64 %32
%34 = call i32 @getword(i8* %33, i8* %7)
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = call i32 @strcat(i8* %6, i8* %7)
%38 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = call i32 @skip_white(i8* %36)
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %36, i64 %40
%42 = call i32 @getword(i8* %41, i8* %8)
br label %18
43: ; preds = %23
%44 = call i32 @troff_tex(i8* %6, i8* %1, i32 0, i32 1)
ret i8* %19
}