xunge/DecIR huggingface dataset:
unsigned hash(char *key) {
  unsigned sum = 0;
  while (*key) {
    sum += *key;
    key++;
  }
  return sum % 20;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <hash+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x14,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash+0x38>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x24,%rdx
shl    $0x2,%edx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = urem i32 %9, 20
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
regx0imm1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = 33; }


x86 assembly (clang, -O0):
<regx0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movw   $0x21,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0imm1_set>:
movslq %edx,%rax
movw   $0x21,(%r8,%rax,2)
ret

LLVM IR (-O0):
define i32 @regx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
store i16 33, i16* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @regx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
store i16 33, i16* %8
ret i32 undef
}
/* Variables and functions */
int RAND_bytes(unsigned char *, int);
int rand_bytes(unsigned char *buf, int num) { return RAND_bytes(buf, num); }


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

x86 assembly (clang, -O2):
<rand_bytes>:
jmp    1030 <RAND_bytes@plt>

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

LLVM IR (-O2):
define i32 @rand_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_bytes(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP200_Permute_Nrounds(void *, int);
void KeccakP200_Permute_18rounds(void *argState) {
  KeccakP200_Permute_Nrounds(argState, 18);
}


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

x86 assembly (clang, -O2):
mov    $0x12,%esi
jmp    1030 <KeccakP200_Permute_Nrounds@plt>

LLVM IR (-O0):
define void @KeccakP200_Permute_18rounds(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @KeccakP200_Permute_Nrounds(i8* %3, i32 18)
ret void
}

LLVM IR (-O2):
define void @KeccakP200_Permute_18rounds(i8* %0) {
%2 = tail call i32 @KeccakP200_Permute_Nrounds(i8* %0, i32 18)
ret void
}
/* Variables and functions */
int slk_refresh();
int wrap_slk_refresh(void) { return slk_refresh(); }


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

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

LLVM IR (-O0):
define i32 @wrap_slk_refresh() {
%1 = call i32 (...) @slk_refresh()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_slk_refresh() {
%1 = tail call i32 (...) @slk_refresh()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun(int a) { printf("%d", a); }


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

x86 assembly (clang, -O2):
<fun>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @fun(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int sqrt(int);
double EDatan(double x) { return (1. / sqrt(1. + x * x)); }


x86 assembly (clang, -O0):
<EDatan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDatan>:
push   %rax
mulsd  %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @EDatan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @sqrt(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @EDatan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call i32 @sqrt(i32 %3)
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
int compare(void *data1, void *data2) { return *(int *)data1 == *(int *)data2; }


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *pretty_name(char *filename) {
  return (strcmp(filename, "-") == 0) ? "standard input" : filename;
}


x86 assembly (clang, -O0):
<pretty_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <pretty_name+0x36>
lea    0xec5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    114e <pretty_name+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xed8(%rip),%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [15 x i8] c"standard input\00"
define i8* @pretty_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i8*, i8** %2
br label %9
9: ; preds = %7, %6
%10 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %6 ], [ %8, %7 ]
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [15 x i8] c"standard input\00"
define i8* @pretty_name(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0
ret i8* %4
}
void my_function() { return; }


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

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

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

LLVM IR (-O2):
define void @my_function() {
ret void
}
/* Variables and functions */
int convert(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Please input an integer:");
  scanf("%d", &n);
  printf("The result is %d\n", convert(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <convert@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @convert(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @convert(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_dup(int /*<<< orphan*/ const *);
struct stack_st_OPENSSL_STRING *
sk_OPENSSL_STRING_dup(const struct stack_st_OPENSSL_STRING *sk) {
  return (struct stack_st_OPENSSL_STRING *)OPENSSL_sk_dup(
      (const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_dup>:
jmp    1030 <OPENSSL_sk_dup@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define %struct.stack_st_OPENSSL_STRING* @sk_OPENSSL_STRING_dup(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_STRING*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %2
%3 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_STRING* %3 to i32*
%5 = call i64 @OPENSSL_sk_dup(i32* %4)
%6 = inttoptr i64 %5 to %struct.stack_st_OPENSSL_STRING*
ret %struct.stack_st_OPENSSL_STRING* %6
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define %struct.stack_st_OPENSSL_STRING* @sk_OPENSSL_STRING_dup(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%3 = tail call i64 @OPENSSL_sk_dup(i32* %2)
%4 = inttoptr i64 %3 to %struct.stack_st_OPENSSL_STRING*
ret %struct.stack_st_OPENSSL_STRING* %4
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void threadExit(void *dummy) { pthread_exit(NULL); }


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

x86 assembly (clang, -O2):
<threadExit>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @threadExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
define void @threadExit(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct icmphdr {
  int dummy;
};

/* Variables and functions */
size_t icmpv4_get_header_size(const uint8_t *icmpv4_segment) {
  return sizeof(struct icmphdr);
}


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

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

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

LLVM IR (-O2):
define i64 @icmpv4_get_header_size(i32* nocapture readnone %0) {
ret i64 4
}
long int clear_bits(long int value, long int flag) { return value & ~flag; }


x86 assembly (clang, -O0):
<clear_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bits>:
mov    %rsi,%rax
not    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @clear_bits(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @clear_bits(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = and i64 %3, %0
ret i64 %4
}
int dst_hmac_md5_init() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dst_hmac_md5_init() {
ret i32 0
}
void swift_initEnumValueWitnessTableSinglePayload(void) {}


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

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

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

LLVM IR (-O2):
define void @swift_initEnumValueWitnessTableSinglePayload() {
ret void
}
long long load64_reverse_1(long long *p) { return __builtin_bswap64(*p); }


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

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

LLVM IR (-O0):
define i64 @load64_reverse_1(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @llvm.bswap.i64(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @load64_reverse_1(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswxdigit(int /*<<< orphan*/);
int iswxdigit_l(wint_t c, locale_t l) { return iswxdigit(c); }


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

x86 assembly (clang, -O2):
<iswxdigit_l>:
jmp    1030 <iswxdigit@plt>

LLVM IR (-O0):
define i32 @iswxdigit_l(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 = call i32 @iswxdigit(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @iswxdigit_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswxdigit(i32 %0)
ret i32 %3
}
/* Variables and functions */
int rand();
void fillRand(int *arr, size_t length) {
  for (size_t i = 0; i < length; i++)
    arr[i] = rand() % 100;
}


x86 assembly (clang, -O0):
<fillRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <fillRand+0x51>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fillRand+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRand>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     115f <fillRand+0x4f>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fillRand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fillRand(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 100
%13 = load i32*, i32** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i32, i32* %13, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fillRand(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
/* Type definitions */
struct functionCall {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assignValues(struct functionCall *, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
void initArray(struct functionCall *array, int n) {
  int i;
  for (i = 0; i < n; i++) {
    assignValues(array, i, 0, 0, 0);
  }
}


x86 assembly (clang, -O0):
<initArray>:
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    1155 <initArray+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <assignValues@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <initArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initArray>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1138 <initArray+0x28>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <assignValues@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <initArray+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.functionCall = type { i32 }
define void @initArray(%struct.functionCall* %0, i32 %1) {
%3 = alloca %struct.functionCall*
%4 = alloca i32
%5 = alloca i32
store %struct.functionCall* %0, %struct.functionCall** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load %struct.functionCall*, %struct.functionCall** %3
%12 = load i32, i32* %5
%13 = call i32 @assignValues(%struct.functionCall* %11, i32 %12, i32 0, i32 0, i32 0)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.functionCall = type { i32 }
define void @initArray(%struct.functionCall* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @assignValues(%struct.functionCall* %0, i32 %5, i32 0, i32 0, i32 0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("My first C program\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"My first C program\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Screen;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ *DefaultVisualOfScreen(int /*<<< orphan*/ *);
Visual *get_visual_resource(Screen *screen, char *name, char *class,
                            Bool prefer_writable_cells) {
  return DefaultVisualOfScreen(screen);
}


x86 assembly (clang, -O0):
<get_visual_resource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <DefaultVisualOfScreen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_visual_resource>:
jmp    1030 <DefaultVisualOfScreen@plt>

LLVM IR (-O0):
define i32* @get_visual_resource(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32* @DefaultVisualOfScreen(i32* %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @get_visual_resource(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32* @DefaultVisualOfScreen(i32* %0)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ g_free(char *);
char *g_strdup(char const *);
int set_string(char **in_str, const char *in) {
  if (in_str == 0) {
    return 0;
  }
  if (*in_str)
    g_free(*in_str);
  *in_str = g_strdup(in);
  return 0;
}


x86 assembly (clang, -O0):
<set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <set_string+0x27>
movl   $0x0,-0x4(%rbp)
jmp    117b <set_string+0x5b>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1161 <set_string+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <g_free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <g_strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_string>:
test   %rdi,%rdi
je     114e <set_string+0x2e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     113c <set_string+0x1c>
call   1030 <g_free@plt>
mov    %r14,%rdi
call   1040 <g_strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @set_string(i8** %0, i8* %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @g_free(i8* %5)
br label %9
9: ; preds = %7, %4
%10 = tail call i8* @g_strdup(i8* %1)
store i8* %10, i8** %0
br label %11
11: ; preds = %2, %9
ret i32 0
}
int main(int argc, const char *argv[]) { return *argv[0]; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rax
movsbl (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
int valid_side(const int side) { return (side == 0 || side == 1); }


x86 assembly (clang, -O0):
<valid_side>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <valid_side+0x20>
cmpl   $0x1,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_side>:
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_side(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
int cmp(const void *p, const void *q) {
  long long int *a = (long long int *)p;
  long long int *b = (long long int *)q;
  return (*a) - (*b);
}


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
double adifd(double, double);
int aeq(double v1, double v2, double acr) {
  double ad = adifd(v1, v2);
  if (ad > acr) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<aeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <adifd@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1157 <aeq+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115e <aeq+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeq>:
push   %rax
movsd  %xmm2,(%rsp)
call   1030 <adifd@plt>
xor    %eax,%eax
ucomisd (%rsp),%xmm0
setbe  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aeq(double %0, double %1, double %2) {
%4 = alloca i32
%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
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @adifd(double %9, double %10)
store double %11, double* %8
%12 = load double, double* %8
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %17
16: ; preds = %3
store i32 1, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @aeq(double %0, double %1, double %2) {
%4 = tail call double @adifd(double %0, double %1)
%5 = fcmp ule double %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned int const UINT32_C(int);
int /*<<< orphan*/ W32(int, unsigned int const);
void gpio_set(const unsigned pin, const int high) {
  const unsigned index = pin >> 5;
  const uint32_t bit = UINT32_C(1) << (pin & 31);
  if (high) {
    W32(((0x3F000000 + 0x200000) + 0x1C) + index * 4, bit);
  } else {
    W32(((0x3F000000 + 0x200000) + 0x28) + index * 4, bit);
  }
}


x86 assembly (clang, -O0):
<gpio_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1040 <UINT32_C@plt>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116f <gpio_set+0x4f>
mov    -0xc(%rbp),%edi
shl    $0x2,%edi
add    $0x3f20001c,%edi
mov    -0x10(%rbp),%esi
call   1030 <W32@plt>
jmp    1183 <gpio_set+0x63>
mov    -0xc(%rbp),%edi
shl    $0x2,%edi
add    $0x3f200028,%edi
mov    -0x10(%rbp),%esi
call   1030 <W32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <UINT32_C@plt>
mov    %ebx,%ecx
shl    %cl,%eax
shr    $0x5,%ebx
test   %ebp,%ebp
lea    0x3f200028(,%rbx,4),%ecx
lea    0x3f20001c(,%rbx,4),%edi
cmove  %ecx,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <W32@plt>

LLVM IR (-O0):
define void @gpio_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = lshr i32 %7, 5
store i32 %8, i32* %5
%9 = call i32 @UINT32_C(i32 1)
%10 = load i32, i32* %3
%11 = and i32 %10, 31
%12 = shl i32 %9, %11
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i32, i32* %5
%17 = mul i32 %16, 4
%18 = add i32 1059061788, %17
%19 = load i32, i32* %6
%20 = call i32 @W32(i32 %18, i32 %19)
br label %27
21: ; preds = %2
%22 = load i32, i32* %5
%23 = mul i32 %22, 4
%24 = add i32 1059061800, %23
%25 = load i32, i32* %6
%26 = call i32 @W32(i32 %24, i32 %25)
br label %27
27: ; preds = %21, %15
ret void
}

LLVM IR (-O2):
define void @gpio_set(i32 %0, i32 %1) {
%3 = tail call i32 @UINT32_C(i32 1)
%4 = and i32 %0, 31
%5 = shl i32 %3, %4
%6 = icmp eq i32 %1, 0
%7 = lshr i32 %0, 3
%8 = and i32 %7, 536870908
%9 = select i1 %6, i32 1059061800, i32 1059061788
%10 = add nuw nsw i32 %8, %9
%11 = tail call i32 @W32(i32 %10, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, j = -2;
  for (;;) {
    i *= 3;
    j++;
    if (i > 30)
      break;
  }
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xfffffffe,-0xc(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jle    114c <main+0x3c>
jmp    1151 <main+0x41>
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           char const *, unsigned int);
void stic_assert_false(int test, const char *function, const char file[],
                       unsigned int line) {
  stic_simple_test_result(!test, "Should have been false", function, file,
                          line);
}


x86 assembly (clang, -O0):
<stic_assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xeb9(%rip),%rsi
call   1030 <stic_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_false>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xed9(%rip),%rsi
mov    %eax,%edi
jmp    1030 <stic_simple_test_result@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Should have been false\00"
define void @stic_assert_false(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @stic_simple_test_result(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Should have been false\00"
define void @stic_assert_false(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @stic_simple_test_result(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
ret void
}
void Vprintf(fmt, a, b, c, d, e, f, g, h) char *fmt;
{
  char buf[512];
  sprintf(buf, fmt, a, b, c, d, e, f, g, h);
  VPutString(buf);
}


x86 assembly (clang, -O0):
<Vprintf>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x248,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    -0x230(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%ebx
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x230(%rbp),%rdi
mov    $0x0,%al
call   1030 <VPutString@plt>
add    $0x248,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vprintf>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x220(%rsp),%r11d
mov    0x228(%rsp),%r14d
mov    0x230(%rsp),%r15d
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
push   %r15
push   %r14
push   %r11
push   %r10
call   1040 <sprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <VPutString@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Vprintf(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca [512 x i8]
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%21 = load i8*, i8** %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load i32, i32* %15
%27 = load i32, i32* %16
%28 = load i32, i32* %17
%29 = load i32, i32* %18
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %20, i8* %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28, i32 %29)
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @VPutString to i32 (i8*, ...)*)(i8* %31)
ret void
}

LLVM IR (-O2):
define void @Vprintf(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca [512 x i8]
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8)
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @VPutString to i32 (i8*, ...)*)(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdout;
void gotoxy(int row, int col) {
  printf("\033[%d;%dH", row, col);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
@stdout = global i32 0
define void @gotoxy(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 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
@stdout = global i32 0
define void @gotoxy(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ red_max;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_red_max(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->red_max;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XStandardColormap_red_max(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct pot {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ec_run(char *, int);
scalar_t__ pot_next(struct pot *);
int /*<<< orphan*/ pot_reject(struct pot *);
char *scene_file(struct pot *);
void cmd_run(struct pot *pot) {
  char *ecs = scene_file(pot);
  while (pot_next(pot))
    pot_reject(pot);
  ec_run(ecs, -1);
}


x86 assembly (clang, -O0):
<cmd_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <scene_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pot_next@plt>
cmp    $0x0,%rax
je     117a <cmd_run+0x3a>
mov    -0x8(%rbp),%rdi
call   1060 <pot_reject@plt>
jmp    1159 <cmd_run+0x19>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
call   1040 <ec_run@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_run>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <scene_file@plt>
mov    %rax,%r14
nop
mov    %rbx,%rdi
call   1030 <pot_next@plt>
test   %rax,%rax
je     1167 <cmd_run+0x27>
mov    %rbx,%rdi
call   1060 <pot_reject@plt>
jmp    1150 <cmd_run+0x10>
mov    %r14,%rdi
mov    $0xffffffff,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ec_run@plt>

LLVM IR (-O0):
%struct.pot = type { i32 }
define void @cmd_run(%struct.pot* %0) {
%2 = alloca %struct.pot*
%3 = alloca i8*
store %struct.pot* %0, %struct.pot** %2
%4 = load %struct.pot*, %struct.pot** %2
%5 = call i8* @scene_file(%struct.pot* %4)
store i8* %5, i8** %3
br label %6
6: ; preds = %10, %1
%7 = load %struct.pot*, %struct.pot** %2
%8 = call i64 @pot_next(%struct.pot* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.pot*, %struct.pot** %2
%12 = call i32 @pot_reject(%struct.pot* %11)
br label %6
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = call i32 @ec_run(i8* %14, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.pot = type { i32 }
define void @cmd_run(%struct.pot* %0) {
%2 = tail call i8* @scene_file(%struct.pot* %0)
%3 = tail call i64 @pot_next(%struct.pot* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = tail call i32 @pot_reject(%struct.pot* %0)
%7 = tail call i64 @pot_next(%struct.pot* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
%10 = tail call i32 @ec_run(i8* %2, i32 -1)
ret void
}
void movIC(int *src, char *dst) { *dst = *src; }


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

x86 assembly (clang, -O2):
<movIC>:
mov    (%rdi),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @movIC(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
store i8 %7, i8* %8
ret void
}

LLVM IR (-O2):
define void @movIC(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
ret void
}