#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *, int *, int *);
int main() {
  int a, b, n, sum;
  while (scanf("%d%d%d", &a, &b, &n) != EOF) {
    sum = 0;
    while (sum != n) {
      if (sum < b) {
        printf("fill A\npour A B\n");
        sum += a;
      } else if (sum > b) {
        printf("empty B\npour A B\n");
        sum -= b;
      }
    }
    printf("success\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     11ce <main+0xae>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11bd <main+0x9d>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1190 <main+0x70>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11b8 <main+0x98>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b3 <main+0x93>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    11b8 <main+0x98>
jmp    115e <main+0x3e>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%rax
jne    1166 <main+0x46>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbx
lea    0xea4(%rip),%rbp
lea    0xe8c(%rip),%r14
jmp    11bd <main+0x9d>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
mov    0x2e30(%rip),%rcx
cmp    (%rcx),%rax
je     1155 <main+0x35>
cmpl   $0x0,0xc(%rsp)
je     1190 <main+0x70>
xor    %r15d,%r15d
jmp    11e4 <main+0xc4>
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1030 <puts@plt>
add    0x14(%rsp),%r15d
cmp    0xc(%rsp),%r15d
je     1190 <main+0x70>
cmp    0x10(%rsp),%r15d
jl     11d0 <main+0xb0>
jle    11dd <main+0xbd>
mov    %r14,%rdi
call   1030 <puts@plt>
sub    0x10(%rsp),%r15d
jmp    11dd <main+0xbd>

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@EOF = global i64 0
@.str.1 = [17 x i8] c"fill A\0Apour A B\0A\00"
@.str.2 = [18 x i8] c"empty B\0Apour A B\0A\00"
@.str.3 = [9 x i8] c"success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %35, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
store i32 0, i32* %5
br label %11
11: ; preds = %34, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %35
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = load i32, i32* %5
%23 = add nsw i32 %22, %21
store i32 %23, i32* %5
br label %34
24: ; preds = %15
%25 = load i32, i32* %5
%26 = load i32, i32* %3
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* %3
%31 = load i32, i32* %5
%32 = sub nsw i32 %31, %30
store i32 %32, i32* %5
br label %33
33: ; preds = %28, %24
br label %34
34: ; preds = %33, %19
br label %11
35: ; preds = %11
%36 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %6
37: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@EOF = global i64 0
@str = [8 x i8] c"success\00"
@str.4 = [17 x i8] c"empty B\0Apour A B\00"
@str.5 = [16 x i8] c"fill A\0Apour A B\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %36, label %10
10: ; preds = %0, %31
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %31, label %13
13: ; preds = %10, %27
%14 = phi i32 [ %28, %27 ], [ 0, %10 ]
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = add nsw i32 %19, %14
br label %27
21: ; preds = %13
%22 = icmp sgt i32 %14, %15
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%25 = load i32, i32* %2
%26 = sub nsw i32 %14, %25
br label %27
27: ; preds = %21, %23, %17
%28 = phi i32 [ %20, %17 ], [ %26, %23 ], [ %14, %21 ]
%29 = load i32, i32* %3
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %13
31: ; preds = %27, %10
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%33 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %10
36: ; preds = %31, %0
ret i32 0
}