#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*/ assert(int);
int getop(char *, int, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *s = "12.3 4.5 +\n";
  char t[100];
  int i = 0;
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "12.3"));
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "4.5"));
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "+"));
  assert(getop(s, i, t) == -1);
  s = " a b c \n";
  i = 0;
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "a"));
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "b"));
  assert(i = getop(s, i, t));
  assert(!strcmp(t, "c"));
  assert(getop(s, i, t) == -1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdd0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xda0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xd60(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
mov    %eax,%edi
mov    %edi,-0x84(%rbp)
call   1040 <assert@plt>
lea    -0x80(%rbp),%rdi
lea    0xd20(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x84(%rbp),%esi
lea    -0x80(%rbp),%rdx
call   1050 <getop@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xed1(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x332e3231,%eax
xor    (%rsp),%eax
movzbl 0x4(%rsp),%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x352e34,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpw   $0x2b,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe3f(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpw   $0x61,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpw   $0x62,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpw   $0x63,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <getop@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"12.3 4.5 +\0A\00"
@.str.1 = [5 x i8] c"12.3\00"
@.str.2 = [4 x i8] c"4.5\00"
@.str.3 = [2 x i8] c"+\00"
@.str.4 = [9 x i8] c" a b c \0A\00"
@.str.5 = [2 x i8] c"a\00"
@.str.6 = [2 x i8] c"b\00"
@.str.7 = [2 x i8] c"c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca [100 x i8]
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %5
store i32 0, i32* %7
%8 = load i8*, i8** %5
%9 = load i32, i32* %7
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = call i32 @getop(i8* %8, i32 %9, i8* %10)
store i32 %11, i32* %7
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %5
%20 = load i32, i32* %7
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%22 = call i32 @getop(i8* %19, i32 %20, i8* %21)
store i32 %22, i32* %7
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i8*, i8** %5
%31 = load i32, i32* %7
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%33 = call i32 @getop(i8* %30, i32 %31, i8* %32)
store i32 %33, i32* %7
%34 = call i32 @assert(i32 %33)
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load i8*, i8** %5
%42 = load i32, i32* %7
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%44 = call i32 @getop(i8* %41, i32 %42, i8* %43)
%45 = icmp eq i32 %44, -1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %5
store i32 0, i32* %7
%48 = load i8*, i8** %5
%49 = load i32, i32* %7
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%51 = call i32 @getop(i8* %48, i32 %49, i8* %50)
store i32 %51, i32* %7
%52 = call i32 @assert(i32 %51)
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
%56 = xor i1 %55, true
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = load i8*, i8** %5
%60 = load i32, i32* %7
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%62 = call i32 @getop(i8* %59, i32 %60, i8* %61)
store i32 %62, i32* %7
%63 = call i32 @assert(i32 %62)
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%65 = call i32 @strcmp(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp ne i32 %65, 0
%67 = xor i1 %66, true
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = load i8*, i8** %5
%71 = load i32, i32* %7
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%73 = call i32 @getop(i8* %70, i32 %71, i8* %72)
store i32 %73, i32* %7
%74 = call i32 @assert(i32 %73)
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%76 = call i32 @strcmp(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%77 = icmp ne i32 %76, 0
%78 = xor i1 %77, true
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = load i8*, i8** %5
%82 = load i32, i32* %7
%83 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%84 = call i32 @getop(i8* %81, i32 %82, i8* %83)
%85 = icmp eq i32 %84, -1
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"12.3 4.5 +\0A\00"
@.str.1 = [5 x i8] c"12.3\00"
@.str.4 = [9 x i8] c" a b c \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @getop(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0, i8* %4)
%6 = call i32 @assert(i32 %5)
%7 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @getop(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %4)
%12 = call i32 @assert(i32 %11)
%13 = bitcast [100 x i8]* %3 to i32*
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 3485236
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @getop(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %4)
%19 = call i32 @assert(i32 %18)
%20 = bitcast [100 x i8]* %3 to i16*
%21 = load i16, i16* %20
%22 = icmp eq i16 %21, 43
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @getop(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %4)
%26 = icmp eq i32 %25, -1
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @getop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 0, i8* %4)
%30 = call i32 @assert(i32 %29)
%31 = load i16, i16* %20
%32 = icmp eq i16 %31, 97
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i32 @getop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %29, i8* %4)
%36 = call i32 @assert(i32 %35)
%37 = load i16, i16* %20
%38 = icmp eq i16 %37, 98
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @getop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %35, i8* %4)
%42 = call i32 @assert(i32 %41)
%43 = load i16, i16* %20
%44 = icmp eq i16 %43, 99
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i32 @getop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %41, i8* %4)
%48 = icmp eq i32 %47, -1
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
ret i32 0
}