#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 */
struct object {
  int dummy;
};

/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ update_object_face(char *, struct object *);
int /*<<< orphan*/ update_object_normal(char *, struct object *);
int /*<<< orphan*/ update_object_vertex(char *, struct object *);
void update_object(char *line, struct object *obj) {
  if (strncmp(line, "v ", 2) == 0)
    update_object_vertex(line, obj);
  else if (strncmp(line, "vn ", 2) == 0)
    update_object_normal(line, obj);
  else if (strncmp(line, "f ", 2) == 0)
    update_object_face(line, obj);
  return;
}


x86 assembly (clang, -O0):
<update_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1181 <update_object+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <update_object_vertex@plt>
jmp    11e8 <update_object+0xa8>
mov    -0x8(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11b2 <update_object+0x72>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <update_object_normal@plt>
jmp    11e3 <update_object+0xa3>
mov    -0x8(%rbp),%rdi
lea    0xe4a(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11de <update_object+0x9e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <update_object_face@plt>
jmp    11e3 <update_object+0xa3>
jmp    11e8 <update_object+0xa8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_object>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaf(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     119a <update_object+0x5a>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11ac <update_object+0x6c>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11be <update_object+0x7e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <update_object_vertex@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <update_object_normal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <update_object_face@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
@.str = [3 x i8] c"v \00"
@.str.1 = [4 x i8] c"vn \00"
@.str.2 = [3 x i8] c"f \00"
define void @update_object(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load i8*, i8** %3
%6 = call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load %struct.object*, %struct.object** %4
%11 = call i32 @update_object_vertex(i8* %9, %struct.object* %10)
br label %30
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load %struct.object*, %struct.object** %4
%19 = call i32 @update_object_normal(i8* %17, %struct.object* %18)
br label %29
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = load %struct.object*, %struct.object** %4
%27 = call i32 @update_object_face(i8* %25, %struct.object* %26)
br label %28
28: ; preds = %24, %20
br label %29
29: ; preds = %28, %16
br label %30
30: ; preds = %29, %8
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
@.str = [3 x i8] c"v \00"
@.str.1 = [4 x i8] c"vn \00"
@.str.2 = [3 x i8] c"f \00"
define void @update_object(i8* %0, %struct.object* %1) {
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @update_object_vertex(i8* %0, %struct.object* %1)
br label %17
7: ; preds = %2
%8 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @update_object_normal(i8* %0, %struct.object* %1)
br label %17
12: ; preds = %7
%13 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @update_object_face(i8* %0, %struct.object* %1)
br label %17
17: ; preds = %10, %15, %12, %5
ret void
}