xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M129_f(char *s) {
  debug("M129_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M129_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):
<M129_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"M129_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M129_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"M129_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M129_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 */
int /*<<< orphan*/ stuff(int, int, int);
void foo(int a, int b, int c) {
  ({
    stuff(a, b, c);
    a;
  });
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <stuff@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @stuff(i32 %0, i32 %1, i32 %2)
ret void
}
void i2d_OTHERNAME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OTHERNAME() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void mask_set(uint32_t *mask, int num) { mask[num / 32] |= 1 << (num % 32); }


x86 assembly (clang, -O0):
<mask_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x1f(%rcx),%edx
test   %esi,%esi
cmovns %ecx,%edx
sar    $0x5,%edx
movslq %edx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @mask_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 32
%7 = shl i32 1, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %7
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @mask_set(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = sdiv i32 %1, 32
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %4
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void talk(char *msg) { printf("I'm a dog, I talk my language %s\n", msg); }


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

x86 assembly (clang, -O2):
<talk>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"I'm a dog, I talk my language %s\0A\00"
define void @talk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"I'm a dog, I talk my language %s\0A\00"
define void @talk(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int statistics_weighted_double_compare(const void *this, const void *that) {
  double *a = (double *)this;
  double *b = (double *)that;
  if (*a < *b)
    return -1;
  else if (*a == *b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<statistics_weighted_double_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <statistics_weighted_double_compare+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <statistics_weighted_double_compare+0x71>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    116a <statistics_weighted_double_compare+0x6a>
jp     116a <statistics_weighted_double_compare+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <statistics_weighted_double_compare+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<statistics_weighted_double_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @statistics_weighted_double_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %26
25: ; preds = %18
store i32 1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @statistics_weighted_double_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp une double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int __attribute__((no)) foo(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, void *);
void hello(void *cntx) { kprintf("Hello %x\n", cntx); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <kprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %x\0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *yr_strdup(const char *s) { return strdup(s); }


x86 assembly (clang, -O0):
<yr_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):
<yr_strdup>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @yr_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* @yr_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
int isspace(int ch) { return ch == ' ' || (unsigned)ch - '\t' < 5; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1125 <isspace+0x25>
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
cmp    $0x5,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 %6, 9
%8 = icmp ult i32 %7, 5
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double fabs(double);
double fmod(double, double);
double tri(double x) {
  return fabs(fmod(x + 4.71238898038468985769, 6.28318530717958647693) /
                  1.57079632679489661923 -
              2.0) -
         1.0;
}


x86 assembly (clang, -O0):
<tri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xefb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0xeda(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tri>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
divsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
andpd  0xef2(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tri(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x4012D97C7F3321D2
%5 = call double @fmod(double %4, double 0x401921FB54442D18)
%6 = fdiv double %5, 0x3FF921FB54442D18
%7 = fsub double %6, 2.000000e+00
%8 = call double @llvm.fabs.f64(double %7)
%9 = fsub double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @tri(double %0) {
%2 = fadd double %0, 0x4012D97C7F3321D2
%3 = tail call double @fmod(double %2, double 0x401921FB54442D18)
%4 = fdiv double %3, 0x3FF921FB54442D18
%5 = fadd double %4, -2.000000e+00
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = fadd double %6, -1.000000e+00
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ inverse_2x2(double **, double **);
int /*<<< orphan*/ inverse_3x3(double **, double **);
void inverse(int n, double **inp, double **out) {
  switch (n) {
  case 2:
    inverse_2x2(inp, out);
    break;
  case 3:
    inverse_3x3(inp, out);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2,%eax
je     1158 <inverse+0x38>
jmp    1147 <inverse+0x27>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     116a <inverse+0x4a>
jmp    117c <inverse+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <inverse_2x2@plt>
jmp    1181 <inverse+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <inverse_3x3@plt>
jmp    1181 <inverse+0x61>
jmp    1181 <inverse+0x61>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
cmp    $0x3,%edi
je     1135 <inverse+0x15>
cmp    $0x2,%edi
jne    1140 <inverse+0x20>
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1040 <inverse_2x2@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <inverse_3x3@plt>
ret

LLVM IR (-O0):
define void @inverse(i32 %0, double** %1, double** %2) {
%4 = alloca i32
%5 = alloca double**
%6 = alloca double**
store i32 %0, i32* %4
store double** %1, double*** %5
store double** %2, double*** %6
%7 = load i32, i32* %4
switch i32 %7, label %16 [
i32 2, label %8
i32 3, label %12
]
8: ; preds = %3
%9 = load double**, double*** %5
%10 = load double**, double*** %6
%11 = call i32 @inverse_2x2(double** %9, double** %10)
br label %17
12: ; preds = %3
%13 = load double**, double*** %5
%14 = load double**, double*** %6
%15 = call i32 @inverse_3x3(double** %13, double** %14)
br label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %12, %8
ret void
}

LLVM IR (-O2):
define void @inverse(i32 %0, double** %1, double** %2) {
switch i32 %0, label %8 [
i32 2, label %4
i32 3, label %6
]
4: ; preds = %3
%5 = tail call i32 @inverse_2x2(double** %1, double** %2)
br label %8
6: ; preds = %3
%7 = tail call i32 @inverse_3x3(double** %1, double** %2)
br label %8
8: ; preds = %3, %6, %4
ret void
}
void SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess = [59 x i8] c"SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess\00"
define void @SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @__func__.SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess = [59 x i8] c"SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess\00"
define void @SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @__func__.SteamAPI_ISteamClient_Set_SteamAPI_CPostAPIResultInProcess, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADC_Six_In(void) {
  (*((volatile uint32_t *)0x400380A0)) =
      ((*((volatile uint32_t *)0x400380A0)) & 0xFFFFFFF0) + 8;
  uint32_t data;
  (*((volatile uint32_t *)0x40038028)) = 0x0008;
  while (((*((volatile uint32_t *)0x40038004)) & 0x08) == 0) {
  };
  data = (*((volatile uint32_t *)0x400380A8)) & 0xFFF;
  (*((volatile uint32_t *)0x4003800C)) = 0x0008;
  return data;
}


x86 assembly (clang, -O0):
<ADC_Six_In>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400380a0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
add    $0x8,%ecx
mov    $0x400380a0,%eax
mov    %ecx,(%rax)
mov    $0x40038028,%eax
movl   $0x8,(%rax)
mov    $0x40038004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    113b <ADC_Six_In+0x3b>
jmp    1123 <ADC_Six_In+0x23>
mov    $0x400380a8,%eax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x4003800c,%eax
movl   $0x8,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Six_In>:
mov    0x400380a0,%eax
and    $0xfffffff0,%eax
or     $0x8,%eax
mov    %eax,0x400380a0
movl   $0x8,0x40038028
nop
testl  $0x8,0x40038004
je     1120 <ADC_Six_In+0x20>
mov    $0xfff,%eax
and    0x400380a8,%eax
movl   $0x8,0x4003800c
ret

LLVM IR (-O0):
define i32 @ADC_Six_In() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%3 = and i32 %2, -16
%4 = add i32 %3, 8
store volatile i32 %4, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%7 = and i32 %6, 8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%12 = and i32 %11, 4095
store i32 %12, i32* %1
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @ADC_Six_In() {
%1 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%2 = and i32 %1, -16
%3 = or i32 %2, 8
store volatile i32 %3, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%10 = and i32 %9, 4095
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
ret i32 %10
}
void br_multicast_init(struct net_bridge *br) {}


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

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

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

LLVM IR (-O2):
%struct.net_bridge = type opaque
define void @br_multicast_init(%struct.net_bridge* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  int x;
  f(x);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void sleep_ms(unsigned int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<sleep_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sleep_ms(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  int x;
  x = 5;
  int *p;
  p = &x;
  printf("x variable: %x", x);
  printf("\n");
  printf("x variable location: %p", p);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%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
movl   $0x5,0x4(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec2(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"x variable: %x\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [24 x i8] c"x variable location: %p\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 5, i32* %1
store i32* %1, i32** %2
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"x variable: %x\00"
@.str.2 = [24 x i8] c"x variable location: %p\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = tail call i32 @putchar(i32 10)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
void isStillOpen(void) { printPrivate("That is still open.\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"That is still open.\0A\00"
define void @isStillOpen() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"That is still open.\0A\00"
define void @isStillOpen() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TopDownSplitMerge(int *, int /*<<< orphan*/, int, int *);
void TopDownMergeSort(int *A, int *B, int n) { TopDownSplitMerge(A, 0, n, B); }


x86 assembly (clang, -O0):
<TopDownMergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <TopDownSplitMerge@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @TopDownMergeSort(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @TopDownSplitMerge(i32* %0, i32 0, i32 %2, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hook_signal_send(char *, char *, int /*<<< orphan*/ *);
void gui_nicklist_changed_signal() {
  hook_signal_send("nicklist_changed", "string", NULL);
}


x86 assembly (clang, -O0):
<gui_nicklist_changed_signal>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <hook_signal_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_nicklist_changed_signal>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <hook_signal_send@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"nicklist_changed\00"
@.str.1 = [7 x i8] c"string\00"
define void @gui_nicklist_changed_signal() {
%1 = call i32 @hook_signal_send(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"nicklist_changed\00"
@.str.1 = [7 x i8] c"string\00"
define void @gui_nicklist_changed_signal() {
%1 = tail call i32 @hook_signal_send(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
void chkend(void) {
  int i;
  i = 0;
}


x86 assembly (clang, -O0):
<chkend>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @chkend() {
ret void
}
int main() {
  double c = 1.2;
  short int a = 1;
  a = c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movabs $0x3ff3333333333333,%rax
33 f3 3f
mov    %rax,-0x8(%rbp)
movw   $0x1,-0xa(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0xa(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca i16
store double 1.200000e+00, double* %1
store i16 1, i16* %2
%3 = load double, double* %1
%4 = fptosi double %3 to i16
store i16 %4, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int check_ucn(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ucn[13] = {0};
  scanf("%s", ucn);
  int is_valid_ucn = check_ucn(ucn, "bg");
  printf("%d\n", is_valid_ucn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1040 <memset@plt>
lea    -0x11(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x11(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1060 <check_ucn@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x5(%rsp)
movq   $0x0,(%rsp)
lea    0xeb3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <check_ucn@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"bg\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check_ucn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcatMia(char *, char *, char *);
void makeDotTxt(char *dst, char *src) { strcatMia(dst, src, ".txt"); }


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

x86 assembly (clang, -O2):
<makeDotTxt>:
lea    0xee9(%rip),%rdx
jmp    1030 <strcatMia@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".txt\00"
define void @makeDotTxt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcatMia(i8* %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".txt\00"
define void @makeDotTxt(i8* %0, i8* %1) {
%3 = tail call i32 @strcatMia(i8* %0, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void X509at_get_attr_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509at_get_attr_by_NID() {
ret void
}
void test_pointer_int(int *a) {
  int temp = *a;
  int double_temp = temp * 2;
  *a = double_temp;
}


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

x86 assembly (clang, -O2):
<test_pointer_int>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @test_pointer_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 2
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @test_pointer_int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prouts(char *);
int /*<<< orphan*/ skip(int);
void stars(void) {
  prouts("******************************************************");
  skip(1);
}


x86 assembly (clang, -O0):
<stars>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <prouts@plt>
mov    $0x1,%edi
call   1030 <skip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stars>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <prouts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <skip@plt>

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

LLVM IR (-O2):
@.str = [55 x i8] c"******************************************************\00"
define void @stars() {
%1 = tail call i32 @prouts(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @skip(i32 1)
ret void
}
void foo_1_2_1_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_1_2_2_1() {
ret void
}
unsigned int bmax_uint(unsigned int a, unsigned int b) {
  return (a > b ? a : b);
}


x86 assembly (clang, -O0):
<bmax_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <bmax_uint+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <bmax_uint+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmax_uint>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bmax_uint(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t wspr_calc_parity(uint32_t x) {
  x ^= x >> 16;
  x ^= x >> 8;
  x ^= x >> 4;
  x ^= x >> 2;
  x ^= x >> 1;
  return x & 1;
}


x86 assembly (clang, -O0):
<wspr_calc_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wspr_calc_parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @wspr_calc_parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 2
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 1
%21 = load i32, i32* %2
%22 = xor i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = and i32 %23, 1
ret i32 %24
}

LLVM IR (-O2):
define i32 @wspr_calc_parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 8
%5 = xor i32 %4, %3
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = ashr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
ret i32 %12
}
int ft_isspace(const char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1158 <ft_isspace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
jne    1164 <ft_isspace+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ft_isspace+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <ft_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <ft_isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct kdres {
  int dummy;
};

/* Variables and functions */
void *kd_res_item(struct kdres *, int /*<<< orphan*/);
void *kd_res_item_data(struct kdres *set) { return kd_res_item(set, 0); }


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

x86 assembly (clang, -O2):
<kd_res_item_data>:
xor    %esi,%esi
jmp    1030 <kd_res_item@plt>

LLVM IR (-O0):
%struct.kdres = type { i32 }
define i8* @kd_res_item_data(%struct.kdres* %0) {
%2 = alloca %struct.kdres*
store %struct.kdres* %0, %struct.kdres** %2
%3 = load %struct.kdres*, %struct.kdres** %2
%4 = call i8* @kd_res_item(%struct.kdres* %3, i32 0)
ret i8* %4
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
define i8* @kd_res_item_data(%struct.kdres* %0) {
%2 = tail call i8* @kd_res_item(%struct.kdres* %0, i32 0)
ret i8* %2
}
void free_str_array(char **arr, int len) {
  int i;
  for (i = 0; i < len; i++) {
    free(arr[i]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_str_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_str_array+0x41>
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    1126 <free_str_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_str_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_str_array+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 <free_str_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_str_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int isspace(const char c) {
  return (c == ' ') || (c == '\t') || (c == '\r') || (c == '\n');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <isspace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%dil
ja     1120 <isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <isspace+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int atoi(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, void *, void *);
int /*<<< orphan*/ pthread_self();
void my_free(void *arg) {
  printf("[%lu] freeing 0x%x: %s\n", pthread_self(), arg, arg);
  int n = atoi(arg);
  free(arg);
}


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %rbx,%rcx
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"[%lu] freeing 0x%x: %s\0A\00"
define void @my_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @pthread_self()
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5, i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"[%lu] freeing 0x%x: %s\0A\00"
define void @my_free(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0, i8* %0)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
void *malloc(int);
void *realloc(void *, int);
int main(int argc, char **argv) {
  void *p;
  p = malloc(1024);
  p = realloc(p, 2048);
  free(p);
  p = calloc(2, 2);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x800,%esi
call   1060 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x2,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    $0x800,%esi
call   1060 <realloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 1024)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i8* @realloc(i8* %8, i32 2048)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @free(i8* %10)
%12 = call i8* @calloc(i32 2, i32 2)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%4 = tail call i8* @realloc(i8* %3, i32 2048)
%5 = tail call i32 @free(i8* %4)
%6 = tail call dereferenceable_or_null(4) i8* @calloc(i32 2, i32 2)
%7 = tail call i32 @free(i8* %6)
ret i32 0
}