xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
void getData(char *fileName, char *fileData, int dataSize) {
  FILE *fp;
  fp = fopen(fileName, "a+");
  fread(fileData, dataSize, 1, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<getData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getData>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"a+\00"
define void @getData(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fread(i8* %10, i32 %11, i32 1, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"a+\00"
define void @getData(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fread(i8* %1, i32 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
void *double_copy(void *to_copy) {
  double *d = (double *)calloc(1, sizeof(double));
  *d = *(double *)to_copy;
  return d;
}


x86 assembly (clang, -O0):
<double_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_copy>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @double_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = call i8* @calloc(i64 1, i64 8)
%5 = bitcast i8* %4 to double*
store double* %5, double** %3
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load double*, double** %3
store double %8, double* %9
%10 = load double*, double** %3
%11 = bitcast double* %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @double_copy(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(8) i8* @calloc(i64 1, i64 8)
%3 = bitcast i8* %2 to double*
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
store double %5, double* %3
ret i8* %2
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_45(uint64_t x) {
  __asm__("rolq $45, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_45>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x2d,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_45>:
mov    %rdi,%rax
rol    $0x2d,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_45(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$45, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_45(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$45, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _ddidfd(double, double, int, double, float, double);
void call_ddidfd() { _ddidfd(1.0, 2.0, 3, 4.0, 5.0f, 6.0); }


x86 assembly (clang, -O0):
<call_ddidfd>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
mov    $0x3,%edi
movsd  0xedf(%rip),%xmm2
movss  0xee7(%rip),%xmm3
movsd  0xed7(%rip),%xmm4
call   1030 <_ddidfd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_ddidfd>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
movss  0xef0(%rip),%xmm3
movsd  0xee0(%rip),%xmm4
mov    $0x3,%edi
jmp    1030 <_ddidfd@plt>

LLVM IR (-O0):
define void @call_ddidfd() {
%1 = call i32 @_ddidfd(double 1.000000e+00, double 2.000000e+00, i32 3, double 4.000000e+00, float 5.000000e+00, double 6.000000e+00)
ret void
}

LLVM IR (-O2):
define void @call_ddidfd() {
%1 = tail call i32 @_ddidfd(double 1.000000e+00, double 2.000000e+00, i32 3, double 4.000000e+00, float 5.000000e+00, double 6.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void PrintUsage(char *program) {
  printf("Usage: %s <filename>\n", program);
  exit(1);
}


x86 assembly (clang, -O0):
<PrintUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<PrintUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
define void @PrintUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
define void @PrintUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
char *BN_bn2dec(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *);
void printBN(char *name, BIGNUM *bn) {
  printf("%s = %s\n", name, BN_bn2dec(bn));
}


x86 assembly (clang, -O0):
<printBN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <BN_bn2dec@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBN>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <BN_bn2dec@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @printBN(i8* %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 = call i8* @BN_bn2dec(i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @printBN(i8* %0, i32* %1) {
%3 = tail call i8* @BN_bn2dec(i32* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int);
void sub(int a, int b) { ft_putnbr(a - b); }


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

x86 assembly (clang, -O2):
<sub>:
sub    %esi,%edi
jmp    1030 <ft_putnbr@plt>

LLVM IR (-O0):
define void @sub(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 %5, %6
%8 = call i32 @ft_putnbr(i32 %7)
ret void
}

LLVM IR (-O2):
define void @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @ft_putnbr(i32 %3)
ret void
}
/* Variables and functions */
int f1(int);
int f0(int i) { return f1(i) - i; }


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

x86 assembly (clang, -O2):
<f0>:
push   %rbx
mov    %edi,%ebx
call   1030 <f1@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f1(i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f0(i32 %0) {
%2 = tail call i32 @f1(i32 %0)
%3 = sub nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Welcome :) \n!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Welcome :) \0A!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cttk_i31_divrem(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/ const *);
void cttk_i31_div(uint32_t *q, const uint32_t *a, const uint32_t *b) {
  cttk_i31_divrem(q, NULL, a, b);
}


x86 assembly (clang, -O0):
<cttk_i31_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <cttk_i31_divrem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cttk_i31_div>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <cttk_i31_divrem@plt>

LLVM IR (-O0):
define void @cttk_i31_div(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @cttk_i31_divrem(i32* %7, i32* null, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @cttk_i31_div(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @cttk_i31_divrem(i32* %0, i32* null, i32* %1, i32* %2)
ret void
}
char *my_strcpy(char *dest, const char *src) {
  char *save = dest;
  while (*dest++ = *src++)
    ;
  return save;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <my_strcpy+0x43>
jmp    1114 <my_strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <my_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ ft_print_comb();
int main(void) {
  ft_print_comb();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ft_print_comb()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ primMST(int **);
int main() {
  int graph[5][5] = {{0, 7, 0, 5, 0},
                     {7, 0, 8, 9, 7},
                     {0, 8, 0, 0, 5},
                     {5, 9, 0, 0, 15},
                     {0, 7, 5, 15, 0}};
  primMST(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
call   1030 <primMST@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0xf46(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf2b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <primMST@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.graph = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 7, i32 0, i32 5, i32 0], [5 x i32] [i32 7, i32 0, i32 8, i32 9, i32 7], [5 x i32] [i32 0, i32 8, i32 0, i32 0, i32 5], [5 x i32] [i32 5, i32 9, i32 0, i32 0, i32 15], [5 x i32] [i32 0, i32 7, i32 5, i32 15, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [5 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%5 = bitcast [5 x i32]* %4 to i32**
%6 = call i32 @primMST(i32** %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 7, i32 0, i32 5, i32 0], [5 x i32] [i32 7, i32 0, i32 8, i32 9, i32 7], [5 x i32] [i32 0, i32 8, i32 0, i32 0, i32 5], [5 x i32] [i32 5, i32 9, i32 0, i32 0, i32 15], [5 x i32] [i32 0, i32 7, i32 5, i32 15, i32 0]]
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @primMST(i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  i = 102;
  while (i >= 100) {
    i = i - 2;
    assert(i > 0);
  }
  assert(i > 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x66,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     114f <main+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1126 <main+0x16>
cmpl   $0x64,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 102, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 100
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
char *error_string(long error) {
  switch (error) {
  case 0:
    return "OK";
  case 1:
    return "ERROR";
  case 2:
    return "EXCEPTION";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<error_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
test   %rax,%rax
je     1144 <error_string+0x44>
jmp    111e <error_string+0x1e>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
je     1154 <error_string+0x54>
jmp    1131 <error_string+0x31>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
je     1164 <error_string+0x64>
jmp    1174 <error_string+0x74>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <error_string+0x7f>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <error_string+0x7f>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <error_string+0x7f>
lea    0xe98(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_string>:
cmp    $0x2,%rdi
ja     1115 <error_string+0x15>
lea    0xf0f(%rip),%rcx
movslq (%rcx,%rdi,4),%rax
add    %rcx,%rax
ret
lea    0xef7(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [10 x i8] c"EXCEPTION\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
define i8* @error_string(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %8 [
i64 0, label %5
i64 1, label %6
i64 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [10 x i8] c"EXCEPTION\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
@reltable.error_string = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.error_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.error_string to i64)) to i32)]
define i8* @error_string(i64 %0) {
%2 = icmp ult i64 %0, 3
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = shl i64 %0, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.error_string to i8*), i64 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t
atomic_cmpxchg64(uint64_t *addr, uint64_t oldval, uint64_t newval) {
  asm volatile("lock; "
               "cmpxchg"
               "q"
               " %2, %1"
               : "+a"(oldval), "+m"(*addr)
               : "q"(newval)
               : "cc");
  return oldval;
}


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

x86 assembly (clang, -O2):
<atomic_cmpxchg64>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_cmpxchg64(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %6
%10 = call i8* asm sideeffect "lock; cmpxchgq $2, $1", "={ax},=*m,q,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %8, i8* %9, i8* %7, i8** elementtype(i8*) %8)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @atomic_cmpxchg64(i8** %0, i8* %1, i8* %2) {
%4 = tail call i8* asm sideeffect "lock; cmpxchgq $2, $1", "={ax},=*m,q,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8* %2, i8* %1, i8** elementtype(i8*) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void check_argument(char *arg) {
  if (arg[0] != '-') {
    printf("Error in argument %s. Arguments start with '-'\n", arg);
  }
}


x86 assembly (clang, -O0):
<check_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     113c <check_argument+0x2c>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_argument>:
cmpb   $0x2d,(%rdi)
jne    1116 <check_argument+0x6>
ret
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Error in argument %s. Arguments start with '-'\0A\00"
define void @check_argument(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 45
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Error in argument %s. Arguments start with '-'\0A\00"
define void @check_argument(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
__attribute__((no, noclone)) int f6(unsigned char x, unsigned char y) {
  int a = x;
  int b = y;
  int c = a - b;
  return c & 0x2ff;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %edi,%eax
sub    %esi,%eax
and    $0x2ff,%eax
ret

LLVM IR (-O0):
define i32 @f6(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = and i32 %15, 767
ret i32 %16
}

LLVM IR (-O2):
define i32 @f6(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = sub nsw i32 %3, %4
%6 = and i32 %5, 767
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ enable_echo();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_game(void) {
  enable_echo();
  exit(0);
}


x86 assembly (clang, -O0):
<exit_game>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <enable_echo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_game>:
push   %rax
xor    %eax,%eax
call   1030 <enable_echo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_game() {
%1 = call i32 (...) @enable_echo()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_game() {
%1 = tail call i32 (...) @enable_echo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *fu_Open(const char *path, const char *flags) {
  return fopen(path, flags);
}


x86 assembly (clang, -O0):
<fu_Open>:
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 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_Open>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @fu_Open(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a;
  a = 1;
  int i;
  i = 0;
  while (a < 2000000000) {
    i = fact(5);
    a += 1;
  }
  printf("%d", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x77359400,-0x4(%rbp)
jge    115e <main+0x3e>
mov    $0x5,%edi
call   1040 <fact@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x773593ff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1040 <fact@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @fact(i32 5)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 2000000000
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double const);
char *ftoa(const double val) {
  static char buf[13];
  sprintf(buf, "%f", val);
  return buf;
}


x86 assembly (clang, -O0):
<ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0x2f00(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2eed(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoa>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ftoa.buf = internal global [13 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @ftoa(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @ftoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @ftoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@ftoa.buf = internal global [13 x i8] zeroinitializer
@.str = [3 x i8] c"%f\00"
define i8* @ftoa(double %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @ftoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @ftoa.buf, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
void chop(char *str) {
  char *p;
  p = (char *)strstr(str, "#");
  if (p)
    *p = 0;
  p = (char *)strstr(str, "\n");
  if (p)
    *p = 0;
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <chop+0x32>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <chop+0x58>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1128 <chop+0x18>
movb   $0x0,(%rax)
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
je     113f <chop+0x2f>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @chop(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
store i8 0, i8* %10
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %2
%13 = call i64 @strstr(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i8*, i8** %3
store i8 0, i8* %18
br label %19
19: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @chop(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
store i8 0, i8* %5
br label %6
6: ; preds = %4, %1
%7 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = inttoptr i64 %7 to i8*
store i8 0, i8* %10
br label %11
11: ; preds = %9, %6
ret void
}
void iface_midi_router_set_bend_range(int bend) {
  if (bend < (1) || bend > (12)) {
    log_error("imrsbr - bend invalid: %d", bend);
    return;
  }
  config_store_set_val(2, bend);
  cvproc_set_bend_range(bend);
}


x86 assembly (clang, -O0):
<iface_midi_router_set_bend_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     114f <iface_midi_router_set_bend_range+0x1f>
cmpl   $0xc,-0x4(%rbp)
jle    1165 <iface_midi_router_set_bend_range+0x35>
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <log_error@plt>
jmp    117e <iface_midi_router_set_bend_range+0x4e>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
mov    $0x0,%al
call   1050 <config_store_set_val@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <cvproc_set_bend_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iface_midi_router_set_bend_range>:
push   %rbx
mov    %edi,%ebx
lea    -0xd(%rbx),%eax
cmp    $0xfffffff3,%eax
ja     114c <iface_midi_router_set_bend_range+0x1c>
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <log_error@plt>
mov    $0x2,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <config_store_set_val@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <cvproc_set_bend_range@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"imrsbr - bend invalid: %d\00"
define void @iface_midi_router_set_bend_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 12
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @log_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %16
11: ; preds = %5
%12 = load i32, i32* %2
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @config_store_set_val to i32 (i32, i32, ...)*)(i32 2, i32 %12)
%14 = load i32, i32* %2
%15 = call i32 (i32, ...) bitcast (i32 (...)* @cvproc_set_bend_range to i32 (i32, ...)*)(i32 %14)
br label %16
16: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"imrsbr - bend invalid: %d\00"
define void @iface_midi_router_set_bend_range(i32 %0) {
%2 = add i32 %0, -13
%3 = icmp ult i32 %2, -12
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @log_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
6: ; preds = %1
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @config_store_set_val to i32 (i32, i32, ...)*)(i32 2, i32 %0)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @cvproc_set_bend_range to i32 (i32, ...)*)(i32 %0)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int OK;
int PDC_set_scrn_mode(int new_mode) { return (OK); }


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

x86 assembly (clang, -O2):
<PDC_set_scrn_mode>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_set_scrn_mode(i32 %0) {
%2 = load i32, i32* @OK
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ DES_cblock;

/* Variables and functions */
int /*<<< orphan*/ DES_set_odd_parity(int /*<<< orphan*/ *);
#define EVP_CTRL_RAND_KEY 128
int /*<<< orphan*/ RAND_bytes(void *, int);
int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) {
  switch (type) {
  case EVP_CTRL_RAND_KEY:
    if (RAND_bytes(ptr, 8) <= 0)
      return 0;
    DES_set_odd_parity((DES_cblock *)ptr);
    return 1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<des_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
jne    1181 <des_ctrl+0x61>
jmp    1149 <des_ctrl+0x29>
mov    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <RAND_bytes@plt>
cmp    $0x0,%eax
jg     116c <des_ctrl+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1188 <des_ctrl+0x68>
mov    -0x20(%rbp),%rdi
call   1040 <DES_set_odd_parity@plt>
movl   $0x1,-0x4(%rbp)
jmp    1188 <des_ctrl+0x68>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<des_ctrl>:
push   %rbx
mov    $0xffffffff,%eax
cmp    $0x80,%esi
jne    114f <des_ctrl+0x2f>
mov    %rcx,%rbx
mov    %rcx,%rdi
mov    $0x8,%esi
call   1030 <RAND_bytes@plt>
test   %eax,%eax
jle    1151 <des_ctrl+0x31>
mov    %rbx,%rdi
call   1040 <DES_set_odd_parity@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @des_ctrl(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i32, i32* %7
switch i32 %10, label %20 [
i32 128, label %11
]
11: ; preds = %4
%12 = load i8*, i8** %9
%13 = call i32 @RAND_bytes(i8* %12, i32 8)
%14 = icmp sle i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %5
br label %21
16: ; preds = %11
%17 = load i8*, i8** %9
%18 = bitcast i8* %17 to i32*
%19 = call i32 @DES_set_odd_parity(i32* %18)
store i32 1, i32* %5
br label %21
20: ; preds = %4
store i32 -1, i32* %5
br label %21
21: ; preds = %20, %16, %15
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @des_ctrl(i32* nocapture readnone %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %1, 128
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = tail call i32 @RAND_bytes(i8* %3, i32 8)
%8 = icmp slt i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = bitcast i8* %3 to i32*
%11 = tail call i32 @DES_set_odd_parity(i32* %10)
br label %12
12: ; preds = %4, %6, %9
%13 = phi i32 [ 1, %9 ], [ 0, %6 ], [ -1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ kputch(int);
void ksh_command_div0() {
  int zero = 0;
  int i = 10 / zero;
  kputch(i);
}


x86 assembly (clang, -O0):
<ksh_command_div0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <kputch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksh_command_div0>:
jmp    1030 <kputch@plt>

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

LLVM IR (-O2):
define void @ksh_command_div0() {
%1 = tail call i32 @kputch(i32 poison)
ret void
}
int sys$exit(unsigned int code) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(code);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(21), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x15,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$exit>:
mov    %edi,%edi
mov    $0x15,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$exit"(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 21, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$exit"(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 21, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_6Auint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x6A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Auint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 106
%6 = icmp ne i64 %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_6Auint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 106
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int *foo1(int *a, int *b) { return a; }


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

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

LLVM IR (-O0):
define i32* @foo1(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
ret i32* %5
}

LLVM IR (-O2):
define i32* @foo1(i32* readnone returned %0, i32* nocapture readnone %1) {
ret i32* %0
}
int mul_numbers(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @mul_numbers(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul_numbers(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ util_reverse(void *, size_t const, int);
void util_breverse(void *base, const size_t nmemb) {
  util_reverse(base, nmemb, sizeof(unsigned char));
}


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

x86 assembly (clang, -O2):
<util_breverse>:
mov    $0x1,%edx
jmp    1030 <util_reverse@plt>

LLVM IR (-O0):
define void @util_breverse(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @util_reverse(i8* %5, i64 %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @util_breverse(i8* %0, i64 %1) {
%3 = tail call i32 @util_reverse(i8* %0, i64 %1, i32 1)
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IRUSR;
scalar_t__ stat(char const *, struct stat *);
int fsop_path_read_owner(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return (st.st_mode & S_IRUSR);
}


x86 assembly (clang, -O0):
<fsop_path_read_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_read_owner+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <fsop_path_read_owner+0x3e>
mov    -0x18(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_read_owner>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IRUSR = global i32 0
define i32 @fsop_path_read_owner(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IRUSR
%9 = and i32 %8, %7
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_short(FILE *f) { return (fgetc(f) << 8) + fgetc(f); }


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

x86 assembly (clang, -O2):
<get_short>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_short(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = shl i32 %4, 8
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_short(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = shl i32 %2, 8
%4 = tail call i32 @fgetc(i32* %0)
%5 = add nsw i32 %3, %4
ret i32 %5
}
unsigned short foo(unsigned int *p) { return *p; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = trunc i32 %2 to i16
ret i16 %3
}