#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 add(unsigned int, unsigned int);
int getByte(unsigned int, unsigned int);
scalar_t__ gt(unsigned int, unsigned int);
scalar_t__ lt(unsigned int, unsigned int);
int mul(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int sub(unsigned int, unsigned int);
int main(int argc, char **argv) {
  unsigned int i, j;
  printf("Enter an integer ");
  scanf("%u", &i);
  printf("\nEnter another integer ");
  scanf("%u", &j);
  printf("\ni + j = %u\n", add(i, j));
  printf("\ni - j = %u\n", sub(i, j));
  printf("\ni * j = %u\n", mul(i, j));
  printf("i > j = %s\n", (gt(i, j) ? "TRUE" : "FALSE"));
  printf("i < j = %s\n", (lt(i, j) ? "TRUE" : "FALSE"));
  printf("jth byte of i = %ux\n", getByte(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe49(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   10a0 <sub@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1080 <mul@plt>
mov    %eax,%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1070 <gt@plt>
mov    %rax,%rcx
lea    0xe2d(%rip),%rsi
lea    0xe21(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1090 <lt@plt>
mov    %rax,%rcx
lea    0xdfb(%rip),%rsi
lea    0xdef(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <getByte@plt>
mov    %eax,%esi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe79(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <add@plt>
lea    0xe5b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   10a0 <sub@plt>
lea    0xe4c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1080 <mul@plt>
lea    0xe3d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1070 <gt@plt>
test   %rax,%rax
lea    0xe3c(%rip),%r14
lea    0xe30(%rip),%rbx
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1090 <lt@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xe0c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <getByte@plt>
lea    0xdfb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter an integer \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [24 x i8] c"\0AEnter another integer \00"
@.str.3 = [13 x i8] c"\0Ai + j = %u\0A\00"
@.str.4 = [13 x i8] c"\0Ai - j = %u\0A\00"
@.str.5 = [13 x i8] c"\0Ai * j = %u\0A\00"
@.str.6 = [12 x i8] c"i > j = %s\0A\00"
@.str.7 = [5 x i8] c"TRUE\00"
@.str.8 = [6 x i8] c"FALSE\00"
@.str.9 = [12 x i8] c"i < j = %s\0A\00"
@.str.10 = [21 x i8] c"jth byte of i = %ux\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @add(i32 %12, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @sub(i32 %16, i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @mul(i32 %20, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = call i64 @gt(i32 %24, i32 %25)
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = call i64 @lt(i32 %31, i32 %32)
%34 = icmp ne i64 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %36)
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = call i32 @getByte(i32 %38, i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter an integer \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [24 x i8] c"\0AEnter another integer \00"
@.str.3 = [13 x i8] c"\0Ai + j = %u\0A\00"
@.str.4 = [13 x i8] c"\0Ai - j = %u\0A\00"
@.str.5 = [13 x i8] c"\0Ai * j = %u\0A\00"
@.str.6 = [12 x i8] c"i > j = %s\0A\00"
@.str.7 = [5 x i8] c"TRUE\00"
@.str.8 = [6 x i8] c"FALSE\00"
@.str.9 = [12 x i8] c"i < j = %s\0A\00"
@.str.10 = [21 x i8] c"jth byte of i = %ux\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @add(i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @sub(i32 %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @mul(i32 %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i64 @gt(i32 %23, i32 %24)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i64 @lt(i32 %29, i32 %30)
%32 = icmp eq i64 %31, 0
%33 = select i1 %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %33)
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = call i32 @getByte(i32 %35, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %37)
ret i32 0
}