#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*/ block(char *);
int /*<<< orphan*/ condition();
int /*<<< orphan*/ emitln(char *, char *);
int /*<<< orphan*/ match(unsigned char);
int /*<<< orphan*/ newLabel(char *);
int /*<<< orphan*/ postLabel(char *, char *);
void doRepeat() {
  char label1[10];
  char label2[10];
  match('r');
  newLabel(label1);
  newLabel(label2);
  postLabel(label1, "#REPEAT");
  block(label2);
  match('u');
  condition();
  emitln("JEQ\t%s", label1);
  postLabel(label2, "#ENDREPEAT");
}


x86 assembly (clang, -O0):
<doRepeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x72,%edi
call   1070 <match@plt>
lea    -0xa(%rbp),%rdi
call   1060 <newLabel@plt>
lea    -0x14(%rbp),%rdi
call   1060 <newLabel@plt>
lea    -0xa(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1050 <postLabel@plt>
lea    -0x14(%rbp),%rdi
call   1080 <block@plt>
mov    $0x75,%edi
call   1070 <match@plt>
mov    $0x0,%al
call   1040 <condition@plt>
lea    -0xa(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1030 <emitln@plt>
lea    -0x14(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1050 <postLabel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doRepeat>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    $0x72,%edi
call   1070 <match@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <newLabel@plt>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1060 <newLabel@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <postLabel@plt>
mov    %r14,%rdi
call   1080 <block@plt>
mov    $0x75,%edi
call   1070 <match@plt>
xor    %eax,%eax
call   1040 <condition@plt>
lea    0xe4e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <emitln@plt>
lea    0xe46(%rip),%rsi
mov    %r14,%rdi
call   1050 <postLabel@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"#REPEAT\00"
@.str.1 = [7 x i8] c"JEQ\09%s\00"
@.str.2 = [11 x i8] c"#ENDREPEAT\00"
define void @doRepeat() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = call i32 @match(i8 zeroext 114)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @newLabel(i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @newLabel(i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = call i32 @postLabel(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 @block(i8* %10)
%12 = call i32 @match(i8 zeroext 117)
%13 = call i32 (...) @condition()
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%15 = call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%17 = call i32 @postLabel(i8* %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"#REPEAT\00"
@.str.1 = [7 x i8] c"JEQ\09%s\00"
@.str.2 = [11 x i8] c"#ENDREPEAT\00"
define void @doRepeat() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @match(i8 zeroext 114)
%6 = call i32 @newLabel(i8* %3)
%7 = call i32 @newLabel(i8* %4)
%8 = call i32 @postLabel(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @block(i8* %4)
%10 = call i32 @match(i8 zeroext 117)
%11 = call i32 (...) @condition()
%12 = call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%13 = call i32 @postLabel(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}