#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 EXIT_SUCCESS;
double const fabs(double);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[argc + 1]) {
  printf("argc %d\n%s\n", argc, *argv);
  puts("Hello␣world!");
  if (argc > 1) {
    while (true) {
      puts("some␣programs␣never␣stop");
    }
  } else {
    do {
      puts("but␣this␣one␣does");
    } while (false);
  }
  double const eps = 1E-9;
  double const a = 34.0;
  double x = 0.5;
  while (fabs(1.0 - a * x) >= eps) {
    x *= (2.0 - a * x);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1188 <main+0x58>
jmp    1177 <main+0x47>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
jmp    1177 <main+0x47>
jmp    118d <main+0x5d>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
jmp    119e <main+0x6e>
movsd  0xe6a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe40(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe46(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe42(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <fabs@plt>
movsd  0xe21(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1225 <main+0xf5>
movsd  -0x28(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe16(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11c5 <main+0x95>
mov    0x2db4(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    (%rsi),%rdx
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebx
jl     115a <main+0x3a>
lea    0xecf(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1150 <main+0x30>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"argc %d\0A%s\0A\00"
@.str.1 = [15 x i8] c"Hello\E2\90\A3world!\00"
@.str.2 = [31 x i8] c"some\E2\90\A3programs\E2\90\A3never\E2\90\A3stop\00"
@.str.3 = [24 x i8] c"but\E2\90\A3this\E2\90\A3one\E2\90\A3does\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %14)
%16 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %2
br label %20
20: ; preds = %19, %20
%21 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %20
22: ; preds = %2
br label %23
23: ; preds = %22
%24 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23
br label %26
26: ; preds = %25
store double 1.000000e-09, double* %6
store double 3.400000e+01, double* %7
store double 5.000000e-01, double* %8
br label %27
27: ; preds = %32, %26
%28 = load double, double* %8
%29 = call double @llvm.fmuladd.f64(double -3.400000e+01, double %28, double 1.000000e+00)
%30 = call double @fabs(double %29)
%31 = fcmp oge double %30, 1.000000e-09
br i1 %31, label %32, label %37
32: ; preds = %27
%33 = load double, double* %8
%34 = call double @llvm.fmuladd.f64(double -3.400000e+01, double %33, double 2.000000e+00)
%35 = load double, double* %8
%36 = fmul double %35, %34
store double %36, double* %8
br label %27
37: ; preds = %27
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str = [12 x i8] c"argc %d\0A%s\0A\00"
@.str.1 = [15 x i8] c"Hello\E2\90\A3world!\00"
@.str.2 = [31 x i8] c"some\E2\90\A3programs\E2\90\A3never\E2\90\A3stop\00"
@.str.3 = [24 x i8] c"but\E2\90\A3this\E2\90\A3one\E2\90\A3does\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %9
7: ; preds = %2, %7
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %7
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}