xunge/DecIR huggingface dataset:
/* Variables and functions */
double atan2(double, double);
double GetLineSlope(double dP1_x, double dP1_y, double dP2_x, double dP2_y) {
  return atan2(dP2_y - dP1_y, dP2_x - dP1_x);
}


x86 assembly (clang, -O0):
<GetLineSlope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLineSlope>:
subsd  %xmm1,%xmm3
subsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
movapd %xmm2,%xmm1
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @GetLineSlope(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %8
%10 = load double, double* %6
%11 = fsub double %9, %10
%12 = load double, double* %7
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = call double @atan2(double %11, double %14)
ret double %15
}

LLVM IR (-O2):
define double @GetLineSlope(double %0, double %1, double %2, double %3) {
%5 = fsub double %3, %1
%6 = fsub double %2, %0
%7 = tail call double @atan2(double %5, double %6)
ret double %7
}
void SPIM_TX_ISR(void) {}


x86 assembly (clang, -O0):
<SPIM_TX_ISR>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIM_TX_ISR>:
ret

LLVM IR (-O0):
define void @SPIM_TX_ISR() {
ret void
}

LLVM IR (-O2):
define void @SPIM_TX_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VG_print_translation_stats();
int main(void) {
  VG_print_translation_stats();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <VG_print_translation_stats@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <VG_print_translation_stats@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @VG_print_translation_stats()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @VG_print_translation_stats()
ret i32 0
}
/* Type definitions */
typedef int uint16_t;
typedef int int64_t;

/* Variables and functions */
uint16_t roundToInt16(int64_t f) {
  int r = (f + (1 << 15)) >> 16;
  if (r < -0x7FFF)
    return 0x8000;
  else if (r > 0x7FFF)
    return 0x7FFF;
  else
    return r;
}


x86 assembly (clang, -O0):
<roundToInt16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8000,%eax
sar    $0x10,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xffff8001,-0xc(%rbp)
jge    112e <roundToInt16+0x2e>
movl   $0x8000,-0x4(%rbp)
jmp    114d <roundToInt16+0x4d>
cmpl   $0x7fff,-0xc(%rbp)
jle    1147 <roundToInt16+0x47>
movl   $0x7fff,-0x4(%rbp)
jmp    114d <roundToInt16+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToInt16>:
lea    0x8000(%rdi),%ecx
sar    $0x10,%ecx
cmp    $0x80008000,%edi
mov    $0x8000,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @roundToInt16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 32768
%7 = ashr i32 %6, 16
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, -32767
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 32768, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 32767
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 32767, i32* %2
br label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %14, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @roundToInt16(i32 %0) {
%2 = add nsw i32 %0, 32768
%3 = ashr i32 %2, 16
%4 = icmp slt i32 %0, -2147450880
%5 = select i1 %4, i32 32768, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void main() {
  void *pvoid;
  pvoid++;
  pvoid += 1;
  (char *)pvoid++;
  printf("%d", pvoid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i32 1
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr i8, i8* %4, i64 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* poison)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void user_func() { printf("\n\nCatch a signal SIGINT \n"); }


x86 assembly (clang, -O0):
<user_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_func>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\0ACatch a signal SIGINT \0A\00"
define void @user_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A\0ACatch a signal SIGINT \00"
define void @user_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RunApplicationEventLoop();
int /*<<< orphan*/ x3sync();
void x3main(void) {
  x3sync();
  RunApplicationEventLoop();
}


x86 assembly (clang, -O0):
<x3main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <x3sync@plt>
mov    $0x0,%al
call   1040 <RunApplicationEventLoop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x3main>:
push   %rax
xor    %eax,%eax
call   1030 <x3sync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <RunApplicationEventLoop@plt>

LLVM IR (-O0):
define void @x3main() {
%1 = call i32 (...) @x3sync()
%2 = call i32 (...) @RunApplicationEventLoop()
ret void
}

LLVM IR (-O2):
define void @x3main() {
%1 = tail call i32 (...) @x3sync()
%2 = tail call i32 (...) @RunApplicationEventLoop()
ret void
}
int peekch(int row, int column) {
  return ((short *)0xb8000)[80 * (6 + row) + column];
}


x86 assembly (clang, -O0):
<peekch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6,%eax
imul   $0x50,%eax,%eax
add    -0x8(%rbp),%eax
movslq %eax,%rcx
mov    $0xb8000,%eax
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<peekch>:
lea    (%rdi,%rdi,4),%eax
shl    $0x4,%eax
add    %esi,%eax
add    $0x1e0,%eax
cltq
movswl 0xb8000(%rax,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @peekch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 6, %5
%7 = mul nsw i32 80, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 753664 to i16*), i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @peekch(i32 %0, i32 %1) {
%3 = mul i32 %0, 80
%4 = add i32 %3, 480
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i16, i16* inttoptr (i64 753664 to i16*), i64 %6
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
ret i32 %9
}
void HariMain(void) { *((char *)0x00102600) = 0; }


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x102600,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
movb   $0x0,0x102600
ret

LLVM IR (-O0):
define void @HariMain() {
store i8 0, i8* inttoptr (i64 1058304 to i8*)
ret void
}

LLVM IR (-O2):
define void @HariMain() {
store i8 0, i8* inttoptr (i64 1058304 to i8*)
ret void
}
double limit_angle(double angle) { return angle; }


x86 assembly (clang, -O0):
<limit_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_angle>:
ret

LLVM IR (-O0):
define double @limit_angle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @limit_angle(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  char *name;
  name = malloc(sizeof(char) * 512);
  if (name == NULL) {
    perror("Error on malloc");
    exit(EXIT_FAILURE);
  } else {
    free(name);
  }
  exit(EXIT_SUCCESS);
}


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)
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <main+0x49>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x200,%edi
call   1040 <malloc@plt>
test   %rax,%rax
jne    116a <main+0x2a>
lea    0xea9(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Error on malloc\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 512)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error on malloc\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(512) i8* @malloc(i32 512)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @free(i8* %3)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = tail call i32 @exit(i32 %11)
unreachable
}
int fun413() { return 413; }


