xunge/DecIR huggingface dataset:
const char *type_name(unsigned short t) {
  if (t)
    return "USHRT";
  else
    return "unsigned short";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
cmpw   $0x0,-0xa(%rbp)
je     1126 <type_name+0x26>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <type_name+0x31>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %edi,%edi
lea    0xefd(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"USHRT\00"
@.str.1 = [15 x i8] c"unsigned short\00"
define i8* @type_name(i16 zeroext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"USHRT\00"
@.str.1 = [15 x i8] c"unsigned short\00"
define i8* @type_name(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, char);
void printEntry(char encoding, int value) {
  printf("%d, // %d=%c\n", encoding, value, encoding);
}


x86 assembly (clang, -O0):
<printEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x1(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printEntry>:
mov    %esi,%edx
mov    %edi,%ecx
lea    0xee5(%rip),%rdi
mov    %ecx,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d, // %d=%c\0A\00"
define void @printEntry(i8 signext %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %1, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_copy(char *, char const *);
void str_cat(char *restrict sd, const char *restrict sc) {
  while (*sd)
    sd++;
  str_copy(sd, sc);
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <str_cat+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <str_cat+0x10>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <str_copy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <str_cat+0x10>
jmp    1030 <str_copy@plt>

LLVM IR (-O0):
define void @str_cat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @str_copy(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
define void @str_cat(i8* noalias %0, i8* noalias %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @str_copy(i8* %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ sqrt(double);
int main(void) {
  double x = 0;
  printf("请输入正方形面积: ");
  scanf("%lf", &x);
  printf("%.2lf\n", sqrt(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%esi
lea    0xea7(%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
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <sqrt@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E6\AD\A3\E6\96\B9\E5\BD\A2\E9\9D\A2\E7\A7\AF: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 @sqrt(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E6\AD\A3\E6\96\B9\E5\BD\A2\E9\9D\A2\E7\A7\AF: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @sqrt(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_path();
void test_5(void) {
  for (int i = 0; i < 1024; i++) {
  }
  __analyzer_dump_path();
}


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    113f <test_5+0x2f>
jmp    1131 <test_5+0x21>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_5+0xf>
mov    $0x0,%al
call   1030 <__analyzer_dump_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
xor    %eax,%eax
jmp    1030 <__analyzer_dump_path@plt>

LLVM IR (-O0):
define void @test_5() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1024
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (...) @__analyzer_dump_path()
ret void
}

LLVM IR (-O2):
define void @test_5() {
%1 = tail call i32 (...) @__analyzer_dump_path()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_puts(char *);
void print_interrupted() { lcd_puts("Interrupted.\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Interrupted.\0A\00"
define void @print_interrupted() {
%1 = call i32 @lcd_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Interrupted.\0A\00"
define void @print_interrupted() {
%1 = tail call i32 @lcd_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_fail_expect_fail(void *setup_ctxt) {
  printf("  (c) test_fail_expect_fail\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_fail_expect_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fail_expect_fail>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c" (c) test_fail_expect_fail\0A\00"
define i32 @test_fail_expect_fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c" (c) test_fail_expect_fail\00"
define i32 @test_fail_expect_fail(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float powf(float, double);
float sqrtf(float x) { return powf(x, 0.5); }


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

x86 assembly (clang, -O2):
<sqrtf>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @powf(float %3, double 5.000000e-01)
ret float %4
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = tail call float @powf(float %0, double 5.000000e-01)
ret float %2
}
void large(int a) {
  ((0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (a++) + (a++) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0));
  ((0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (a++) + (a++) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0));
  ((0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0) +
   (0) + (a++) + (a++) + (0) + (0) + (0) + (0) + (0) + (0) + (0) + (0));
}


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

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

LLVM IR (-O0):
define void @large(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = add nsw i32 0, %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = add nsw i32 %5, %6
%9 = add nsw i32 %8, 0
%10 = add nsw i32 %9, 0
%11 = add nsw i32 %10, 0
%12 = add nsw i32 %11, 0
%13 = add nsw i32 %12, 0
%14 = add nsw i32 %13, 0
%15 = add nsw i32 %14, 0
%16 = add nsw i32 %15, 0
%17 = add nsw i32 %16, 0
%18 = add nsw i32 %17, 0
%19 = add nsw i32 %18, 0
%20 = add nsw i32 %19, 0
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
%23 = add nsw i32 0, %21
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = add nsw i32 %23, %24
%27 = add nsw i32 %26, 0
%28 = add nsw i32 %27, 0
%29 = add nsw i32 %28, 0
%30 = add nsw i32 %29, 0
%31 = add nsw i32 %30, 0
%32 = add nsw i32 %31, 0
%33 = add nsw i32 %32, 0
%34 = add nsw i32 %33, 0
%35 = add nsw i32 %34, 0
%36 = add nsw i32 %35, 0
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
%39 = add nsw i32 0, %37
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
%42 = add nsw i32 %39, %40
%43 = add nsw i32 %42, 0
%44 = add nsw i32 %43, 0
%45 = add nsw i32 %44, 0
%46 = add nsw i32 %45, 0
%47 = add nsw i32 %46, 0
%48 = add nsw i32 %47, 0
%49 = add nsw i32 %48, 0
%50 = add nsw i32 %49, 0
ret void
}

LLVM IR (-O2):
define void @large(i32 %0) {
ret void
}
unsigned int blz_workmem_size(unsigned int length) { return (1024 * 1024); }


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

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

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

LLVM IR (-O2):
define i32 @blz_workmem_size(i32 %0) {
ret i32 1048576
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct client *);
void client_release(struct client *c) { free(c); }


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

x86 assembly (clang, -O2):
<client_release>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
define void @client_release(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
%3 = load %struct.client*, %struct.client** %2
%4 = call i32 @free(%struct.client* %3)
ret void
}

LLVM IR (-O2):
%struct.client = type { i32 }
define void @client_release(%struct.client* nocapture %0) {
%2 = tail call i32 @free(%struct.client* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
int rl_delete_wal(const char *wal_path) {
  unlink(wal_path);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @rl_delete_wal(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 0
}
int main(int argc, char **argv) { return argc * argc; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = mul nsw i32 %0, %0
ret i32 %3
}
/* Variables and functions */
char *_resposta_padrao(int, int, char *);
char *BloquearSAT(int sessao, char *codigo_ativacao) {
  return _resposta_padrao(sessao, 16000,
                          "Equipamento SAT bloqueado com sucesso");
}


x86 assembly (clang, -O0):
<BloquearSAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3e80,%esi
lea    0xed2(%rip),%rdx
call   1030 <_resposta_padrao@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BloquearSAT>:
lea    0xee9(%rip),%rdx
mov    $0x3e80,%esi
jmp    1030 <_resposta_padrao@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Equipamento SAT bloqueado com sucesso\00"
define i8* @BloquearSAT(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @_resposta_padrao(i32 %5, i32 16000, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}

LLVM IR (-O2):
@.str = [38 x i8] c"Equipamento SAT bloqueado com sucesso\00"
define i8* @BloquearSAT(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @_resposta_padrao(i32 %0, i32 16000, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *trace_open_map(char *mapname, long *preloc) { return NULL; }


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

x86 assembly (clang, -O2):
<trace_open_map>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @trace_open_map(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @trace_open_map(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32* null
}
int test_imm_91uint8_reg(unsigned char val) {
  return ((val) & (0x91 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_91uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x91,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_91uint8_reg>:
test   $0x91,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_91uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 145
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_91uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -111
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_isgraph(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isgraph(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isgraph+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isgraph@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isgraph+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isgraph>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isgraph@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isgraph+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isgraph = [13 x i8] c"test_isgraph\00"
define void @test_isgraph() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isgraph(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isgraph, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isgraph = [13 x i8] c"test_isgraph\00"
define void @test_isgraph() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isgraph(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isgraph, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ cplIsSpace(char);
char *cplSkipSpaces(char *p) {
  while (cplIsSpace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<cplSkipSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <cplIsSpace@plt>
cmp    $0x0,%rax
je     1143 <cplSkipSpaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <cplSkipSpaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cplSkipSpaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <cplIsSpace@plt>
test   %rax,%rax
jne    1120 <cplSkipSpaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cplSkipSpaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @cplIsSpace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @cplSkipSpaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @cplIsSpace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int is_valid_operator(const char ch) {
  if (ch == '*' || ch == '/' || ch == '+' || ch == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     113e <is_valid_operator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     113e <is_valid_operator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     113e <is_valid_operator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    114a <is_valid_operator+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_valid_operator+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_operator>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x5,%dil
ja     111a <is_valid_operator+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_valid_operator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 43
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@switch.table.is_valid_operator = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @is_valid_operator(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.is_valid_operator, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void initRandomSeed(unsigned seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<initRandomSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @initRandomSeed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
int fn1(int p1, int p2) { return p1 > 2147483647 - p2 ? p1 : p1 + p2; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7fffffff,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    1128 <fn1+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <fn1+0x31>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    $0x7fffffff,%ecx
sub    %esi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
cmovge %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn1(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 = load i32, i32* %4
%7 = sub nsw i32 2147483647, %6
%8 = icmp sgt i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
br label %15
15: ; preds = %11, %9
%16 = phi i32 [ %10, %9 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = sub nsw i32 2147483647, %1
%4 = icmp slt i32 %3, %0
%5 = select i1 %4, i32 0, i32 %1
%6 = add nsw i32 %5, %0
ret i32 %6
}
void ARGBAttenuateRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAttenuateRow_AVX2() {
ret void
}
int get_cconst(char *str, char *delim) {
  if (*str != '\'')
    return (-3);
  if (*(str + 2) != '\'')
    return (-3);
  if (delim - str != 3)
    return (-3);
  return (*(str + 1));
  return 0;
}


x86 assembly (clang, -O0):
<get_cconst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     1128 <get_cconst+0x28>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1171 <get_cconst+0x71>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x27,%eax
je     1145 <get_cconst+0x45>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1171 <get_cconst+0x71>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x3,%rax
je     1166 <get_cconst+0x66>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1171 <get_cconst+0x71>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cconst>:
mov    $0xfffffffd,%eax
cmpb   $0x27,(%rdi)
jne    111d <get_cconst+0x1d>
sub    %rdi,%rsi
cmp    $0x3,%rsi
jne    111d <get_cconst+0x1d>
cmpb   $0x27,0x2(%rdi)
jne    111d <get_cconst+0x1d>
movsbl 0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_cconst(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 39
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -3, i32* %3
br label %31
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 39
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 -3, i32* %3
br label %31
18: ; preds = %11
%19 = load i8*, i8** %5
%20 = load i8*, i8** %4
%21 = ptrtoint i8* %19 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
%24 = icmp ne i64 %23, 3
br i1 %24, label %25, label %26
25: ; preds = %18
store i32 -3, i32* %3
br label %31
26: ; preds = %18
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
store i32 %30, i32* %3
br label %31
31: ; preds = %26, %25, %17, %10
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @get_cconst(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 39
br i1 %4, label %5, label %18
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 39
%9 = ptrtoint i8* %1 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = icmp eq i64 %11, 3
%13 = and i1 %12, %8
br i1 %13, label %14, label %18
14: ; preds = %5
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %5, %2, %14
%19 = phi i32 [ %17, %14 ], [ -3, %2 ], [ -3, %5 ]
ret i32 %19
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randto(int r) {
  if (r == 0)
    return 0;
  int x;
  do {
    x = rand();
  } while (x >= r * (int)(RAND_MAX / r));
  return x / (int)(RAND_MAX / r);
}


x86 assembly (clang, -O0):
<randto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <randto+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1184 <randto+0x74>
jmp    1136 <randto+0x26>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
cmp    %ecx,%eax
jge    1136 <randto+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randto>:
test   %edi,%edi
je     1155 <randto+0x45>
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec7(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    (%r14),%eax
cltd
idiv   %ebx
mov    %eax,%esi
imul   %ebx,%eax
cmp    %eax,%ecx
jge    1130 <randto+0x20>
mov    %ecx,%eax
cltd
idiv   %esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %25
8: ; preds = %1
br label %9
9: ; preds = %11, %8
%10 = call i32 (...) @rand()
store i32 %10, i32* %4
br label %11
11: ; preds = %9
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* @RAND_MAX
%15 = load i32, i32* %3
%16 = sdiv i32 %14, %15
%17 = mul nsw i32 %13, %16
%18 = icmp sge i32 %12, %17
br i1 %18, label %9, label %19
19: ; preds = %11
%20 = load i32, i32* %4
%21 = load i32, i32* @RAND_MAX
%22 = load i32, i32* %3
%23 = sdiv i32 %21, %22
%24 = sdiv i32 %20, %23
store i32 %24, i32* %2
br label %25
25: ; preds = %19, %7
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randto(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = tail call i32 (...) @rand()
%5 = load i32, i32* @RAND_MAX
%6 = sdiv i32 %5, %0
%7 = mul nsw i32 %6, %0
%8 = icmp slt i32 %4, %7
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = sdiv i32 %4, %6
br label %11
11: ; preds = %1, %9
%12 = phi i32 [ %10, %9 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 1;
  while (i <= 100) {
    printf("*");
    if (i++ % 10 == 0)
      printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1169 <main+0x59>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x54>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    $0x1,%r14b
jmp    112c <main+0x1c>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
add    $0x1,%r14b
cmp    $0xffffff9c,%ebx
je     1160 <main+0x50>
movzbl %r14b,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%ebp
neg    %ebp
mov    $0x2a,%edi
call   1030 <putchar@plt>
or     $0x1,%bpl
cmp    %bl,%bpl
jne    1120 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = srem i32 %8, 10
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %10
%2 = phi i32 [ 1, %0 ], [ %4, %10 ]
%3 = tail call i32 @putchar(i32 42)
%4 = add nuw nsw i32 %2, 1
%5 = trunc i32 %2 to i8
%6 = urem i8 %5, 10
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @putchar(i32 10)
br label %10
10: ; preds = %8, %1
%11 = icmp eq i32 %4, 101
br i1 %11, label %12, label %1
12: ; preds = %10
ret i32 0
}
void foo321() {}


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

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

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

LLVM IR (-O2):
define void @foo321() {
ret void
}
/* Variables and functions */
int BIO_socket_ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ FIONBIO;
int BIO_socket_nbio(int s, int mode) {
  int ret = -1;
  int l;
  l = mode;
  ret = BIO_socket_ioctl(s, FIONBIO, &l);
  return (ret == 0);
}


x86 assembly (clang, -O0):
<BIO_socket_nbio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <BIO_socket_ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_socket_nbio>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <BIO_socket_ioctl@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define i32 @BIO_socket_nbio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %3
%9 = load i32, i32* @FIONBIO
%10 = call i32 @BIO_socket_ioctl(i32 %8, i32 %9, i32* %6)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define i32 @BIO_socket_nbio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %1, i32* %3
%5 = load i32, i32* @FIONBIO
%6 = call i32 @BIO_socket_ioctl(i32 %0, i32 %5, i32* %3)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void normal_target_post_startup_inferior(int pid) {}


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

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

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

LLVM IR (-O2):
define void @normal_target_post_startup_inferior(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintHead(void) {
  printf("PiJockey version %x.%x\r\n", 0x00, 0x03);
  printf("build %s\r\n", "Mar 15 2022");
}


x86 assembly (clang, -O0):
<PrintHead>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHead>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"PiJockey version %x.%x\0D\0A\00"
@.str.1 = [11 x i8] c"build %s\0D\0A\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define void @PrintHead() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"PiJockey version %x.%x\0D\0A\00"
@.str.1 = [11 x i8] c"build %s\0D\0A\00"
@.str.2 = [12 x i8] c"Mar 15 2022\00"
define void @PrintHead() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int clipi(int v, int min, int max) {
  if (v < min)
    return min;
  if (v > max)
    return max;
  return v;
}


x86 assembly (clang, -O0):
<clipi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clipi+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clipi+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clipi+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clipi+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipi>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clipi(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
struct struct_dll2 {
  int dummy;
};

/* Variables and functions */
struct struct_dll2 *get_struct_dll2();
int /*<<< orphan*/ printf(char *);
struct struct_dll2 *get_struct_dll2_stub() {
  printf("get_struct_dll2_stub\n");
  return get_struct_dll2();
}


x86 assembly (clang, -O0):
<get_struct_dll2_stub>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_struct_dll2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_struct_dll2_stub>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_struct_dll2@plt>

LLVM IR (-O0):
%struct.struct_dll2 = type { i32 }
@.str = [22 x i8] c"get_struct_dll2_stub\0A\00"
define %struct.struct_dll2* @get_struct_dll2_stub() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call %struct.struct_dll2* (...) @get_struct_dll2()
ret %struct.struct_dll2* %2
}

LLVM IR (-O2):
%struct.struct_dll2 = type { i32 }
@str = [21 x i8] c"get_struct_dll2_stub\00"
define %struct.struct_dll2* @get_struct_dll2_stub() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call %struct.struct_dll2* (...) @get_struct_dll2()
ret %struct.struct_dll2* %2
}
int test_imm_36int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x36,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_36int64_midword_mem>:
testb  $0x36,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_36int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 54
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_36int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3538944
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __main_void();
__attribute__((weak)) int __original_main(void) { return __main_void(); }


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

x86 assembly (clang, -O2):
<__original_main>:
xor    %eax,%eax
jmp    1030 <__main_void@plt>

LLVM IR (-O0):
define weak i32 @__original_main() {
%1 = call i32 (...) @__main_void()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @__original_main() {
%1 = tail call i32 (...) @__main_void()
ret i32 %1
}
/* Variables and functions */
int isPalindrom(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[100];
  scanf("%s", word);
  printf("%d \n", isPalindrom(word));
  return isPalindrom(word);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <isPalindrom@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <isPalindrom@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <isPalindrom@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <isPalindrom@plt>
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @isPalindrom(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @isPalindrom(i8* %2)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t eqtohuint32(const uint8_t *data) {
  return (uint32_t)((data[0] << 24) | (data[1] << 16) | (data[2] << 8) |
                    data[3]);
}


x86 assembly (clang, -O0):
<eqtohuint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqtohuint32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @eqtohuint32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}