#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 meny();
int min_beregning(int, int, int);
int /*<<< orphan*/ min_input(char *, int *);
int /*<<< orphan*/ min_output(int, int, int, int);
int main() {
  int a, b, c, v;
  while (1) {
    v = meny();
    if (v == 1)
      return 0;
    min_input("\nOppgi et tall, a: ", &a);
    min_input("Oppgi et tall, b: ", &b);
    c = min_beregning(a, b, v);
    min_output(a, b, c, v);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <meny@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    116b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
lea    0xe8e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <min_input@plt>
lea    0xe92(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <min_input@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <min_beregning@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <min_output@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <meny@plt>
cmp    $0x1,%eax
je     11c4 <main+0x84>
mov    %eax,%ebp
lea    0xe9f(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xea7(%rip),%r12
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <min_input@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <min_input@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %ebp,%edx
call   1060 <min_beregning@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %eax,%edx
mov    %ebp,%ecx
call   1040 <min_output@plt>
xor    %eax,%eax
call   1030 <meny@plt>
mov    %eax,%ebp
cmp    $0x1,%eax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0AOppgi et tall, a: \00"
@.str.1 = [19 x i8] c"Oppgi et tall, b: \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 = %0, %11
%7 = call i32 (...) @meny()
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
ret i32 0
11: ; preds = %6
%12 = call i32 @min_input(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = call i32 @min_input(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = call i32 @min_beregning(i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @min_output(i32 %18, i32 %19, i32 %20, i32 %21)
br label %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0AOppgi et tall, a: \00"
@.str.1 = [19 x i8] c"Oppgi et tall, b: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (...) @meny()
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %8, %0
ret i32 0
8: ; preds = %0, %8
%9 = phi i32 [ %18, %8 ], [ %5, %0 ]
%10 = call i32 @min_input(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = call i32 @min_input(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @min_beregning(i32 %12, i32 %13, i32 %9)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 @min_output(i32 %15, i32 %16, i32 %14, i32 %9)
%18 = call i32 (...) @meny()
%19 = icmp eq i32 %18, 1
br i1 %19, label %7, label %8
}