#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  double tv_sec;
  scalar_t__ tv_usec;
};
struct TYPE_3__ {
  double tv_sec;
  scalar_t__ tv_usec;
};
struct rusage {
  TYPE_2__ ru_stime;
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b;
  int c = 0;
  int r;
  r = scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  struct rusage ru;
  while (1) {
    c++;
    b += c;
    while (c < 100000) {
      c++;
      b += c;
    }
    getrusage(RUSAGE_SELF, &ru);
    double rtime = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
    rtime += (double)ru.ru_utime.tv_usec / 1000000.0;
    rtime += (double)ru.ru_stime.tv_usec / 1000000.0;
    if (rtime > 0.5)
      break;
  }
  printf("%d\n", b);
  a += r;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x186a0,-0x10(%rbp)
jge    11b5 <main+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <main+0x51>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1050 <getrusage@plt>
movsd  -0x28(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdq -0x20(%rbp),%xmm0
movsd  0xe24(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  0xe08(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xde5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    122a <main+0xea>
jmp    122f <main+0xef>
jmp    117f <main+0x3f>
mov    -0xc(%rbp),%esi
lea    0xddd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    %eax,%r14d
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %ebp,%ebp
mov    0x2e63(%rip),%r15
lea    0x8(%rsp),%rbx
jmp    11ec <main+0xac>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ebp,%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
mov    %eax,(%rsp)
mov    (%r15),%edi
mov    %rbx,%rsi
call   1050 <getrusage@plt>
movsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdq 0x10(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdq 0x20(%rsp),%xmm2
unpcklpd %xmm1,%xmm2
divpd  0xe2a(%rip),%xmm2
addsd  %xmm2,%xmm0
unpckhpd %xmm2,%xmm2
addsd  %xmm0,%xmm2
ucomisd 0xe26(%rip),%xmm2
ja     1226 <main+0xe6>
mov    (%rsp),%eax
cmp    $0x1869e,%ebp
jg     1190 <main+0x50>
mov    $0x1869e,%ecx
sub    %ebp,%ecx
lea    0x3(%rbp),%edx
imul   %ecx,%edx
mov    $0x1869d,%esi
sub    %ebp,%esi
imul   %rcx,%rsi
shr    %rsi
add    %edx,%eax
lea    (%rax,%rbp,2),%eax
add    %esi,%eax
add    $0x3,%eax
mov    $0x186a0,%ebp
jmp    119c <main+0x5c>
mov    (%rsp),%esi
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
add    %r14d,0x4(%rsp)
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { double, i64 }
%struct.TYPE_3__ = type { double, i64 }
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.rusage
%7 = alloca double
store i32 0, i32* %1
store i32 0, i32* %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 %8, i32* %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %0, %55
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
br label %19
19: ; preds = %22, %13
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 100000
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = add nsw i32 %26, %25
store i32 %27, i32* %3
br label %19
28: ; preds = %19
%29 = load i32, i32* @RUSAGE_SELF
%30 = call i32 @getrusage(i32 %29, %struct.rusage* %6)
%31 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 1
%32 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %31, i32 0, i32 0
%33 = load double, double* %32
%34 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 0
%35 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %34, i32 0, i32 0
%36 = load double, double* %35
%37 = fadd double %33, %36
store double %37, double* %7
%38 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 1
%39 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %38, i32 0, i32 1
%40 = load i64, i64* %39
%41 = sitofp i64 %40 to double
%42 = fdiv double %41, 1.000000e+06
%43 = load double, double* %7
%44 = fadd double %43, %42
store double %44, double* %7
%45 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 0
%46 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %45, i32 0, i32 1
%47 = load i64, i64* %46
%48 = sitofp i64 %47 to double
%49 = fdiv double %48, 1.000000e+06
%50 = load double, double* %7
%51 = fadd double %50, %49
store double %51, double* %7
%52 = load double, double* %7
%53 = fcmp ogt double %52, 5.000000e-01
br i1 %53, label %54, label %55
54: ; preds = %28
br label %56
55: ; preds = %28
br label %13
56: ; preds = %54
%57 = load i32, i32* %3
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %5
%60 = load i32, i32* %2
%61 = add nsw i32 %60, %59
store i32 %61, i32* %2
%62 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { double, i64 }
%struct.TYPE_3__ = type { double, i64 }
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.rusage
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = bitcast %struct.rusage* %3 to i8*
%12 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 1, i32 0
%13 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 0, i32 0
%14 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 1, i32 1
%15 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i64 0, i32 0, i32 1
br label %16
16: ; preds = %37, %0
%17 = phi i32 [ 0, %0 ], [ %39, %37 ]
%18 = add nuw nsw i32 %17, 1
%19 = load i32, i32* %2
%20 = add nsw i32 %19, %18
%21 = icmp slt i32 %17, 99999
br i1 %21, label %22, label %37
22: ; preds = %16
%23 = sub i32 99998, %17
%24 = add nsw i32 %17, 3
%25 = mul i32 %23, %24
%26 = shl i32 %17, 1
%27 = zext i32 %23 to i33
%28 = sub i32 99997, %17
%29 = zext i32 %28 to i33
%30 = mul i33 %27, %29
%31 = lshr i33 %30, 1
%32 = trunc i33 %31 to i32
%33 = add i32 %19, 3
%34 = add i32 %33, %25
%35 = add i32 %34, %26
%36 = add i32 %35, %32
br label %37
37: ; preds = %22, %16
%38 = phi i32 [ %20, %16 ], [ %36, %22 ]
%39 = phi i32 [ %18, %16 ], [ 100000, %22 ]
store i32 %38, i32* %2
%40 = load i32, i32* @RUSAGE_SELF
%41 = call i32 @getrusage(i32 %40, %struct.rusage* %3)
%42 = load double, double* %12
%43 = load double, double* %13
%44 = fadd double %42, %43
%45 = load i64, i64* %14
%46 = load i64, i64* %15
%47 = insertelement <2 x i64> poison, i64 %45, i64 0
%48 = insertelement <2 x i64> %47, i64 %46, i64 1
%49 = sitofp <2 x i64> %48 to <2 x double>
%50 = fdiv <2 x double> %49, <double 1.000000e+06, double 1.000000e+06>
%51 = extractelement <2 x double> %50, i64 0
%52 = fadd double %44, %51
%53 = extractelement <2 x double> %50, i64 1
%54 = fadd double %52, %53
%55 = fcmp ogt double %54, 5.000000e-01
br i1 %55, label %56, label %16
56: ; preds = %37
%57 = load i32, i32* %2
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %1
%60 = add nsw i32 %59, %6
store i32 %60, i32* %1
%61 = call i32 @exit(i32 0)
unreachable
}