xunge/DecIR huggingface dataset:
int cell(double x) {
  if ((int)x - x == 0) {
    return (int)x;
  } else {
    return (int)x + 1;
  }
}


x86 assembly (clang, -O0):
<cell>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
subsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1137 <cell+0x37>
jp     1137 <cell+0x37>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <cell+0x42>
cvttsd2si -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cell>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cell(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %3
%12 = fptosi double %11 to i32
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = load double, double* %3
%15 = fptosi double %14 to i32
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @cell(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %3, %0
%5 = fcmp une double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
int sum(n) { n = 5; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
ret i32 undef
}
unsigned int f19(unsigned int x, int y __attribute__((unused))) {
  return (x >> ((-1) & (8 * 4 - 1))) ^ (x << 1);
}


x86 assembly (clang, -O0):
<f19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f19(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 = lshr i32 %5, 31
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f19(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_array(double **);
double sum_array(double *, int);
double test() {
  double *x;
  x = 0;
  init_array(&x);
  return sum_array(x, 10);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <init_array@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <sum_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1040 <init_array@plt>
mov    (%rsp),%rdi
mov    $0xa,%esi
call   1030 <sum_array@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @test() {
%1 = alloca double*
store double* null, double** %1
%2 = call i32 @init_array(double** %1)
%3 = load double*, double** %1
%4 = call double @sum_array(double* %3, i32 10)
ret double %4
}

LLVM IR (-O2):
define double @test() {
%1 = alloca double*
%2 = bitcast double** %1 to i8*
store double* null, double** %1
%3 = call i32 @init_array(double** %1)
%4 = load double*, double** %1
%5 = call double @sum_array(double* %4, i32 10)
ret double %5
}
/* Variables and functions */
int encrypt(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int integer;
  printf("Please input a number between 1000 and 9999:\n");
  scanf("%d", &integer);
  printf("Encryption is %d\n", encrypt(integer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <encrypt@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <encrypt@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Please input a number between 1000 and 9999:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Encryption is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @encrypt(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Encryption is %d\0A\00"
@str = [45 x i8] c"Please input a number between 1000 and 9999:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @encrypt(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int black_note(int pos) {
  if (pos < 2)
    return 2 * pos + 1;
  return 2 * pos;
}


x86 assembly (clang, -O0):
<black_note>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1122 <black_note+0x22>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <black_note+0x2b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<black_note>:
xor    %eax,%eax
cmp    $0x2,%edi
setl   %al
lea    (%rax,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @black_note(i32 %0) {
%2 = icmp slt i32 %0, 2
%3 = shl nsw i32 %0, 1
%4 = zext i1 %2 to i32
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
char *strdup(char const *);
char *icalmemory_strdup(const char *s) { return strdup(s); }


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

x86 assembly (clang, -O2):
<icalmemory_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @icalmemory_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_operation_set_state_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_operation_set_state_callback"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_operation_set_state_callback\00"
define i32 @pa_operation_set_state_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int fun116() { return 116; }


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

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

LLVM IR (-O0):
define i32 @fun116() {
ret i32 116
}

LLVM IR (-O2):
define i32 @fun116() {
ret i32 116
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int Xendc(int status, char *label, char *mnemo, char *oper) {
  if (oper) {
    error("no operand allowed for ENDC");
  }
  return 0x11;
}


x86 assembly (clang, -O0):
<Xendc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113e <Xendc+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <error@plt>
mov    $0x11,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xendc>:
test   %rcx,%rcx
je     1126 <Xendc+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <error@plt>
add    $0x8,%rsp
mov    $0x11,%eax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"no operand allowed for ENDC\00"
define i32 @Xendc(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
ret i32 17
}

LLVM IR (-O2):
@.str = [28 x i8] c"no operand allowed for ENDC\00"
define i32 @Xendc(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* readnone %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_hello(void) { printf("hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @test_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @test_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  int b = a * a, c = a * a * a;
  printf("%d\n%d", b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I'm alive! Beware.\n");
  getchar();
  return 0;
}


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

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

LLVM IR (-O2):
@str = [19 x i8] c"I'm alive! Beware.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Mali_WrReg(int, int /*<<< orphan*/, int, int);
void Mali_MaskAllInterrupts(void) {
  Mali_WrReg(0x20, 0, 0x24, 0xFFFFFFFF);
  Mali_WrReg(0x20, 0, 0x1004, 0xFFFFFFFF);
  Mali_WrReg(0x20, 0, 0x2004, 0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<Mali_MaskAllInterrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x24,%edx
mov    $0xffffffff,%ecx
call   1030 <Mali_WrReg@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1004,%edx
mov    $0xffffffff,%ecx
call   1030 <Mali_WrReg@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2004,%edx
mov    $0xffffffff,%ecx
call   1030 <Mali_WrReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_MaskAllInterrupts>:
push   %rax
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x24,%edx
mov    $0xffffffff,%ecx
call   1030 <Mali_WrReg@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1004,%edx
mov    $0xffffffff,%ecx
call   1030 <Mali_WrReg@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2004,%edx
mov    $0xffffffff,%ecx
pop    %rax
jmp    1030 <Mali_WrReg@plt>

LLVM IR (-O0):
define void @Mali_MaskAllInterrupts() {
%1 = call i32 @Mali_WrReg(i32 32, i32 0, i32 36, i32 -1)
%2 = call i32 @Mali_WrReg(i32 32, i32 0, i32 4100, i32 -1)
%3 = call i32 @Mali_WrReg(i32 32, i32 0, i32 8196, i32 -1)
ret void
}

LLVM IR (-O2):
define void @Mali_MaskAllInterrupts() {
%1 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 36, i32 -1)
%2 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 4100, i32 -1)
%3 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 8196, i32 -1)
ret void
}
void Array2D_double_delete(int M, int N, double **A) {
  int i;
  if (A == 0)
    return;
  for (i = 0; i < M; i++)
    free(A[i]);
  free(A);
}


x86 assembly (clang, -O0):
<Array2D_double_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1132 <Array2D_double_delete+0x22>
jmp    116d <Array2D_double_delete+0x5d>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <Array2D_double_delete+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <Array2D_double_delete+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Array2D_double_delete>:
test   %rdx,%rdx
je     114f <Array2D_double_delete+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
test   %edi,%edi
jle    1142 <Array2D_double_delete+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <Array2D_double_delete+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Array2D_double_delete(i32 %0, i32 %1, double** %2) {
%4 = icmp eq double** %2, null
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds double*, double** %2, i64 %10
%12 = bitcast double** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %5
%17 = bitcast double** %2 to i8*
tail call void @free(i8* %17)
br label %18
18: ; preds = %3, %16
ret void
}
/* Variables and functions */
int u8islowerlatini(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8islowerlatinc(char *c) { return u8islowerlatini(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8islowerlatinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8islowerlatini@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islowerlatinc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8islowerlatini@plt>

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

LLVM IR (-O2):
define i32 @u8islowerlatinc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8islowerlatini(i32 %2)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned long timeGetTime() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec * 100000 + tv.tv_usec / 10;
}


x86 assembly (clang, -O0):
<timeGetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x186a0,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeGetTime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x186a0,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timeGetTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 100000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 10
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timeGetTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 100000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 10
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int check_ogn_file(void) {
  FILE *fp;
  fp = fopen("/tmp/canon.cal", "r");
  if (fp) {
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_ogn_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115f <check_ogn_file+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <check_ogn_file+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ogn_file>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1148 <check_ogn_file+0x28>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/canon.cal\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @check_ogn_file() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/canon.cal\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @check_ogn_file() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
void reverse(const char *src, char *dst) {
  dst += strlen(src);
  while (src < dst) {
    *dst-- = *src++;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <reverse+0x5e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1139 <reverse+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %r14,%rax
cmp    %rbx,%rax
jbe    1146 <reverse+0x36>
add    $0x1,%rbx
nopl   (%rax)
movzbl -0x1(%rbx),%ecx
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rbx),%rcx
cmp    %rax,%rbx
mov    %rcx,%rbx
jb     1130 <reverse+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @reverse(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 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %4
br label %10
10: ; preds = %14, %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = icmp ult i8* %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
%17 = load i8, i8* %15
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %4
store i8 %17, i8* %18
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @reverse(i8* %0, i8* writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %14
7: ; preds = %2, %7
%8 = phi i8* [ %12, %7 ], [ %5, %2 ]
%9 = phi i8* [ %10, %7 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %9
%12 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 %11, i8* %8
%13 = icmp ult i8* %10, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", getchar() != EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void UARTLoopbackModeControl(unsigned int baseAdd, unsigned int controlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~((0x00000010u));
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |=
      (controlFlag & (0x00000010u));
}


x86 assembly (clang, -O0):
<UARTLoopbackModeControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x10,%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTLoopbackModeControl>:
add    $0x10,%edi
andl   $0xffffffef,(%rdi)
and    $0x10,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTLoopbackModeControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 16
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -17
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 16
%13 = load i32, i32* %3
%14 = add i32 %13, 16
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTLoopbackModeControl(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -17
store volatile i32 %7, i32* %5
%8 = and i32 %1, 16
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
void test76_FcnArrParm_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test76_FcnArrParm_targetInit__I() {
ret void
}
int GetMaxChars(int arraysize) {
  int sz = arraysize / 8;
  return (0 > sz ? 0 : sz);
}


x86 assembly (clang, -O0):
<GetMaxChars>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jle    112a <GetMaxChars+0x2a>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <GetMaxChars+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxChars>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
xor    %ecx,%ecx
sar    $0x3,%eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GetMaxChars(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 0, %6
br i1 %7, label %8, label %9
8: ; preds = %1
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
br label %11
11: ; preds = %9, %8
%12 = phi i32 [ 0, %8 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @GetMaxChars(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_group_rekey_timer_usage(void) {
  printf("\nUsage : sys_cfg_group_rekey_timer [GROUP_REKEY_TIMER]\n");
  printf("\nOptions: GROUP_REKEY_TIME is represented in seconds");
  printf("\n         empty - Get current group re-key time\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_group_rekey_timer_usage>:
push   %rax
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"\0AUsage : sys_cfg_group_rekey_timer [GROUP_REKEY_TIMER]\0A\00"
@.str.1 = [53 x i8] c"\0AOptions: GROUP_REKEY_TIME is represented in seconds\00"
@.str.2 = [49 x i8] c"\0A empty - Get current group re-key time\0A\00"
define void @print_sys_cfg_group_rekey_timer_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [53 x i8] c"\0AOptions: GROUP_REKEY_TIME is represented in seconds\00"
@str = [55 x i8] c"\0AUsage : sys_cfg_group_rekey_timer [GROUP_REKEY_TIMER]\00"
@str.3 = [48 x i8] c"\0A empty - Get current group re-key time\00"
define void @print_sys_cfg_group_rekey_timer_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ low_popd();
void low_popall(void) {
  while (low_popd())
    ;
}


x86 assembly (clang, -O0):
<low_popall>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <low_popall+0x9>
mov    $0x0,%al
call   1030 <low_popd@plt>
cmp    $0x0,%rax
je     112f <low_popall+0x1f>
jmp    1119 <low_popall+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<low_popall>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <low_popd@plt>
test   %rax,%rax
jne    1120 <low_popall+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @low_popall() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @low_popd()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @low_popall() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @low_popd()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int strlen(char *);
void decriptar(char *password, int key) {
  for (int cont = 0; cont < strlen(password); cont++)
    password[cont] = password[cont] + key;
}


x86 assembly (clang, -O0):
<decriptar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116c <decriptar+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <decriptar+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decriptar>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1147 <decriptar+0x37>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    %r14b,(%rbx,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1130 <decriptar+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @decriptar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %28
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %11
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @decriptar(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = add i8 %11, %6
store i8 %12, i8* %10
%13 = add nuw nsw i64 %9, 1
%14 = tail call i32 @strlen(i8* %0)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %7
}
void dist_init(int *argc, char ***argv) { return; }


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

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

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

LLVM IR (-O2):
define void @dist_init(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int RAND_MAX;
int random();
int get_rnd(int max) {
  int divisor = RAND_MAX / (max + 1);
  long retval;
  do {
    retval = random() / divisor;
  } while (retval >= max);
  return (int)retval;
}


x86 assembly (clang, -O0):
<get_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x8(%rbp)
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    1130 <get_rnd+0x20>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jge    1130 <get_rnd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @get_rnd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %5, %7
store i32 %8, i32* %3
br label %9
9: ; preds = %14, %1
%10 = call i32 (...) @random()
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %4
br label %14
14: ; preds = %9
%15 = load i64, i64* %4
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = icmp sge i64 %15, %17
br i1 %18, label %9, label %19
19: ; preds = %14
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @get_rnd(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @random()
%7 = sdiv i32 %6, %4
%8 = icmp slt i32 %7, %0
br i1 %8, label %9, label %5
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
int close(int);
int gpioClose(int fileDescriptor) { return close(fileDescriptor); }


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

x86 assembly (clang, -O2):
<gpioClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @gpioClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int test_imm_B2int64_midword_reg(long long val) {
  return ((val >> 16) & (0xB2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B2int64_midword_reg>:
test   $0xb20000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B2int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 178
%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_B2int64_midword_reg(i64 %0) {
%2 = and i64 %0, 11665408
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void SysCtlIntEnable(unsigned long ulInts) {
  (*((volatile unsigned long *)(0x400FE054))) |= ulInts;
}


x86 assembly (clang, -O0):
<SysCtlIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fe054,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fe054,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntEnable>:
or     %rdi,0x400fe054
40
ret

LLVM IR (-O0):
define void @SysCtlIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074782292 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074782292 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074782292 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074782292 to i64*)
ret void
}
/* Type definitions */
struct config_setting_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __config_setting_get_float(struct config_setting_t const *,
                                              double *);
double config_setting_get_float(const struct config_setting_t *setting) {
  double value = 0.0;
  __config_setting_get_float(setting, &value);
  return (value);
}


x86 assembly (clang, -O0):
<config_setting_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <__config_setting_get_float@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_setting_get_float>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <__config_setting_get_float@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.config_setting_t = type { i32 }
define double @config_setting_get_float(%struct.config_setting_t* %0) {
%2 = alloca %struct.config_setting_t*
%3 = alloca double
store %struct.config_setting_t* %0, %struct.config_setting_t** %2
store double 0.000000e+00, double* %3
%4 = load %struct.config_setting_t*, %struct.config_setting_t** %2
%5 = call i32 @__config_setting_get_float(%struct.config_setting_t* %4, double* %3)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
%struct.config_setting_t = type { i32 }
define double @config_setting_get_float(%struct.config_setting_t* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%4 = call i32 @__config_setting_get_float(%struct.config_setting_t* %0, double* %2)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ GyrosHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GyrosRequestUpdate() { UAVObjRequestUpdate(GyrosHandle()); }


x86 assembly (clang, -O0):
<GyrosRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GyrosHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyrosRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GyrosHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GyrosRequestUpdate() {
%1 = call i32 (...) @GyrosHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyrosRequestUpdate() {
%1 = tail call i32 (...) @GyrosHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *calloc(size_t, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(char *, int, size_t, int /*<<< orphan*/ *);
int get_size(int /*<<< orphan*/ *);
int /*<<< orphan*/ *open_file(char *, char *);
char *read_file(char *path) {
  FILE *file = open_file(path, "rb");
  size_t size = get_size(file) + 1;
  char *buffer = calloc(size, sizeof(char));
  fread(buffer, 1, size, file);
  fclose(file);
  return buffer;
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1060 <open_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_size@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file>:
push   %r15
push   %r14
push   %rbx
lea    0xea4(%rip),%rsi
call   1060 <open_file@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <get_size@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i8* @read_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32* @open_file(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @get_size(i32* %8)
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = call i8* @calloc(i64 %12, i32 1)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = load i32*, i32** %3
%17 = call i32 @fread(i8* %14, i32 1, i64 %15, i32* %16)
%18 = load i32*, i32** %3
%19 = call i32 @fclose(i32* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i8* @read_file(i8* %0) {
%2 = tail call i32* @open_file(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @get_size(i32* %2)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = tail call i8* @calloc(i64 %5, i32 1)
%7 = tail call i32 @fread(i8* %6, i32 1, i64 %5, i32* %2)
%8 = tail call i32 @fclose(i32* %2)
ret i8* %6
}