xunge/DecIR huggingface dataset:
/* Variables and functions */
double pow(double, double);
double lr_get_rounding_factor(int dp) {
  double rounding_factor = 10.0;
  return rounding_factor = pow(rounding_factor, (double)dp);
}


x86 assembly (clang, -O0):
<lr_get_rounding_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr_get_rounding_factor>:
cvtsi2sd %edi,%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @lr_get_rounding_factor(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 1.000000e+01, double* %3
%4 = load double, double* %3
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = call double @pow(double %4, double %6)
store double %7, double* %3
ret double %7
}

LLVM IR (-O2):
define double @lr_get_rounding_factor(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @pow(double 1.000000e+01, double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int array[10];
  int *a = array + 10;
  int *p = a - 10;
  *p = 7;
  test_assert(array[0] == 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffd8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x7,(%rax)
cmpl   $0x7,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 10
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 -10
store i32* %8, i32** %4
%9 = load i32*, i32** %4
store i32 7, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 7
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
float *malloc(int);
float *create_zero(int L) {
  float *M = malloc(L * sizeof(float));
  return M;
}


x86 assembly (clang, -O0):
<create_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_zero>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define float* @create_zero(i32 %0) {
%2 = alloca i32
%3 = alloca float*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call float* @malloc(i32 %7)
store float* %8, float** %3
%9 = load float*, float** %3
ret float* %9
}

LLVM IR (-O2):
define noalias float* @create_zero(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call float* @malloc(i32 %2)
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
main() {
  char n = 56;
  printf("%x, %x, %x\n", n & 0xff, ~n & 0xff, -n & 0xff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x38,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
movsbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xff,%eax
mov    %al,%cl
movsbl -0x5(%rbp),%esi
xor    %eax,%eax
sub    %esi,%eax
and    $0xff,%eax
lea    0xeb0(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"%x, %x, %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 56, i8 signext -57, i8 signext -56)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *preinit_malloc(size_t);
void *preinit_calloc(size_t nmemb, size_t size) {
  void *p = preinit_malloc(nmemb * size);
  memset(p, 0, nmemb * size);
  return p;
}


x86 assembly (clang, -O0):
<preinit_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <preinit_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preinit_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <preinit_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @preinit_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @preinit_malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @preinit_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @preinit_malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
const char *fpp_config_get_plugin_mime_type(void) {
  return "application/x-shockwave-flash:swf:Shockwave Flash;"
         "application/futuresplash:spl:FutureSplash Player";
}


x86 assembly (clang, -O0):
<fpp_config_get_plugin_mime_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_config_get_plugin_mime_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [99 x i8] c"application/x-shockwave-flash:swf:Shockwave Flash;application/futuresplash:spl:FutureSplash Player\00"
define i8* @fpp_config_get_plugin_mime_type() {
ret i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [99 x i8] c"application/x-shockwave-flash:swf:Shockwave Flash;application/futuresplash:spl:FutureSplash Player\00"
define i8* @fpp_config_get_plugin_mime_type() {
ret i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, int, int);
void keyup(unsigned char key, int x, int y) {
  printf("kUP: %c <%d> @ (%d,%d)\n", key, key, x, y);
}


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"kUP: %c <%d> @ (%d,%d)\0A\00"
define void @keyup(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SysCtlNMIClear(uint32_t ui32Ints) {
  (*((volatile unsigned long *)(0x400FE064))) &= ~ui32Ints;
}


x86 assembly (clang, -O0):
<SysCtlNMIClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fe064,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fe064,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlNMIClear>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x400fe064
40
ret

LLVM IR (-O0):
define void @SysCtlNMIClear(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074782308 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782308 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlNMIClear(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074782308 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782308 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M290_f(char *s) {
  debug("M290_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M290_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M290_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M290_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M290_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M290_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M290_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
size_t strlen(char const *const);
void lenvssize(void) {
  const char *const str = "\u2026";
  const size_t len = strlen(str);
  const size_t size = sizeof str;
  const size_t literal_size = sizeof "\u2026";
}


x86 assembly (clang, -O0):
<lenvssize>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x8,-0x18(%rbp)
movq   $0x4,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\E2\80\A6\00"
define void @lenvssize() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i64 3, i64* %2
store i64 8, i64* %3
store i64 4, i64* %4
ret void
}

LLVM IR (-O2):
define void @lenvssize() {
ret void
}
int fun639() { return 639; }


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

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

LLVM IR (-O0):
define i32 @fun639() {
ret i32 639
}

LLVM IR (-O2):
define i32 @fun639() {
ret i32 639
}
void vector_add(double u[], double v[], double w[]) {
  for (int i = 0; i < 3; i++)
    w[i] = u[i] + v[i];
}


x86 assembly (clang, -O0):
<vector_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <vector_add+0x56>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <vector_add+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_add>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rdi),%xmm0
addsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @vector_add(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load double*, double** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = load double*, double** %5
%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 = fadd double %16, %21
%23 = load double*, double** %6
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
br label %27
27: ; preds = %11
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vector_add(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
/* Type definitions */
struct t_config_section {
  int dummy;
};
struct t_config_option {
  int dummy;
};
struct t_config_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_file_option_free(struct t_config_option *);
int /*<<< orphan*/ gui_buffer_notify_set_all();
int config_dogechat_notify_delete_option_cb(void *data,
                                            struct t_config_file *config_file,
                                            struct t_config_section *section,
                                            struct t_config_option *option) {
  (void)data;
  (void)config_file;
  (void)section;
  config_file_option_free(option);
  gui_buffer_notify_set_all();
  return 2;
}


x86 assembly (clang, -O0):
<config_dogechat_notify_delete_option_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <config_file_option_free@plt>
mov    $0x0,%al
call   1030 <gui_buffer_notify_set_all@plt>
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_dogechat_notify_delete_option_cb>:
push   %rax
mov    %rcx,%rdi
call   1040 <config_file_option_free@plt>
xor    %eax,%eax
call   1030 <gui_buffer_notify_set_all@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_file = type { i32 }
%struct.t_config_section = type { i32 }
%struct.t_config_option = type { i32 }
define i32 @config_dogechat_notify_delete_option_cb(i8* %0, %struct.t_config_file* %1, %struct.t_config_section* %2, %struct.t_config_option* %3) {
%5 = alloca i8*
%6 = alloca %struct.t_config_file*
%7 = alloca %struct.t_config_section*
%8 = alloca %struct.t_config_option*
store i8* %0, i8** %5
store %struct.t_config_file* %1, %struct.t_config_file** %6
store %struct.t_config_section* %2, %struct.t_config_section** %7
store %struct.t_config_option* %3, %struct.t_config_option** %8
%9 = load i8*, i8** %5
%10 = load %struct.t_config_file*, %struct.t_config_file** %6
%11 = load %struct.t_config_section*, %struct.t_config_section** %7
%12 = load %struct.t_config_option*, %struct.t_config_option** %8
%13 = call i32 @config_file_option_free(%struct.t_config_option* %12)
%14 = call i32 (...) @gui_buffer_notify_set_all()
ret i32 2
}

LLVM IR (-O2):
%struct.t_config_file = type { i32 }
%struct.t_config_section = type { i32 }
%struct.t_config_option = type { i32 }
define i32 @config_dogechat_notify_delete_option_cb(i8* nocapture readnone %0, %struct.t_config_file* nocapture readnone %1, %struct.t_config_section* nocapture readnone %2, %struct.t_config_option* %3) {
%5 = tail call i32 @config_file_option_free(%struct.t_config_option* %3)
%6 = tail call i32 (...) @gui_buffer_notify_set_all()
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ dodir(char *, int /*<<< orphan*/);
int DOlnlst(void) {
  dodir(".", 0);
  return (0);
}


x86 assembly (clang, -O0):
<DOlnlst>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <dodir@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @DOlnlst() {
%1 = call i32 @dodir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @DOlnlst() {
%1 = tail call i32 @dodir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
double estimate_interconnect_R(double l, double w, double t, double rou) {
  return rou / 100. * l / (w * t);
}


x86 assembly (clang, -O0):
<estimate_interconnect_R>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_interconnect_R>:
divsd  0xef8(%rip),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @estimate_interconnect_R(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+02
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = fdiv double %12, %15
ret double %16
}

LLVM IR (-O2):
define double @estimate_interconnect_R(double %0, double %1, double %2, double %3) {
%5 = fdiv double %3, 1.000000e+02
%6 = fmul double %5, %0
%7 = fmul double %1, %2
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
scalar_t__ strcmp_ci(char *, char *);
int string_ci_gt(char *s1, char *s2, int k) {
  k = 0;
  return strcmp_ci(s1, s2) > 0;
}


x86 assembly (clang, -O0):
<string_ci_gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp_ci@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ci_gt>:
push   %rax
call   1030 <strcmp_ci@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_ci_gt(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp_ci(i8* %7, i8* %8)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_ci_gt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strcmp_ci(i8* %0, i8* %1)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;

/* Variables and functions */
uint8_t aeron_semantic_version_minor(int32_t version) {
  return (uint8_t)((version >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<aeron_semantic_version_minor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @aeron_semantic_version_minor(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
void ri_atomic_dec(int *ptr) {}


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

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

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

LLVM IR (-O2):
define void @ri_atomic_dec(i32* nocapture %0) {
ret void
}
const int f() {}


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
void delMatrix(int **arr, int row) {
  int i = 0;
  for (i = 0; i < row; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<delMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <delMatrix+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <delMatrix+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delMatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int *malloc(int);
int *realloc(int *, int);
int *realloctest1() {
  int *q = malloc(12);
  q = realloc(q, 20);
  return q;
}


x86 assembly (clang, -O0):
<realloctest1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x14,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloctest1>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    $0x14,%esi
pop    %rax
jmp    1040 <realloc@plt>

LLVM IR (-O0):
define i32* @realloctest1() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32* @realloc(i32* %3, i32 20)
store i32* %4, i32** %1
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define i32* @realloctest1() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32* @realloc(i32* %1, i32 20)
ret i32* %2
}
int test_imm_48int8_reg(signed char val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_48int8_reg(i8 signext %0) {
%2 = and i8 %0, 72
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cp_ctype_free();
void ffi_cparser_free(void) { cp_ctype_free(); }


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

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

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

LLVM IR (-O2):
define void @ffi_cparser_free() {
%1 = tail call i32 (...) @cp_ctype_free()
ret void
}
void freeargv(vector) char **vector;
{
  register char **scan;
  if (vector != 0) {
    for (scan = vector; *scan != 0; scan++) {
      free(*scan);
    }
    free(vector);
  }
}


x86 assembly (clang, -O0):
<freeargv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <freeargv+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <freeargv+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <freeargv+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeargv>:
test   %rdi,%rdi
je     1150 <freeargv+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeargv+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeargv+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @freeargv(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %12, %1
ret void
}
/* Type definitions */
struct filter_args_info {
  int dummy;
};

/* Variables and functions */
int filter_cmdline_parser2(int, char **, struct filter_args_info *,
                           int /*<<< orphan*/, int, int);
int filter_cmdline_parser(int argc, char **argv,
                          struct filter_args_info *args_info) {
  return filter_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<filter_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <filter_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <filter_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.filter_args_info = type { i32 }
define i32 @filter_cmdline_parser(i32 %0, i8** %1, %struct.filter_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.filter_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.filter_args_info* %2, %struct.filter_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.filter_args_info*, %struct.filter_args_info** %6
%10 = call i32 @filter_cmdline_parser2(i32 %7, i8** %8, %struct.filter_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.filter_args_info = type { i32 }
define i32 @filter_cmdline_parser(i32 %0, i8** %1, %struct.filter_args_info* %2) {
%4 = tail call i32 @filter_cmdline_parser2(i32 %0, i8** %1, %struct.filter_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int getMinNumOfCoins(int *, int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int coinVals[] = {1, 2, 5};
  int sum = 19;
  int x = getMinNumOfCoins(coinVals, 3, sum);
  printf("\n min coins needed to get sum of  %d are %d \n ", sum, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x13,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x3,%esi
call   1040 <getMinNumOfCoins@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    $0x13,%edx
call   1040 <getMinNumOfCoins@plt>
lea    0xeb7(%rip),%rdi
mov    $0x13,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.coinVals = [3 x i32] [i32 1, i32 2, i32 5]
@.str = [47 x i8] c"\0A min coins needed to get sum of %d are %d \0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x i32]* %2 to i8*
store i32 19, i32* %3
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @getMinNumOfCoins(i32* %6, i32 3, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.coinVals = [3 x i32] [i32 1, i32 2, i32 5]
@.str = [47 x i8] c"\0A min coins needed to get sum of %d are %d \0A \00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @getMinNumOfCoins(i32* %3, i32 3, i32 19)
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 19, i32 %4)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int dcloadsyscall(int, char const *, struct stat *);
int stat(const char *path, struct stat *st) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(12, path, st);
  else
    return -1;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    114b <stat+0x3b>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xc,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <stat+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112d <stat+0x1d>
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 12, i8* %0, %struct.stat* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
int intLoc(int inp, int arr[]) {
  int loc = 0;
  while (1) {
    if (*(arr + loc) == inp) {
      break;
    } else {
      loc++;
    }
  }
  return loc;
}


x86 assembly (clang, -O0):
<intLoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jne    112b <intLoc+0x2b>
jmp    1139 <intLoc+0x39>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <intLoc+0x12>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLoc>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
lea    0x4(%rsi),%rcx
cmp    %edi,(%rsi)
mov    %rcx,%rsi
jne    1110 <intLoc+0x10>
ret

LLVM IR (-O0):
define i32 @intLoc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %2, %18
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %3
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %6
br label %19
15: ; preds = %6
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %18
18: ; preds = %15
br label %6
19: ; preds = %14
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @intLoc(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, %0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Variables and functions */
unsigned int calculateLRC(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int f(char *key, int array_size) {
  unsigned int index;
  index = calculateLRC(key, strlen(key));
  index = index % array_size;
  return (index);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <calculateLRC@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <calculateLRC@plt>
xor    %edx,%edx
div    %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @calculateLRC(i8* %6, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = urem i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @calculateLRC(i8* %0, i32 %3)
%5 = urem i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test49_helper(double, double);
void test49(double d, double e) { test49_helper(d, e); }


x86 assembly (clang, -O0):
<test49>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <test49_helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test49>:
jmp    1030 <test49_helper@plt>

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

LLVM IR (-O2):
define void @test49(double %0, double %1) {
%3 = tail call i32 @test49_helper(double %0, double %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int auto_repeat_mode;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
void set_XKeyboardControl_auto_repeat_mode(void *_p, int _v) {
  ((XKeyboardControl *)_p)->auto_repeat_mode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyboardControl_auto_repeat_mode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyboardControl_auto_repeat_mode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyboardControl_auto_repeat_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int test_imm_99uint16_mem(unsigned short *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_99uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 153
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void invertColors() { printf("\033[7m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[7m\00"
define void @invertColors() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[7m\00"
define void @invertColors() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fabsl(double);
void fixup(double *x) {
  if (fabsl(*x) < 0.0000001)
    *x = 0.0;
}


x86 assembly (clang, -O0):
<fixup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <fabsl@plt>
movaps %xmm0,%xmm1
movsd  0xecc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <fixup+0x39>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup>:
movsd  (%rdi),%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1121 <fixup+0x21>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fixup(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @fabsl(double %4)
%6 = fcmp olt double %5, 0x3E7AD7F29ABCAF48
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load double*, double** %2
store double 0.000000e+00, double* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fixup(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.fabs.f64(double %2)
%4 = fcmp olt double %3, 0x3E7AD7F29ABCAF48
br i1 %4, label %5, label %6
5: ; preds = %1
store double 0.000000e+00, double* %0
br label %6
6: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("setterm [-f color] [-b color]\n");
  printf("\t-f set foreground color\n");
  printf("\t-b set background color\n");
  printf("\tvalid colors: black, red, green, yellow, "
         "blue, magenta, cyan, and white.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"setterm [-f color] [-b color]\0A\00"
@.str.1 = [26 x i8] c"\09-f set foreground color\0A\00"
@.str.2 = [26 x i8] c"\09-b set background color\0A\00"
@.str.3 = [75 x i8] c"\09valid colors: black, red, green, yellow, blue, magenta, cyan, and white.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"setterm [-f color] [-b color]\00"
@str.4 = [25 x i8] c"\09-f set foreground color\00"
@str.5 = [25 x i8] c"\09-b set background color\00"
@str.6 = [74 x i8] c"\09valid colors: black, red, green, yellow, blue, magenta, cyan, and white.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, int);
int q__FreeMemory(int hex) {
  qprintf("*** "
          "_FreeMemory"
          "(%x)\n",
          hex);
  return 0;
}


x86 assembly (clang, -O0):
<q__FreeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q__FreeMemory>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"*** _FreeMemory(%x)\0A\00"
define i32 @q__FreeMemory(i32 %0) {
%2 = tail call i32 @qprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}