xunge/DecIR huggingface dataset:
/* Variables and functions */
int myc();
int mycxx();
int main() { return myc() + mycxx(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <myc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <mycxx@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @myc()
%3 = call i32 (...) @mycxx()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myc()
%2 = tail call i32 (...) @mycxx()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int x;
  srand(time(NULL));
  x = rand() % 6 + 1;
  printf("Congratulations, you rolled a %d!\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Congratulations, you rolled a %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Congratulations, you rolled a %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void caml_js_assoc_set() {
  fprintf(stderr, "Unimplemented Javascript primitive %s!\n",
          "caml_js_assoc_set");
  exit(1);
}


x86 assembly (clang, -O0):
<caml_js_assoc_set>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xeed(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_assoc_set>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef0(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Unimplemented Javascript primitive %s!\0A\00"
@.str.1 = [18 x i8] c"caml_js_assoc_set\00"
define void @caml_js_assoc_set() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Unimplemented Javascript primitive %s!\0A\00"
@.str.1 = [18 x i8] c"caml_js_assoc_set\00"
define void @caml_js_assoc_set() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
long get_table_index(char *, char *, char *, char *);
long get_series_index(char *seriesname) {
  return get_table_index(seriesname, "series", "seriesid", "seriesname");
}


x86 assembly (clang, -O0):
<get_series_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xedb(%rip),%rcx
call   1030 <get_table_index@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_series_index>:
lea    0xee9(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xeeb(%rip),%rcx
jmp    1030 <get_table_index@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"series\00"
@.str.1 = [9 x i8] c"seriesid\00"
@.str.2 = [11 x i8] c"seriesname\00"
define i64 @get_series_index(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @get_table_index(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"series\00"
@.str.1 = [9 x i8] c"seriesid\00"
@.str.2 = [11 x i8] c"seriesname\00"
define i64 @get_series_index(i8* %0) {
%2 = tail call i64 @get_table_index(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ dtzscal_(char *, int *, int *, int *, double *, double *,
                            int *);
void wcc_dtzscal_(char *UPLO, int *M, int *N, int *IOFFD, char *ALPHA, char *A,
                  int *LDA) {
  dtzscal_(UPLO, M, N, IOFFD, (double *)ALPHA, (double *)A, LDA);
}


x86 assembly (clang, -O0):
<wcc_dtzscal_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dtzscal_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dtzscal_>:
jmp    1030 <dtzscal_@plt>

LLVM IR (-O0):
define void @wcc_dtzscal_(i8* %0, i32* %1, i32* %2, i32* %3, i8* %4, i8* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
store i8* %0, i8** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = load i32*, i32** %11
%19 = load i8*, i8** %12
%20 = bitcast i8* %19 to double*
%21 = load i8*, i8** %13
%22 = bitcast i8* %21 to double*
%23 = load i32*, i32** %14
%24 = call i32 @dtzscal_(i8* %15, i32* %16, i32* %17, i32* %18, double* %20, double* %22, i32* %23)
ret void
}

LLVM IR (-O2):
define void @wcc_dtzscal_(i8* %0, i32* %1, i32* %2, i32* %3, i8* %4, i8* %5, i32* %6) {
%8 = bitcast i8* %4 to double*
%9 = bitcast i8* %5 to double*
%10 = tail call i32 @dtzscal_(i8* %0, i32* %1, i32* %2, i32* %3, double* %8, double* %9, i32* %6)
ret void
}
/* Variables and functions */
long fib(int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int n = 0;
  long f = 0;
  scanf("%d", &n);
  f = fib(n);
  printf("%ld", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xea4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1050 <fib@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i64 @fib(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %7)
ret i32 0
}
int main() {
  char buf[1000];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
add    $0x370,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void write_le(unsigned char *ptr, int v) {
  ptr[0] = v & 0xFF;
  ptr[1] = (v >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<write_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @write_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @write_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ DumpLong(long, int /*<<< orphan*/ *);
void DumpDouble(double f, FILE *D) {
  long *l = (long *)&f;
  int x = 1;
  if (*(char *)&x == 1) {
    DumpLong(l[1], D);
    DumpLong(l[0], D);
  } else {
    DumpLong(l[0], D);
    DumpLong(l[1], D);
  }
}


x86 assembly (clang, -O0):
<DumpDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x1,%eax
jne    1163 <DumpDouble+0x53>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DumpLong@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DumpLong@plt>
jmp    1184 <DumpDouble+0x74>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DumpLong@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DumpLong@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpDouble>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rsi
call   1030 <DumpLong@plt>
movq   0x8(%rsp),%xmm0
movq   %xmm0,%rdi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <DumpLong@plt>

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

LLVM IR (-O2):
define void @DumpDouble(double %0, i32* %1) {
%3 = tail call i32 @DumpLong(i64 poison, i32* %1)
%4 = bitcast double %0 to i64
%5 = tail call i32 @DumpLong(i64 %4, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure();
void tabort(void) {
  extern void abort(void);
  abort();
  link_failure();
}


x86 assembly (clang, -O0):
<tabort>:
push   %rbp
mov    %rsp,%rbp
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<tabort>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @tabort() {
unreachable
}

LLVM IR (-O2):
define void @tabort() {
tail call void @abort()
unreachable
}
/* Type definitions */
struct ibv_qp_init_attr {
  int dummy;
};
struct ibv_qp {
  int dummy;
};
struct ibv_pd {
  int dummy;
};

/* Variables and functions */
struct ibv_qp *ibv_create_qp(struct ibv_pd *, struct ibv_qp_init_attr *);
struct ibv_qp *mlx4_glue_create_qp(struct ibv_pd *pd,
                                   struct ibv_qp_init_attr *qp_init_attr) {
  return ibv_create_qp(pd, qp_init_attr);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_create_qp>:
jmp    1030 <ibv_create_qp@plt>

LLVM IR (-O0):
%struct.ibv_qp = type { i32 }
%struct.ibv_pd = type { i32 }
%struct.ibv_qp_init_attr = type { i32 }
define %struct.ibv_qp* @mlx4_glue_create_qp(%struct.ibv_pd* %0, %struct.ibv_qp_init_attr* %1) {
%3 = alloca %struct.ibv_pd*
%4 = alloca %struct.ibv_qp_init_attr*
store %struct.ibv_pd* %0, %struct.ibv_pd** %3
store %struct.ibv_qp_init_attr* %1, %struct.ibv_qp_init_attr** %4
%5 = load %struct.ibv_pd*, %struct.ibv_pd** %3
%6 = load %struct.ibv_qp_init_attr*, %struct.ibv_qp_init_attr** %4
%7 = call %struct.ibv_qp* @ibv_create_qp(%struct.ibv_pd* %5, %struct.ibv_qp_init_attr* %6)
ret %struct.ibv_qp* %7
}

LLVM IR (-O2):
%struct.ibv_qp = type { i32 }
%struct.ibv_pd = type { i32 }
%struct.ibv_qp_init_attr = type { i32 }
define %struct.ibv_qp* @mlx4_glue_create_qp(%struct.ibv_pd* %0, %struct.ibv_qp_init_attr* %1) {
%3 = tail call %struct.ibv_qp* @ibv_create_qp(%struct.ibv_pd* %0, %struct.ibv_qp_init_attr* %1)
ret %struct.ibv_qp* %3
}
int alpha(char c) {
  c = c & 127;
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
          (c == '_'));
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <alpha+0x33>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    115f <alpha+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1152 <alpha+0x52>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    115f <alpha+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
and    $0x7f,%dil
lea    -0x61(%rdi),%eax
cmp    $0x1a,%al
setb   %al
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
setb   %cl
or     %al,%cl
cmp    $0x5f,%dil
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 127
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %26, label %14
14: ; preds = %10, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 90
br i1 %21, label %26, label %22
22: ; preds = %18, %14
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 95
br label %26
26: ; preds = %22, %18, %10
%27 = phi i1 [ true, %18 ], [ true, %10 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @alpha(i8 signext %0) {
%2 = and i8 %0, 127
%3 = add nsw i8 %2, -97
%4 = icmp ult i8 %3, 26
%5 = add nsw i8 %2, -65
%6 = icmp ult i8 %5, 26
%7 = select i1 %4, i1 true, i1 %6
%8 = icmp eq i8 %2, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
unsigned int ss2ct_(int *width, int *height) {
  _s2warn("ss2ct", "function not available from FORTRAN");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ss2ct\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define i32 @ss2ct_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"ss2ct\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define i32 @ss2ct_(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void TOKEN_LEFT_ASSIGN(int x, int y) { x <<= y; }


x86 assembly (clang, -O0):
<TOKEN_LEFT_ASSIGN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TOKEN_LEFT_ASSIGN(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
%7 = shl i32 %6, %5
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @TOKEN_LEFT_ASSIGN(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hand(int s) {
  if (s == 30)
    printf("Sucesso!\n");
  if (s == 10)
    printf("Ficheiro não existe!\n");
  if (s == 6)
    printf("Já existe backup de um ficheiro com o mesmo nome!\n");
}


x86 assembly (clang, -O0):
<hand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jne    1131 <hand+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1147 <hand+0x37>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x6,-0x4(%rbp)
jne    115d <hand+0x4d>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hand>:
cmp    $0x6,%edi
je     112b <hand+0x1b>
cmp    $0x1e,%edi
je     1137 <hand+0x27>
cmp    $0xa,%edi
jne    1143 <hand+0x33>
lea    0xf0d(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xece(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xf0b(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Sucesso!\0A\00"
@.str.1 = [23 x i8] c"Ficheiro n\C3\A3o existe!\0A\00"
@.str.2 = [52 x i8] c"J\C3\A1 existe backup de um ficheiro com o mesmo nome!\0A\00"
define void @hand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 30
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 6
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"J\C3\A1 existe backup de um ficheiro com o mesmo nome!\00"
@str.3 = [22 x i8] c"Ficheiro n\C3\A3o existe!\00"
@str.4 = [9 x i8] c"Sucesso!\00"
define void @hand(i32 %0) {
switch i32 %0, label %7 [
i32 30, label %4
i32 10, label %2
i32 6, label %3
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0), %2 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0), %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Display_CacheAll();
void UI_Cache_f() { Display_CacheAll(); }


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

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

LLVM IR (-O0):
define void @UI_Cache_f() {
%1 = call i32 (...) @Display_CacheAll()
ret void
}

LLVM IR (-O2):
define void @UI_Cache_f() {
%1 = tail call i32 (...) @Display_CacheAll()
ret void
}
int fun(char x) {
  x = x + 1;
  int y;
  y = 1;
  int z = 1;
  ;
  x = x + y + z;
  return x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
add    $0x3,%dil
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
store i32 1, i32* %3
store i32 1, i32* %4
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = add i8 %0, 3
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_inv_class_access_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 37);
}


x86 assembly (clang, -O0):
<hea_cq_aer_inv_class_access_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x25,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_inv_class_access_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x25,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_inv_class_access_err_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 37)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_inv_class_access_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 37)
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint64_t i = 100;
  uint64_t j = (i * i * (i + 1) * (i + 1) / 4);
  uint64_t k = (((2 * i) + 1) * (i + 1) * i) / 6;
  printf("%lu\n", j - k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
imul   -0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x17ff976,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 100, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %12, 4
store i32 %13, i32* %2
%14 = load i32, i32* %1
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 %16, %18
%20 = load i32, i32* %1
%21 = mul nsw i32 %19, %20
%22 = sdiv i32 %21, 6
store i32 %22, i32* %3
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = sub nsw i32 %23, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
main() {
a:;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int gen(int n) {
  int r = 0;
  if (n <= 0)
    return -1;
  do {
    r += n % 10;
  } while (n /= 10);
  return r;
}


x86 assembly (clang, -O0):
<gen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1124 <gen+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <gen+0x57>
jmp    1129 <gen+0x29>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1129 <gen+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen>:
test   %edi,%edi
jle    113c <gen+0x3c>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <gen+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @gen(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %4, 10
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %12
}
int main() {
  signed long long int li;
  li = 0x5555555555555555LL;
  li = 0xAAAAAAAAAAAAAAAALL;
  li = 0x0000000000000000LL;
  li = 0xFFFFFFFFFFFFFFFFLL;
  li = 0x8000000000000000LL;
  li = 0x0000000000000001LL;
  li = 0x7FFFFFFFFFFFFFFFLL;
  li = 0xFFFFFFFFFFFFFFFELL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x5555555555555555,%rax
55 55 55
mov    %rax,-0x10(%rbp)
movabs $0xaaaaaaaaaaaaaaaa,%rax
aa aa aa
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movabs $0x8000000000000000,%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x10(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
movq   $0xfffffffffffffffe,-0x10(%rbp)
ff
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 6148914691236517205, i64* %2
store i64 -6148914691236517206, i64* %2
store i64 0, i64* %2
store i64 -1, i64* %2
store i64 -9223372036854775808, i64* %2
store i64 1, i64* %2
store i64 9223372036854775807, i64* %2
store i64 -2, i64* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void StateMachineDisabled(void) {}


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

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

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

LLVM IR (-O2):
define void @StateMachineDisabled() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a = 'a';
  printf("%c", a -= 32);
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 65)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
int cpu_core_thermal_limit(int cluster, int limit_core) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpu_core_thermal_limit(i32 %0, i32 %1) {
ret i32 0
}
double hypot2_sqr(double x, double y) { return x * x + y * y; }


x86 assembly (clang, -O0):
<hypot2_sqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot2_sqr>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @hypot2_sqr(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
ret double %10
}

LLVM IR (-O2):
define double @hypot2_sqr(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
ret double %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t BitDeinterleave(uint64_t Ai) {
  if ((0)) {
    uint32_t hi = (uint32_t)(Ai >> 32), lo = (uint32_t)Ai;
    uint32_t t0, t1;
    t0 = lo & 0x0000ffff;
    t0 |= t0 << 8;
    t0 &= 0x00ff00ff;
    t0 |= t0 << 4;
    t0 &= 0x0f0f0f0f;
    t0 |= t0 << 2;
    t0 &= 0x33333333;
    t0 |= t0 << 1;
    t0 &= 0x55555555;
    t1 = hi << 16;
    t1 |= t1 >> 8;
    t1 &= 0xff00ff00;
    t1 |= t1 >> 4;
    t1 &= 0xf0f0f0f0;
    t1 |= t1 >> 2;
    t1 &= 0xcccccccc;
    t1 |= t1 >> 1;
    t1 &= 0xaaaaaaaa;
    lo >>= 16;
    lo |= lo << 8;
    lo &= 0x00ff00ff;
    lo |= lo << 4;
    lo &= 0x0f0f0f0f;
    lo |= lo << 2;
    lo &= 0x33333333;
    lo |= lo << 1;
    lo &= 0x55555555;
    hi &= 0xffff0000;
    hi |= hi >> 8;
    hi &= 0xff00ff00;
    hi |= hi >> 4;
    hi &= 0xf0f0f0f0;
    hi |= hi >> 2;
    hi &= 0xcccccccc;
    hi |= hi >> 1;
    hi &= 0xaaaaaaaa;
    Ai = ((uint64_t)(hi | lo) << 32) | (t1 | t0);
  }
  return Ai;
}


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

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

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

LLVM IR (-O2):
define i32 @BitDeinterleave(i32 returned %0) {
ret i32 %0
}
char *f(char *p) {
  short x = *p++ << 16;
  return p;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
shl    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 16
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @f(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++)
    printf("%s\n", argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sync();
void flash_lock(void) { sync(); }


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

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

LLVM IR (-O0):
define void @flash_lock() {
%1 = call i32 (...) @sync()
ret void
}

LLVM IR (-O2):
define void @flash_lock() {
%1 = tail call i32 (...) @sync()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shell_loop();
int main(int argc, char **argv) {
  shell_loop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <shell_loop@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @shell_loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @shell_loop()
ret i32 0
}
void FF_Yield(void) {}


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

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

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

LLVM IR (-O2):
define void @FF_Yield() {
ret void
}
unsigned int str_len(const char *s) {
  unsigned int len = 0;
  while (s[len])
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <str_len+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
void set_remove(struct eiwic_setting *set) { return; }


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

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

LLVM IR (-O0):
%struct.eiwic_setting = type opaque
define void @set_remove(%struct.eiwic_setting* %0) {
%2 = alloca %struct.eiwic_setting*
store %struct.eiwic_setting* %0, %struct.eiwic_setting** %2
ret void
}

LLVM IR (-O2):
%struct.eiwic_setting = type opaque
define void @set_remove(%struct.eiwic_setting* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/);
int main() {
  dup2(1, 4);
  char *a[] = {"/bin/ls", "-al", 0};
  execve(*a, a, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <dup2@plt>
mov    0x2cc2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cbf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cbc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <dup2@plt>
mov    0x2cd6(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cba(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeaf(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [4 x i8] c"-al\00"
@__const.main.a = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = call i32 @dup2(i32 1, i32 4)
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execve(i8* %5, i8** %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [4 x i8] c"-al\00"
@__const.main.a = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = tail call i32 @dup2(i32 1, i32 4)
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4, i32 0)
ret i32 0
}
/* Variables and functions */
int minus(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int ret = minus(20, 10);
  printf("ret:%d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
mov    $0xa,%esi
call   1030 <minus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
mov    $0xa,%esi
call   1030 <minus@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"ret:%d\0A\00"
define void @main() {
%1 = tail call i32 @minus(i32 20, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}