#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ get_next_word(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ skip(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void get_pair_value(char *val, FILE *fp) {
  char c;
  skip(fp);
  c = fgetc(fp);
  if (c == EOF) {
    ungetc(c, fp);
  } else if (c == '=') {
    get_next_word(val, fp);
  } else {
    ungetc(c, fp);
  }
}


x86 assembly (clang, -O0):
<get_pair_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <skip@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2e78(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    118f <get_pair_value+0x4f>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
jmp    11c2 <get_pair_value+0x82>
movsbl -0x11(%rbp),%eax
cmp    $0x3d,%eax
jne    11ae <get_pair_value+0x6e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <get_next_word@plt>
jmp    11bd <get_pair_value+0x7d>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
jmp    11c2 <get_pair_value+0x82>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pair_value>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <skip@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%al
je     117b <get_pair_value+0x3b>
cmp    $0x3d,%al
jne    117b <get_pair_value+0x3b>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <get_next_word@plt>
movsbl %al,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i8 0
define void @get_pair_value(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @skip(i32* %6)
%8 = load i32*, i32** %4
%9 = call signext i8 @fgetc(i32* %8)
store i8 %9, i8* %5
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = load i8, i8* @EOF
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %11, %13
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i8, i8* %5
%17 = load i32*, i32** %4
%18 = call i32 @ungetc(i8 signext %16, i32* %17)
br label %32
19: ; preds = %2
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 61
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = load i32*, i32** %4
%26 = call i32 @get_next_word(i8* %24, i32* %25)
br label %31
27: ; preds = %19
%28 = load i8, i8* %5
%29 = load i32*, i32** %4
%30 = call i32 @ungetc(i8 signext %28, i32* %29)
br label %31
31: ; preds = %27, %23
br label %32
32: ; preds = %31, %15
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @get_pair_value(i8* %0, i32* %1) {
%3 = tail call i32 @skip(i32* %1)
%4 = tail call signext i8 @fgetc(i32* %1)
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @ungetc(i8 signext %4, i32* %1)
br label %15
9: ; preds = %2
%10 = icmp eq i8 %4, 61
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = tail call i32 @get_next_word(i8* %0, i32* %1)
br label %15
13: ; preds = %9
%14 = tail call i32 @ungetc(i8 signext %4, i32* %1)
br label %15
15: ; preds = %11, %13, %7
ret void
}