xunge/DecIR huggingface dataset:
/* Variables and functions */
float glfwGetTime();
double getMilliseconds() { return glfwGetTime() * 1000.0f; }


x86 assembly (clang, -O0):
<getMilliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <glfwGetTime@plt>
movss  0xedd(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMilliseconds>:
push   %rax
xor    %eax,%eax
call   1030 <glfwGetTime@plt>
mulss  0xee0(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getMilliseconds() {
%1 = call float (...) @glfwGetTime()
%2 = fmul float %1, 1.000000e+03
%3 = fpext float %2 to double
ret double %3
}

LLVM IR (-O2):
define double @getMilliseconds() {
%1 = tail call float (...) @glfwGetTime()
%2 = fmul float %1, 1.000000e+03
%3 = fpext float %2 to double
ret double %3
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n1 = 0;
  printf("Digite um numero: ");
  scanf("%d", &n1);
  printf("\nO fatorial de %d eh %d \n", n1, fatorial(n1));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fatorial@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AO fatorial de %d eh %d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AO fatorial de %d eh %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *r_str_iconv(char *, int /*<<< orphan*/ *);
int main() {
  char *str = r_str_iconv("hellç", NULL);
  printf("(((%s)))\n", str);
  free(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <r_str_iconv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <r_str_iconv@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hell\C3\A7\00"
@.str.1 = [10 x i8] c"(((%s)))\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @r_str_iconv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hell\C3\A7\00"
@.str.1 = [10 x i8] c"(((%s)))\0A\00"
define i32 @main() {
%1 = tail call i8* @r_str_iconv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Omega_Right(int value) {
  if (value) {
    cpc_key_press(0x53);
  } else {
    cpc_key_unpress(0x53);
  };
}


x86 assembly (clang, -O0):
<Joy_Omega_Right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Omega_Right+0x24>
mov    $0x53,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Omega_Right+0x2e>
mov    $0x53,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Omega_Right>:
test   %edi,%edi
je     112e <Joy_Omega_Right+0xe>
mov    $0x53,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x53,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Omega_Right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 83)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 83)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Omega_Right(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 83)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 83)
br label %7
7: ; preds = %5, %3
ret void
}
void outw(unsigned short v, unsigned short port) {
  asm volatile("outw %0,%1" : : "a"(v), "dN"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $0,$1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
void slashcharclass2NWHITESPACE() {}


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

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

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

LLVM IR (-O2):
define void @slashcharclass2NWHITESPACE() {
ret void
}
char am(int i) {
  static const char Am[] = "ACDEFGHIKLMNPQRSTVWY*";
  return Am[i];
}


x86 assembly (clang, -O0):
<am>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@am.Am = internal constant [22 x i8] c"ACDEFGHIKLMNPQRSTVWY*\00"
define signext i8 @am(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [22 x i8], [22 x i8]* @am.Am, i64 0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
@am.Am = internal unnamed_addr constant [22 x i8] c"ACDEFGHIKLMNPQRSTVWY*\00"
define signext i8 @am(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [22 x i8], [22 x i8]* @am.Am, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
void foo322(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo322(i32 %0) {
ret void
}
/* Variables and functions */
unsigned int __blsi_u32(unsigned int);
unsigned int test__blsi_u32(unsigned int __X) { return __blsi_u32(__X); }


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

x86 assembly (clang, -O2):
<test__blsi_u32>:
jmp    1030 <__blsi_u32@plt>

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

LLVM IR (-O2):
define i32 @test__blsi_u32(i32 %0) {
%2 = tail call i32 @__blsi_u32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int ecma_DaysInYear(int);
int ecma_IsLeapYear(int year) { return ecma_DaysInYear(year) == 366; }


x86 assembly (clang, -O0):
<ecma_IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ecma_DaysInYear@plt>
cmp    $0x16e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecma_IsLeapYear>:
push   %rax
call   1030 <ecma_DaysInYear@plt>
xor    %ecx,%ecx
cmp    $0x16e,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ecma_IsLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ecma_DaysInYear(i32 %3)
%5 = icmp eq i32 %4, 366
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ecma_IsLeapYear(i32 %0) {
%2 = tail call i32 @ecma_DaysInYear(i32 %0)
%3 = icmp eq i32 %2, 366
%4 = zext i1 %3 to i32
ret i32 %4
}
void ASN1_verify(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_verify() {
ret void
}
char *edfio_version(void) {
  return ("edfio : V2.42 Peter Boesecke 2012-08-30");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"edfio : V2.42 Peter Boesecke 2012-08-30\00"
define i8* @edfio_version() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [40 x i8] c"edfio : V2.42 Peter Boesecke 2012-08-30\00"
define i8* @edfio_version() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}
OP(fd, f1) { op_f1(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f1()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int x;
  printf("hello world\n");
  x = 0;
  printf("x = %d\n", x);
}


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

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

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"x = %d\0A\00"
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ b_clear_screen();
int /*<<< orphan*/ hang();
void main() {
  b_clear_screen();
  hang();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <b_clear_screen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hang@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @b_clear_screen()
%2 = call i32 (...) @hang()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @b_clear_screen()
%2 = tail call i32 (...) @hang()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void dary_print(double *a, size_t n) {
  size_t i;
  for (i = 0; i < n; i++)
    printf("% f\n", a[i]);
}


x86 assembly (clang, -O0):
<dary_print>:
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    1160 <dary_print+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <dary_print+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dary_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1147 <dary_print+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dary_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"% f\0A\00"
define void @dary_print(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %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 = load double*, double** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %14)
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):
@.str = [5 x i8] c"% f\0A\00"
define void @dary_print(double* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *no_malloc(size_t x) {
  void *p = malloc(x);
  if (p)
    exit(-1);
  return p;
}


x86 assembly (clang, -O0):
<no_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <no_malloc+0x2e>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_malloc>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @no_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @no_malloc(i64 %0) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort_int(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int a[] = {3, 5, 4, 3, 3, 2, 1, 0};
  int count = sizeof(a, sizeof(a[0]));
  print_array(a, count);
  insertion_sort_int(a, count);
  print_array(a, count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print_array@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <insertion_sort_int@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insertion_sort_int@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 3, i32 5, i32 4, i32 3, i32 3, i32 2, i32 1, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @print_array(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @insertion_sort_int(i32* %8, i32 %9)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @print_array(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 3, i32 5, i32 4, i32 3, i32 3, i32 2, i32 1, i32 0]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 8)
%5 = call i32 @insertion_sort_int(i32* %3, i32 8)
%6 = call i32 @print_array(i32* %3, i32 8)
ret i32 0
}
int tsrand_test(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tsrand_test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int iface1_constructor(void *context) {
  printf("A - version 0 constructor context %p\n", context);
  return (0);
}


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

x86 assembly (clang, -O2):
<iface1_constructor>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"A - version 0 constructor context %p\0A\00"
define i32 @iface1_constructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"A - version 0 constructor context %p\0A\00"
define i32 @iface1_constructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void eq_char(int line, int expected, int got) {
  if (expected != got)
    error("line %d: '%c' expected, but got '%c'", line, expected, got);
}


x86 assembly (clang, -O0):
<eq_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1144 <eq_char+0x34>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_char>:
mov    %edx,%ecx
mov    %esi,%edx
cmp    %ecx,%esi
jne    1119 <eq_char+0x9>
ret
mov    %edi,%esi
lea    0xede(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"line %d: '%c' expected, but got '%c'\00"
define void @eq_char(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* %5
%8 = load i32, i32* %6
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
br label %15
15: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"line %d: '%c' expected, but got '%c'\00"
define void @eq_char(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
void f2(void) {
  char buf[1000];
  int i;
  for (i = 0; i < sizeof(buf); i++)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
movl   $0x0,-0x3f4(%rbp)
movslq -0x3f4(%rbp),%rax
cmp    $0x3e8,%rax
jae    114b <f2+0x4b>
movslq -0x3f4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1115 <f2+0x15>
add    $0x380,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca [1000 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, 1000
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
unsigned long read_phys(unsigned long addr) {
  volatile unsigned long *ptr;
  ptr = (void *)addr;
  return *ptr;
}


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

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

LLVM IR (-O0):
define i64 @read_phys(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i8*
%6 = bitcast i8* %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load volatile i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @read_phys(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Variables and functions */
float roundf(float);
float *vec2_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  return result;
}


x86 assembly (clang, -O0):
<vec2_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_round>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rsi),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,(%rbx)
movss  0x4(%r14),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x4(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @vec2_round(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @llvm.round.f32(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @llvm.round.f32(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %3
ret float* %17
}

LLVM IR (-O2):
define float* @vec2_round(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.round.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.round.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void wypisz_tab(int tab[], int size) {
  int i;
  for (i = 0; i < size;)
    printf("%d ", tab[i++]);
  printf("\n");
}


x86 assembly (clang, -O0):
<wypisz_tab>:
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    115a <wypisz_tab+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <wypisz_tab+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wypisz_tab>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <wypisz_tab+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r12
jne    1140 <wypisz_tab+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @wypisz_tab(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void gtk_text_buffer_get_char_count() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_char_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
extern void sig_term_unblock(void) { sig_unblock(SIGTERM); }


x86 assembly (clang, -O0):
<sig_term_unblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_unblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_term_unblock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @sig_term_unblock() {
%1 = load i32, i32* @SIGTERM
%2 = call i32 @sig_unblock(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @sig_term_unblock() {
%1 = load i32, i32* @SIGTERM
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearZone();
int /*<<< orphan*/ MemFreeAll();
void ShutMemory(void) {
  MemFreeAll();
  ClearZone();
}


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

x86 assembly (clang, -O2):
<ShutMemory>:
push   %rax
xor    %eax,%eax
call   1030 <MemFreeAll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ClearZone@plt>

LLVM IR (-O0):
define void @ShutMemory() {
%1 = call i32 (...) @MemFreeAll()
%2 = call i32 (...) @ClearZone()
ret void
}

LLVM IR (-O2):
define void @ShutMemory() {
%1 = tail call i32 (...) @MemFreeAll()
%2 = tail call i32 (...) @ClearZone()
ret void
}
/* Variables and functions */
long double scalbn(long double, int);
long double scalbnl(long double x, int exp) { return scalbn(x, exp); }


x86 assembly (clang, -O0):
<scalbnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <scalbn@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbnl>:
jmp    1030 <scalbn@plt>

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

LLVM IR (-O2):
define x86_fp80 @scalbnl(x86_fp80 %0, i32 %1) {
%3 = tail call x86_fp80 @scalbn(x86_fp80 %0, i32 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ echo_test(int, int, int);
void echo_test_500K_10(void) { echo_test(0x00, 0x1c, 10); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1c,%esi
mov    $0xa,%edx
call   1030 <echo_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
mov    $0x1c,%esi
mov    $0xa,%edx
jmp    1030 <echo_test@plt>

LLVM IR (-O0):
define void @echo_test_500K_10() {
%1 = call i32 @echo_test(i32 0, i32 28, i32 10)
ret void
}

LLVM IR (-O2):
define void @echo_test_500K_10() {
%1 = tail call i32 @echo_test(i32 0, i32 28, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_auth_context_property_iterator() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_auth_context_property_iterator>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_auth_context_property_iterator>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_auth_context_property_iterator() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_auth_context_property_iterator() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void wake_unlock(struct wake_lock *lock) {}


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

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

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

LLVM IR (-O2):
%struct.wake_lock = type opaque
define void @wake_unlock(%struct.wake_lock* nocapture %0) {
ret void
}
void gtk_icon_source_set_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_set_filename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff_over_list();
int /*<<< orphan*/ print_list(int /*<<< orphan*/);
int main(int argc, char **argv) {
  print_list(do_stuff_over_list());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <do_stuff_over_list@plt>
mov    %eax,%edi
call   1030 <print_list@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @do_stuff_over_list()
%7 = call i32 @print_list(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_stuff_over_list()
%4 = tail call i32 @print_list(i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned int psr_get();
int /*<<< orphan*/ psr_set(unsigned int);
void psr_disable_traps(void) {
  unsigned int psr = psr_get();
  psr &= ~0x20;
  psr_set(psr);
}


x86 assembly (clang, -O0):
<psr_disable_traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <psr_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <psr_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psr_disable_traps>:
push   %rax
xor    %eax,%eax
call   1030 <psr_get@plt>
and    $0xffffffdf,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <psr_set@plt>

LLVM IR (-O0):
define void @psr_disable_traps() {
%1 = alloca i32
%2 = call i32 (...) @psr_get()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -33
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @psr_set(i32 %5)
ret void
}

LLVM IR (-O2):
define void @psr_disable_traps() {
%1 = tail call i32 (...) @psr_get()
%2 = and i32 %1, -33
%3 = tail call i32 @psr_set(i32 %2)
ret void
}
float conv_ui10_to_norm_float(unsigned ui10) { return ui10 / 1023.0f; }


x86 assembly (clang, -O0):
<conv_ui10_to_norm_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee9(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_ui10_to_norm_float>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
divss  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @conv_ui10_to_norm_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to float
%5 = fdiv float %4, 1.023000e+03
ret float %5
}

LLVM IR (-O2):
define float @conv_ui10_to_norm_float(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fdiv float %2, 1.023000e+03
ret float %3
}
/* Variables and functions */
double _log1p(double);
double log1p(double x) { return _log1p(x); }


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

x86 assembly (clang, -O2):
<log1p>:
jmp    1030 <_log1p@plt>

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

LLVM IR (-O2):
define double @log1p(double %0) {
%2 = tail call double @_log1p(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void print_reverced(const int str[], int size) {
  if (size <= 0) {
    return;
  }
  print_reverced(str + 1, --size);
  printf("%d ", str[0]);
}


x86 assembly (clang, -O0):
<print_reverced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     113e <print_reverced+0x1e>
jmp    1166 <print_reverced+0x46>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
call   1040 <print_reverced@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reverced>:
test   %esi,%esi
jle    1143 <print_reverced+0x23>
push   %rbx
mov    %rdi,%rbx
add    $0x4,%rdi
add    $0xffffffff,%esi
call   1040 <print_reverced@plt>
mov    (%rbx),%esi
lea    0xec3(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_reverced(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 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %17
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_reverced(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = add nsw i32 %1, -1
tail call void @print_reverced(i32* %6, i32 %7)
%8 = load i32, i32* %0
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char s[100];
  int n = 26;
  itoa(n, s, 10);
  printf(":%s:\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1a,-0x84(%rbp)
mov    -0x84(%rbp),%edi
lea    -0x80(%rbp),%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    -0x80(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0x1a,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c":%s:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 26, i32* %7
%8 = load i32, i32* %7
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @itoa(i32 %8, i8* %9, i32 10)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c":%s:\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 26, i8* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int foo(int x, int in1, int in2) {
  short a = (in1 & 0xffff0000) >> 16;
  short b = (in2 & 0xffff0000) >> 16;
  return x + b * a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x10(%rbp),%ecx
movswl -0xe(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sar    $0x10,%edx
sar    $0x10,%esi
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = and i32 %9, -65536
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i16
store i16 %12, i16* %7
%13 = load i32, i32* %6
%14 = and i32 %13, -65536
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i16
store i16 %16, i16* %8
%17 = load i32, i32* %4
%18 = load i16, i16* %8
%19 = sext i16 %18 to i32
%20 = load i16, i16* %7
%21 = sext i16 %20 to i32
%22 = mul nsw i32 %19, %21
%23 = add nsw i32 %17, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %2, 16
%5 = ashr i32 %1, 16
%6 = mul nsw i32 %4, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
int ft_find_origin(char *tetrimino, int index) {
  while (tetrimino[index] != '#')
    ++index;
  return (index);
}


x86 assembly (clang, -O0):
<ft_find_origin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     112e <ft_find_origin+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <ft_find_origin+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_find_origin>:
movslq %esi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x23,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_find_origin+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_find_origin(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 35
%9 = add i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}