#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 /*<<< orphan*/ factor(char *);
int /*<<< orphan*/ *gets_s(char *, int);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    char **ss;
    for (ss = argv; *ss; ss++)
      factor(*ss);
  } else
    for (;;) {
      char s[256];
      if (NULL == gets_s(s, 256))
        break;
      factor(s);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    117b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1176 <main+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <factor@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    114b <main+0x2b>
jmp    11ba <main+0x9a>
jmp    1180 <main+0x60>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1030 <gets_s@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11a4 <main+0x84>
jmp    11b5 <main+0x95>
lea    -0x120(%rbp),%rdi
call   1040 <factor@plt>
jmp    1180 <main+0x60>
jmp    11ba <main+0x9a>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
cmp    $0x1,%edi
jle    1153 <main+0x33>
mov    %rsi,%rbx
mov    (%rsi),%rdi
test   %rdi,%rdi
je     118a <main+0x6a>
add    $0x8,%rbx
nopl   0x0(%rax)
call   1040 <factor@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <main+0x20>
jmp    118a <main+0x6a>
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <gets_s@plt>
test   %rax,%rax
je     118a <main+0x6a>
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <factor@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <gets_s@plt>
test   %rax,%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %24
10: ; preds = %2
%11 = load i8**, i8*** %5
store i8** %11, i8*** %6
br label %12
12: ; preds = %20, %10
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i8**, i8*** %6
%18 = load i8*, i8** %17
%19 = call i32 @factor(i8* %18)
br label %20
20: ; preds = %16
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %6
br label %12
23: ; preds = %12
br label %34
24: ; preds = %2
br label %25
25: ; preds = %30, %24
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%27 = call i32* @gets_s(i8* %26, i32 256)
%28 = icmp eq i32* null, %27
br i1 %28, label %29, label %30
29: ; preds = %25
br label %33
30: ; preds = %25
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%32 = call i32 @factor(i8* %31)
br label %25
33: ; preds = %29
br label %34
34: ; preds = %33, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = call i32* @gets_s(i8* %6, i32 256)
%8 = icmp eq i32* %7, null
br i1 %8, label %19, label %20
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = icmp eq i8* %10, null
br i1 %11, label %24, label %12
12: ; preds = %9, %12
%13 = phi i8* [ %17, %12 ], [ %10, %9 ]
%14 = phi i8** [ %16, %12 ], [ %1, %9 ]
%15 = tail call i32 @factor(i8* %13)
%16 = getelementptr inbounds i8*, i8** %14, i64 1
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %24, label %12
19: ; preds = %20, %5
br label %24
20: ; preds = %5, %20
%21 = call i32 @factor(i8* %6)
%22 = call i32* @gets_s(i8* %6, i32 256)
%23 = icmp eq i32* %22, null
br i1 %23, label %19, label %20
24: ; preds = %12, %9, %19
ret i32 0
}