x86 assembly (clang, -O0):
<fun413>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun413>:
mov    $0x19d,%eax
ret

LLVM IR (-O0):
define i32 @fun413() {
ret i32 413
}

LLVM IR (-O2):
define i32 @fun413() {
ret i32 413
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int /*<<< orphan*/ printf(char *, ...);
char *strerror(int /*<<< orphan*/);
void processLibRc(int rc) {
  if (!rc) {
    printf("rc=0 AOK...\n");
  } else {
    printf("***RtnCode: %d=>%s\n", rc, strerror(abs(rc)));
  }
  return;
}


x86 assembly (clang, -O0):
<processLibRc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <processLibRc+0x28>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1181 <processLibRc+0x51>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processLibRc>:
test   %edi,%edi
je     1155 <processLibRc+0x25>
push   %rbx
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
lea    0xeb8(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"rc=0 AOK...\0A\00"
@.str.1 = [20 x i8] c"***RtnCode: %d=>%s\0A\00"
define void @processLibRc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @abs(i32 %9)
%11 = call i8* @strerror(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"***RtnCode: %d=>%s\0A\00"
@str = [12 x i8] c"rc=0 AOK...\00"
define void @processLibRc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}
void setupLEDs(void) {
  unsigned long *dirGPIO = (unsigned long *)0x40e0000c;
  unsigned long *mfprGPIO3 = (unsigned long *)0x40e1027c;
  unsigned long *mfprGPIO3_2 = (unsigned long *)0x40e102e0;
  unsigned long *mfprGPIO5 = (unsigned long *)0x40e10284;
  unsigned long *mfprGPIO5_2 = (unsigned long *)0x40e102e8;
  *dirGPIO |= 0x28;
  *mfprGPIO3 = 0x0844;
  *mfprGPIO5 = 0x0844;
  *mfprGPIO3_2 = 0x8C40;
  *mfprGPIO5_2 = 0x8C40;
}


x86 assembly (clang, -O0):
<setupLEDs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40e0000c,%eax
mov    %rax,-0x8(%rbp)
mov    $0x40e1027c,%eax
mov    %rax,-0x10(%rbp)
mov    $0x40e102e0,%eax
mov    %rax,-0x18(%rbp)
mov    $0x40e10284,%eax
mov    %rax,-0x20(%rbp)
mov    $0x40e102e8,%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x28,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x844,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x844,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x8c40,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x8c40,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupLEDs>:
orb    $0x28,0x40e0000c
28
movq   $0x844,0x40e1027c
movq   $0x844,0x40e10284
movq   $0x8c40,0x40e102e0
movq   $0x8c40,0x40e102e8
ret

LLVM IR (-O0):
define void @setupLEDs() {
%1 = alloca i64*
%2 = alloca i64*
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64*
store i64* inttoptr (i64 1088421900 to i64*), i64** %1
store i64* inttoptr (i64 1088488060 to i64*), i64** %2
store i64* inttoptr (i64 1088488160 to i64*), i64** %3
store i64* inttoptr (i64 1088488068 to i64*), i64** %4
store i64* inttoptr (i64 1088488168 to i64*), i64** %5
%6 = load i64*, i64** %1
%7 = load i64, i64* %6
%8 = or i64 %7, 40
store i64 %8, i64* %6
%9 = load i64*, i64** %2
store i64 2116, i64* %9
%10 = load i64*, i64** %4
store i64 2116, i64* %10
%11 = load i64*, i64** %3
store i64 35904, i64* %11
%12 = load i64*, i64** %5
store i64 35904, i64* %12
ret void
}

LLVM IR (-O2):
define void @setupLEDs() {
%1 = load i64, i64* inttoptr (i64 1088421900 to i64*)
%2 = or i64 %1, 40
store i64 %2, i64* inttoptr (i64 1088421900 to i64*)
store i64 2116, i64* inttoptr (i64 1088488060 to i64*)
store i64 2116, i64* inttoptr (i64 1088488068 to i64*)
store i64 35904, i64* inttoptr (i64 1088488160 to i64*)
store i64 35904, i64* inttoptr (i64 1088488168 to i64*)
ret void
}
/* Variables and functions */
int maxArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int height[] = {1, 1};
  printf("%d\n", maxArea(height, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
call   1040 <maxArea@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x100000001,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1040 <maxArea@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.height = [2 x i32] [i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @maxArea(i32* %4, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 4294967297, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @maxArea(i32* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_uint64_t(uint64_t *const dest, uint64_t const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_COPY_uint64_t>:
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_COPY_uint64_t(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store i32 %5, i32* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_uint64_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test();
void main() {
  if (test())
    printf("OK !\n");
  else
    printf("No Ok !\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test@plt>
cmp    $0x0,%rax
je     1146 <main+0x26>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <main+0x32>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xecf(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"OK !\0A\00"
@.str.1 = [9 x i8] c"No Ok !\0A\00"
define void @main() {
%1 = call i64 (...) @test()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"No Ok !\00"
@str.2 = [5 x i8] c"OK !\00"
define void @main() {
%1 = tail call i64 (...) @test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LINES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2f(float, float);
void drawLine(float x1, float y1, float x2, float y2) {
  glBegin(GL_LINES);
  glVertex2f(x1, y1);
  glVertex2f(x2, y2);
  glEnd();
}


x86 assembly (clang, -O0):
<drawLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glVertex2f@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawLine>:
sub    $0x18,%rsp
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <glVertex2f@plt>
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1040 <glVertex2f@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @drawLine(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load i32, i32* @GL_LINES
%10 = call i32 @glBegin(i32 %9)
%11 = load float, float* %5
%12 = load float, float* %6
%13 = call i32 @glVertex2f(float %11, float %12)
%14 = load float, float* %7
%15 = load float, float* %8
%16 = call i32 @glVertex2f(float %14, float %15)
%17 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @drawLine(float %0, float %1, float %2, float %3) {
%5 = load i32, i32* @GL_LINES
%6 = tail call i32 @glBegin(i32 %5)
%7 = tail call i32 @glVertex2f(float %0, float %1)
%8 = tail call i32 @glVertex2f(float %2, float %3)
%9 = tail call i32 (...) @glEnd()
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t sub(int32_t reg1, int32_t reg2) { return (reg1 - reg2); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @sub(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @sub(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
void boil(int **x, int *p) { *x = p; }


x86 assembly (clang, -O0):
<boil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<boil>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @boil(i32** %0, i32* %1) {
%3 = alloca i32**
%4 = alloca i32*
store i32** %0, i32*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32**, i32*** %3
store i32* %5, i32** %6
ret void
}

LLVM IR (-O2):
define void @boil(i32** nocapture writeonly %0, i32* %1) {
store i32* %1, i32** %0
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
uint32_t fget32_(FILE *fp) {
  uint32_t v = fgetc(fp) << 24;
  v |= fgetc(fp) << 16;
  v |= fgetc(fp) << 8;
  v |= fgetc(fp);
  return v;
}


x86 assembly (clang, -O0):
<fget32_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget32_>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x18,%ebp
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %r14,%rdi
call   1030 <fgetc@plt>
or     %ebp,%eax
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fget32_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = shl i32 %5, 24
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @fgetc(i32* %7)
%9 = shl i32 %8, 16
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = call i32 @fgetc(i32* %12)
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @fgetc(i32* %17)
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @fget32_(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = shl i32 %2, 24
%4 = tail call i32 @fgetc(i32* %0)
%5 = shl i32 %4, 16
%6 = or i32 %5, %3
%7 = tail call i32 @fgetc(i32* %0)
%8 = shl i32 %7, 8
%9 = or i32 %6, %8
%10 = tail call i32 @fgetc(i32* %0)
%11 = or i32 %9, %10
ret i32 %11
}
ol(ptr) char ptr[];
{
  ot(ptr);
  nl();
}


x86 assembly (clang, -O0):
<ol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ol>:
push   %rax
xor    %eax,%eax
call   1040 <ot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
define i32 @ol(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (...) @nl()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @ol(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @nl()
ret i32 undef
}
float dot_product_f(float *p1, float *p2) {
  return p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2];
}


x86 assembly (clang, -O0):
<dot_product_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product_f>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dot_product_f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @dot_product_f(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
float powf(float, float);
float db2lin(float db) { return powf(10.0f, 0.05f * db); }


x86 assembly (clang, -O0):
<db2lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xece(%rip),%xmm0
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db2lin>:
movaps %xmm0,%xmm1
mulss  0xee5(%rip),%xmm1
movss  0xee1(%rip),%xmm0
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @db2lin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x3FA99999A0000000, %3
%5 = call float @powf(float 1.000000e+01, float %4)
ret float %5
}

LLVM IR (-O2):
define float @db2lin(float %0) {
%2 = fmul float %0, 0x3FA99999A0000000
%3 = tail call float @powf(float 1.000000e+01, float %2)
ret float %3
}
int f1(int x, int y, int z) {
  if (x > 100) {
    x++;
    z = -z;
  } else {
    x = -x;
    y = -y;
  }
  return x + y + z;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    112d <f1+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <f1+0x3d>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%r8d
mov    %edx,%r9d
neg    %r9d
mov    %edi,%ecx
neg    %ecx
mov    %esi,%eax
neg    %eax
cmp    $0x65,%edi
cmovge %r8d,%ecx
cmovge %esi,%eax
cmovl  %edx,%r9d
add    %ecx,%eax
add    %r9d,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 100
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load i32, i32* %6
%13 = sub nsw i32 0, %12
store i32 %13, i32* %6
br label %19
14: ; preds = %3
%15 = load i32, i32* %4
%16 = sub nsw i32 0, %15
store i32 %16, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 0, %17
store i32 %18, i32* %5
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 100
%5 = add nsw i32 %0, 1
%6 = sub nsw i32 0, %2
%7 = sub nsw i32 0, %0
%8 = sub nsw i32 0, %1
%9 = select i1 %4, i32 %5, i32 %7
%10 = select i1 %4, i32 %1, i32 %8
%11 = select i1 %4, i32 %6, i32 %2
%12 = add nsw i32 %9, %10
%13 = add nsw i32 %12, %11
ret i32 %13
}
void dummy_raise_window(int id) { id = id; }


x86 assembly (clang, -O0):
<dummy_raise_window>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_raise_window>:
ret

LLVM IR (-O0):
define void @dummy_raise_window(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @dummy_raise_window(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  printf("Vnesete golema bukva: ");
  scanf("%c", &c);
  printf("%c malo se pishuva: '%c'\n", c, c + ('a' - 'A'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
add    $0x20,%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0x20(%rsi),%edx
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Vnesete golema bukva: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [26 x i8] c"%c malo se pishuva: '%c'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Vnesete golema bukva: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [26 x i8] c"%c malo se pishuva: '%c'\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int is_dir(const char *pathname) {
  struct stat buf;
  if (stat(pathname, &buf) == -1)
    return 0;
  return S_ISDIR(buf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <is_dir+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_dir+0x39>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
struct prior {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ priorlist_done(struct prior **);
void supporting_auxmem_done(struct prior **pPP, struct prior **pPP_store) {
  priorlist_done(pPP);
  priorlist_done(pPP_store);
  return;
}


x86 assembly (clang, -O0):
<supporting_auxmem_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <priorlist_done@plt>
mov    -0x10(%rbp),%rdi
call   1030 <priorlist_done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supporting_auxmem_done>:
push   %rbx
mov    %rsi,%rbx
call   1030 <priorlist_done@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <priorlist_done@plt>

LLVM IR (-O0):
%struct.prior = type { i32 }
define void @supporting_auxmem_done(%struct.prior** %0, %struct.prior** %1) {
%3 = alloca %struct.prior**
%4 = alloca %struct.prior**
store %struct.prior** %0, %struct.prior*** %3
store %struct.prior** %1, %struct.prior*** %4
%5 = load %struct.prior**, %struct.prior*** %3
%6 = call i32 @priorlist_done(%struct.prior** %5)
%7 = load %struct.prior**, %struct.prior*** %4
%8 = call i32 @priorlist_done(%struct.prior** %7)
ret void
}

LLVM IR (-O2):
%struct.prior = type { i32 }
define void @supporting_auxmem_done(%struct.prior** %0, %struct.prior** %1) {
%3 = tail call i32 @priorlist_done(%struct.prior** %0)
%4 = tail call i32 @priorlist_done(%struct.prior** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void tiny_usleep(int usecond) { usleep(usecond); }


x86 assembly (clang, -O0):
<tiny_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiny_usleep>:
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @tiny_usleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @usleep(i32 %3)
ret void
}

LLVM IR (-O2):
define void @tiny_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_distance(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void forward_mm(unsigned int speed, unsigned int distance) {
  motion_direction(0b00000110);
  speed_control(speed, speed);
  cal_distance(distance);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<forward_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
call   1030 <cal_distance@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward_mm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x6,%edi
call   1040 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1060 <speed_control@plt>
mov    %ebx,%edi
call   1030 <cal_distance@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @forward_mm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 6)
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @cal_distance(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @forward_mm(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 6)
%4 = tail call i32 @speed_control(i32 %0, i32 %0)
%5 = tail call i32 @cal_distance(i32 %1)
%6 = tail call i32 @_delay_us(i32 10)
ret void
}
void test76_ArrNoDim_targetInit__I() {}


x86 assembly (clang, -O0):
<test76_ArrNoDim_targetInit__I>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test76_ArrNoDim_targetInit__I>:
ret

LLVM IR (-O0):
define void @test76_ArrNoDim_targetInit__I() {
ret void
}

LLVM IR (-O2):
define void @test76_ArrNoDim_targetInit__I() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
void ignore_ssize(ssize_t ignored) { (void)ignored; }


x86 assembly (clang, -O0):
<ignore_ssize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_ssize>:
ret

LLVM IR (-O0):
define void @ignore_ssize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @ignore_ssize(i32 %0) {
ret void
}
int msg_bytes2S32(char *str) {
  return (int)((0xff & str[0]) | ((0xff & str[1]) << 8) |
               ((0xff & str[2]) << 16) | ((0xff & str[3]) << 24));
}


x86 assembly (clang, -O0):
<msg_bytes2S32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_bytes2S32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @msg_bytes2S32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 255, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 255, %11
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 255, %18
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = and i32 255, %25
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @msg_bytes2S32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void test___atomic_fetch_add_1(short *mem) { __atomic_fetch_add(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_add_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%ax
lock xadd %ax,(%rcx)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_add_1>:
lock addw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_add_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw add i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_add_1(i16* nocapture %0) {
%2 = atomicrmw add i16* %0, i16 1 acq_rel
ret void
}
void handle_51(int sig) {}


x86 assembly (clang, -O0):
<handle_51>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_51>:
ret

LLVM IR (-O0):
define void @handle_51(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @handle_51(i32 %0) {
ret void
}
int is_underl(int ch) {
  if (ch == ' ' || ch == '\t' || ch == '!' || ch == ',' || ch == '.' ||
      ch == ';' || ch == ':')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<is_underl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x9,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x21,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x2c,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x2e,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x3b,-0x8(%rbp)
je     114d <is_underl+0x4d>
cmpl   $0x3a,-0x8(%rbp)
jne    1159 <is_underl+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1160 <is_underl+0x60>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_underl>:
cmp    $0x3b,%edi
ja     111a <is_underl+0x1a>
xor    %eax,%eax
mov    %edi,%ecx
movabs $0xc00500300000200,%rdx
bt     %rcx,%rdx
jae    111a <is_underl+0x1a>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_underl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 9
br i1 %8, label %24, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 33
br i1 %11, label %24, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 44
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 46
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 59
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 58
br i1 %23, label %24, label %25
24: ; preds = %21, %18, %15, %12, %9, %6, %1
store i32 0, i32* %2
br label %26
25: ; preds = %21
store i32 1, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @is_underl(i32 %0) {
switch i32 %0, label %2 [
i32 59, label %3
i32 58, label %3
i32 46, label %3
i32 44, label %3
i32 33, label %3
i32 32, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}