#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 JLValue {
  int dummy;
};
struct JLContext {
  int dummy;
};

/* Variables and functions */
struct JLValue *JLEvaluate(struct JLContext *, struct JLValue *);
struct JLValue *JLParse(struct JLContext *, char const **);
int /*<<< orphan*/ JLRelease(struct JLContext *, struct JLValue *);
struct JLValue *ProcessBuffer(struct JLContext *context, const char *line) {
  struct JLValue *result = NULL;
  while (*line) {
    struct JLValue *value = JLParse(context, &line);
    if (value) {
      JLRelease(context, result);
      result = JLEvaluate(context, value);
      JLRelease(context, value);
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<ProcessBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a1 <ProcessBuffer+0x71>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <JLParse@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     119c <ProcessBuffer+0x6c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <JLRelease@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <JLEvaluate@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <JLRelease@plt>
jmp    1148 <ProcessBuffer+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessBuffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
cmpb   $0x0,(%rsi)
je     1192 <ProcessBuffer+0x62>
mov    %rdi,%r12
xor    %r15d,%r15d
mov    %rsp,%r14
jmp    1159 <ProcessBuffer+0x29>
nopl   0x0(%rax)
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1195 <ProcessBuffer+0x65>
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <JLParse@plt>
test   %rax,%rax
je     1150 <ProcessBuffer+0x20>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <JLRelease@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <JLEvaluate@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <JLRelease@plt>
jmp    1150 <ProcessBuffer+0x20>
xor    %r15d,%r15d
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.JLValue = type { i32 }
%struct.JLContext = type { i32 }
define %struct.JLValue* @ProcessBuffer(%struct.JLContext* %0, i8* %1) {
%3 = alloca %struct.JLContext*
%4 = alloca i8*
%5 = alloca %struct.JLValue*
%6 = alloca %struct.JLValue*
store %struct.JLContext* %0, %struct.JLContext** %3
store i8* %1, i8** %4
store %struct.JLValue* null, %struct.JLValue** %5
br label %7
7: ; preds = %26, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %7
%12 = load %struct.JLContext*, %struct.JLContext** %3
%13 = call %struct.JLValue* @JLParse(%struct.JLContext* %12, i8** %4)
store %struct.JLValue* %13, %struct.JLValue** %6
%14 = load %struct.JLValue*, %struct.JLValue** %6
%15 = icmp ne %struct.JLValue* %14, null
br i1 %15, label %16, label %26
16: ; preds = %11
%17 = load %struct.JLContext*, %struct.JLContext** %3
%18 = load %struct.JLValue*, %struct.JLValue** %5
%19 = call i32 @JLRelease(%struct.JLContext* %17, %struct.JLValue* %18)
%20 = load %struct.JLContext*, %struct.JLContext** %3
%21 = load %struct.JLValue*, %struct.JLValue** %6
%22 = call %struct.JLValue* @JLEvaluate(%struct.JLContext* %20, %struct.JLValue* %21)
store %struct.JLValue* %22, %struct.JLValue** %5
%23 = load %struct.JLContext*, %struct.JLContext** %3
%24 = load %struct.JLValue*, %struct.JLValue** %6
%25 = call i32 @JLRelease(%struct.JLContext* %23, %struct.JLValue* %24)
br label %26
26: ; preds = %16, %11
br label %7
27: ; preds = %7
%28 = load %struct.JLValue*, %struct.JLValue** %5
ret %struct.JLValue* %28
}

LLVM IR (-O2):
%struct.JLValue = type { i32 }
%struct.JLContext = type { i32 }
define %struct.JLValue* @ProcessBuffer(%struct.JLContext* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %2, %14
%7 = phi %struct.JLValue* [ %15, %14 ], [ null, %2 ]
%8 = call %struct.JLValue* @JLParse(%struct.JLContext* %0, i8** %3)
%9 = icmp eq %struct.JLValue* %8, null
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = call i32 @JLRelease(%struct.JLContext* %0, %struct.JLValue* %7)
%12 = call %struct.JLValue* @JLEvaluate(%struct.JLContext* %0, %struct.JLValue* %8)
%13 = call i32 @JLRelease(%struct.JLContext* %0, %struct.JLValue* %8)
br label %14
14: ; preds = %10, %6
%15 = phi %struct.JLValue* [ %12, %10 ], [ %7, %6 ]
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %14, %2
%20 = phi %struct.JLValue* [ null, %2 ], [ %15, %14 ]
ret %struct.JLValue* %20
}