xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void terminate(const char *msg, int socket) {
  if (msg != (const char *)NULL)
    perror(msg);
  else
    perror("Erro fatal");
  close(socket);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <terminate+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1164 <terminate+0x34>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
jne    113f <terminate+0xf>
lea    0xec1(%rip),%rdi
call   1040 <perror@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Erro fatal\00"
@EXIT_FAILURE = global i32 0
define void @terminate(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
br label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %4
%14 = call i32 @close(i32 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Erro fatal\00"
@EXIT_FAILURE = global i32 0
define void @terminate(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @close(i32 %1)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ warnx(char *, int);
void sig_h(int s) { warnx("got signal %d", s); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"got signal %d\00"
define void @sig_h(i32 %0) {
%2 = tail call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Dorado9211WriteReg(int, int);
void Dorado_Power_Up(void) {
  Dorado9211WriteReg(0x00000400 + 0x08, 0x01000000);
  return;
}


x86 assembly (clang, -O0):
<Dorado_Power_Up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x408,%edi
mov    $0x1000000,%esi
call   1030 <Dorado9211WriteReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado_Power_Up>:
mov    $0x408,%edi
mov    $0x1000000,%esi
jmp    1030 <Dorado9211WriteReg@plt>

LLVM IR (-O0):
define void @Dorado_Power_Up() {
%1 = call i32 @Dorado9211WriteReg(i32 1032, i32 16777216)
ret void
}

LLVM IR (-O2):
define void @Dorado_Power_Up() {
%1 = tail call i32 @Dorado9211WriteReg(i32 1032, i32 16777216)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
void *decode_source_symbol_callback(void *context, unsigned int size,
                                    unsigned int esi) {
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<decode_source_symbol_callback>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @decode_source_symbol_callback(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %1)
ret i8* %4
}
/* Variables and functions */
int ide_do_packet_command_pio(char *, char *, int);
int ide_read_toc(char *buf, int length) {
  char cmd[12] = {0x14, 0, 0, 0, 0x98, 0, 0, 0, 0, 0, 0, 0};
  return ide_do_packet_command_pio(cmd, buf, length);
}


x86 assembly (clang, -O0):
<ide_read_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_toc>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
movabs $0x9800000014,%rax
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ide_do_packet_command_pio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ide_read_toc.cmd = [12 x i8] c"\14\00\00\00\98\00\00\00\00\00\00\00"
define i32 @ide_read_toc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [12 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [12 x i8]* %5 to i8*
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @ide_do_packet_command_pio(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@__const.ide_read_toc.cmd = [12 x i8] c"\14\00\00\00\98\00\00\00\00\00\00\00"
define i32 @ide_read_toc(i8* %0, i32 %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @ide_do_packet_command_pio(i8* %4, i8* %0, i32 %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtepi32_pd(int /*<<< orphan*/);
__m128d test_mm_cvtepi32_pd(__m128i A) { return _mm_cvtepi32_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtepi32_pd>:
jmp    1030 <_mm_cvtepi32_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtepi32_pd(i32 %0) {
%2 = tail call i32 @_mm_cvtepi32_pd(i32 %0)
ret i32 %2
}
int bdf_ascii_to_nibble(char ascii) {
  if (ascii >= '0' && ascii <= '9')
    return ascii - '0';
  if (ascii >= 'a' && ascii <= 'z')
    return ascii - 'a' + 10;
  return ascii - 'A' + 10;
}


x86 assembly (clang, -O0):
<bdf_ascii_to_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <bdf_ascii_to_nibble+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <bdf_ascii_to_nibble+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <bdf_ascii_to_nibble+0x6c>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     115f <bdf_ascii_to_nibble+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     115f <bdf_ascii_to_nibble+0x5f>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <bdf_ascii_to_nibble+0x6c>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdf_ascii_to_nibble>:
lea    -0x30(%rdi),%eax
lea    -0x61(%rdi),%ecx
xor    %edx,%edx
cmp    $0x1a,%cl
setae  %dl
shl    $0x5,%edx
add    $0xffffffa9,%edx
cmp    $0xa,%al
mov    $0xffffffd0,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bdf_ascii_to_nibble(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %33
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 122
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 97
%27 = add nsw i32 %26, 10
store i32 %27, i32* %2
br label %33
28: ; preds = %19, %15
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 65
%32 = add nsw i32 %31, 10
store i32 %32, i32* %2
br label %33
33: ; preds = %28, %23, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @bdf_ascii_to_nibble(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 26
%7 = select i1 %6, i32 -87, i32 -55
%8 = select i1 %4, i32 -48, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int *dynCastToInt(void *);
void testMultipleStore(void *p) {
  int *casted = 0;
  casted = dynCastToInt(p);
  *casted = 1;
}


x86 assembly (clang, -O0):
<testMultipleStore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dynCastToInt@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMultipleStore>:
push   %rax
call   1030 <dynCastToInt@plt>
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testMultipleStore(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%4 = load i8*, i8** %2
%5 = call i32* @dynCastToInt(i8* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @testMultipleStore(i8* %0) {
%2 = tail call i32* @dynCastToInt(i8* %0)
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int getpagesize();
int main(void) {
  int sz;
  sz = getpagesize();
  return sz == 4096;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getpagesize()
%2 = icmp eq i32 %1, 4096
%3 = zext i1 %2 to i32
ret i32 %3
}
int doit2(long *v) {
  v[0] = 100;
  v[1] = 200;
  return 2;
}


x86 assembly (clang, -O0):
<doit2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x64,(%rax)
mov    -0x8(%rbp),%rax
movq   $0xc8,0x8(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit2>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @doit2(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
store i64 100, i64* %4
%5 = load i64*, i64** %2
%6 = getelementptr inbounds i64, i64* %5, i64 1
store i64 200, i64* %6
ret i32 2
}

LLVM IR (-O2):
define i32 @doit2(i64* nocapture writeonly %0) {
%2 = bitcast i64* %0 to <2 x i64>*
store <2 x i64> <i64 100, i64 200>, <2 x i64>* %2
ret i32 2
}
int foo4(double b, double c) { return b < c; }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @foo4(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo4(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float i, max = 1000000;
  for (i = 0; i < max; i++) {
    printf("\rCompletion: %.3f%%", (i / max) * 100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1180 <main+0x70>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
mulss  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movss  0xe97(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xeec(%rip),%rbx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
divss  0xed1(%rip),%xmm0
mulss  0xecd(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0xf4240,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0DCompletion: %.3f%%\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 1.000000e+06, float* %3
store float 0.000000e+00, float* %2
br label %4
4: ; preds = %14, %0
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fdiv float %9, %10
%12 = fmul float %11, 1.000000e+02
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %12)
br label %14
14: ; preds = %8
%15 = load float, float* %2
%16 = fadd float %15, 1.000000e+00
store float %16, float* %2
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0DCompletion: %.3f%%\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = sitofp i32 %2 to float
%4 = fdiv float %3, 1.000000e+06
%5 = fmul float %4, 1.000000e+02
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 1000000
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void DESDMADisable(uint32_t ui32Base, uint32_t ui32Flags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) &= ~ui32Flags;
}


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

x86 assembly (clang, -O2):
<DESDMADisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x34(%rcx)
ret

LLVM IR (-O0):
define void @DESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 52
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @DESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 52
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
unsigned long C_Utils_min_ulong(const unsigned long item1,
                                const unsigned long item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <C_Utils_min_ulong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <C_Utils_min_ulong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_ulong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @C_Utils_min_ulong(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 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @C_Utils_min_ulong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void ff_hevc_put_hevc_bi_w_epel_h4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h4_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, size_t);
int /*<<< orphan*/ exit(int);
void *realloc(void *, size_t);
void *xrealloc(void *oldmem, size_t size) {
  void *mem;
  if (size == 0)
    size = 1;
  mem = realloc(oldmem, size);
  if (mem == NULL) {
    error("xrealloc %ld\n", size);
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <xrealloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <xrealloc+0x59>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rsi,%rsi
mov    $0x1,%ebx
cmovne %rsi,%rbx
mov    %rbx,%rsi
call   1030 <realloc@plt>
test   %rax,%rax
je     114c <xrealloc+0x1c>
pop    %rbx
ret
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1040 <error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"xrealloc %ld\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 1, i64* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i64, i64* %4
%17 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %9
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"xrealloc %ld\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %5
}
/* Type definitions */
struct timespec {
  double tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double tspecToFloat(const struct timespec tspec) {
  return (double)tspec.tv_sec + (tspec.tv_nsec / 1000000000.0);
}


x86 assembly (clang, -O0):
<tspecToFloat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tspecToFloat>:
cvtsi2sd %rdi,%xmm1
divsd  0xef3(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define double @tspecToFloat(double %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i64 }*
%5 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @tspecToFloat(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %0, 1.000000e+09
%5 = fadd double %4, %3
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EBStack_init();
void init() { EBStack_init(); }


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

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

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

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @EBStack_init()
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ennorm(uint16_t x) { return x & 0x00000fff; }


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

x86 assembly (clang, -O2):
<ennorm>:
mov    %edi,%eax
and    $0xfff,%eax
ret

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

LLVM IR (-O2):
define i32 @ennorm(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
void foo4(int j, int n, int *a) {
#pragma omp parallel
  {
#pragma omp single
    {
      int i;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for shared(a) firstprivate(n) private(i)       \
    firstprivate(j)
      for (i = j + 1; i < n; i += 3)
        a[i] = i;
    }
  }
}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113f <foo4+0x3f>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <foo4+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
add    $0x1,%edi
cmp    %esi,%edi
jge    111c <foo4+0x1c>
movslq %edi,%rax
movslq %esi,%rcx
nopl   (%rax)
mov    %eax,(%rdx,%rax,4)
add    $0x3,%rax
cmp    %rcx,%rax
jl     1110 <foo4+0x10>
ret

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

LLVM IR (-O2):
define void @foo4(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, 1
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ %7, %6 ], [ %13, %9 ]
%11 = getelementptr inbounds i32, i32* %2, i64 %10
%12 = trunc i64 %10 to i32
store i32 %12, i32* %11
%13 = add nsw i64 %10, 3
%14 = icmp slt i64 %13, %8
br i1 %14, label %9, label %15
15: ; preds = %9, %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int __unfo_strcmp(const char *str1, const char *str2) {
  if (!str1 && !str2)
    return 1;
  else if (!str1 || !str2)
    return 0;
  else
    return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<__unfo_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <__unfo_strcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <__unfo_strcmp+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1180 <__unfo_strcmp+0x70>
cmpq   $0x0,-0x10(%rbp)
je     1158 <__unfo_strcmp+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <__unfo_strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1180 <__unfo_strcmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__unfo_strcmp>:
mov    $0x1,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     113e <__unfo_strcmp+0x2e>
xor    %eax,%eax
test   %rdi,%rdi
je     113e <__unfo_strcmp+0x2e>
test   %rsi,%rsi
je     113e <__unfo_strcmp+0x2e>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @__unfo_strcmp(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 ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 1, i32* %3
br label %25
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %15, %12
store i32 0, i32* %3
br label %25
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
store i32 %24, i32* %3
br label %25
25: ; preds = %19, %18, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @__unfo_strcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = and i1 %3, %4
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %6 ]
ret i32 %13
}
void rational_int(int n, long double *x) { (*x) = (long double)n; }


x86 assembly (clang, -O0):
<rational_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
fildl  -0x14(%rbp)
mov    -0x10(%rbp),%rax
fstpt  (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rational_int>:
mov    %edi,-0x4(%rsp)
fildl  -0x4(%rsp)
fstpt  (%rsi)
ret

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

LLVM IR (-O2):
define void @rational_int(i32 %0, x86_fp80* nocapture writeonly %1) {
%3 = sitofp i32 %0 to x86_fp80
store x86_fp80 %3, x86_fp80* %1
ret void
}
int fork(void) {
  ;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @fork() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @fork() {
ret i32 -1
}
void main(void) {
  printf("The address of main function is: %p\n", main);
  int num = 4;
  printf("The address of variable num is: %p\n", &num);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    0x2ec9(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x4,0x4(%rsp)
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"The address of main function is: %p\0A\00"
@.str.1 = [36 x i8] c"The address of variable num is: %p\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), void ()* @main)
store i32 4, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"The address of main function is: %p\0A\00"
@.str.1 = [36 x i8] c"The address of variable num is: %p\0A\00"
define void @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), void ()* @main)
%3 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
float strtof(char const *, char **);
__attribute__((visibility("default"))) float trio_to_float(const char *source,
                                                           char **endp) {
  return strtof(source, endp);
}


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

x86 assembly (clang, -O2):
<trio_to_float>:
jmp    1030 <strtof@plt>

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

LLVM IR (-O2):
define float @trio_to_float(i8* %0, i8** nocapture %1) {
%3 = tail call float @strtof(i8* %0, i8** %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ my_malloc1(int);
int /*<<< orphan*/ my_malloc2(int);
void a450(void) {
  my_malloc2(1200);
  my_malloc1(400);
  my_malloc2(400);
  my_malloc1(200);
}


x86 assembly (clang, -O0):
<a450>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b0,%edi
call   1040 <my_malloc2@plt>
mov    $0x190,%edi
call   1030 <my_malloc1@plt>
mov    $0x190,%edi
call   1040 <my_malloc2@plt>
mov    $0xc8,%edi
call   1030 <my_malloc1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a450>:
push   %rax
mov    $0x4b0,%edi
call   1040 <my_malloc2@plt>
mov    $0x190,%edi
call   1030 <my_malloc1@plt>
mov    $0x190,%edi
call   1040 <my_malloc2@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1030 <my_malloc1@plt>

LLVM IR (-O0):
define void @a450() {
%1 = call i32 @my_malloc2(i32 1200)
%2 = call i32 @my_malloc1(i32 400)
%3 = call i32 @my_malloc2(i32 400)
%4 = call i32 @my_malloc1(i32 200)
ret void
}

LLVM IR (-O2):
define void @a450() {
%1 = tail call i32 @my_malloc2(i32 1200)
%2 = tail call i32 @my_malloc1(i32 400)
%3 = tail call i32 @my_malloc2(i32 400)
%4 = tail call i32 @my_malloc1(i32 200)
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int sub(int, int);
int main() {
  printf("5+2=%d\n", add(5, 2));
  printf("5-2=%d\n", sub(5, 2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1050 <sub@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"5+2=%d\0A\00"
@.str.1 = [8 x i8] c"5-2=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 5, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sub(i32 5, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
long long gcd(long long n, long long m) {
  long long c;
  for (; m > 0; c = n % m, n = m, m = c)
    ;
  return n;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    113f <gcd+0x3f>
jmp    111c <gcd+0x1c>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
jle    1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
jle    1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %6
6: ; preds = %10, %2
%7 = load i64, i64* %4
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = srem i64 %11, %12
store i64 %13, i64* %5
%14 = load i64, i64* %4
store i64 %14, i64* %3
%15 = load i64, i64* %5
store i64 %15, i64* %4
br label %6
16: ; preds = %6
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp sgt i64 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
int s_peek(int *items, int size) { return items[size - 1]; }


x86 assembly (clang, -O0):
<s_peek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_peek>:
movslq %esi,%rax
mov    -0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @s_peek(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 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @s_peek(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int pipe2(int *, int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  int fds[2];
  if (pipe2(fds, 0) == -1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
cmp    $0xffffffff,%eax
jne    1146 <main+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <main+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @pipe2(i32* %5, i32 0)
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ e_adc();
int /*<<< orphan*/ e_izpx();
void e_adc_izpx() {
  e_izpx();
  e_adc();
}


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

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

LLVM IR (-O0):
define void @e_adc_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_adc()
ret void
}

LLVM IR (-O2):
define void @e_adc_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_adc()
ret void
}
void gtk_toolbar_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_new() {
ret void
}
void g_value_get_char() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_char() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
__attribute__((always_)) __attribute__((unused)) int
MakeIndex(const int iFace, const int iVert) {
  assert(iVert >= 0 && iVert < 4 && iFace >= 0);
  return (iFace << 2) | (iVert & 0x3);
}


x86 assembly (clang, -O0):
<MakeIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1146 <MakeIndex+0x36>
xor    %eax,%eax
cmpl   $0x4,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1146 <MakeIndex+0x36>
cmpl   $0x0,-0x4(%rbp)
setge  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%ecx
and    $0x3,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeIndex>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
xor    %edi,%edi
cmp    $0x4,%esi
cmovb  %eax,%edi
call   1030 <assert@plt>
and    $0x3,%ebx
lea    (%rbx,%r14,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @MakeIndex(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 sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 0
br label %13
13: ; preds = %10, %7, %2
%14 = phi i1 [ false, %7 ], [ false, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %3
%18 = shl i32 %17, 2
%19 = load i32, i32* %4
%20 = and i32 %19, 3
%21 = or i32 %18, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @MakeIndex(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 4
%4 = xor i32 %0, -1
%5 = lshr i32 %4, 31
%6 = select i1 %3, i32 %5, i32 0
%7 = tail call i32 @assert(i32 %6)
%8 = shl i32 %0, 2
%9 = and i32 %1, 3
%10 = or i32 %9, %8
ret i32 %10
}
/* Variables and functions */
int sec(int);
int rec(int in) {
  in++;
  return sec(in);
}


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

x86 assembly (clang, -O2):
<rec>:
add    $0x1,%edi
jmp    1030 <sec@plt>

LLVM IR (-O0):
define i32 @rec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sec(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @rec(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @sec(i32 %2)
ret i32 %3
}
int getopt_long_only(argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{ return _getopt_internal(argc, argv, options, long_options, opt_index, 1); }


x86 assembly (clang, -O0):
<getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
mov    $0x0,%al
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only>:
mov    $0x1,%r9d
xor    %eax,%eax
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
int f2(int x, int y) {
  if (x < -0x7fffffff)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x80000001,-0x4(%rbp)
jge    1117 <f2+0x17>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = icmp slt i32 %5, -2147483647
br i1 %6, label %7, label %8
7: ; preds = %2
unreachable
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, -2147483648
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Variables and functions */
int arg(int /*<<< orphan*/);
int /*<<< orphan*/ fun(int);
int rest_(int list) { return arg(fun(list)); }


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

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

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

LLVM IR (-O2):
define i32 @rest_(i32 %0) {
%2 = tail call i32 @fun(i32 %0)
%3 = tail call i32 @arg(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ lex_init(int /*<<< orphan*/ *);
void parser_init(FILE *fp) { lex_init(fp); }


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

x86 assembly (clang, -O2):
<parser_init>:
jmp    1030 <lex_init@plt>

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

LLVM IR (-O2):
define void @parser_init(i32* %0) {
%2 = tail call i32 @lex_init(i32* %0)
ret void
}
void CRYPTO_thread_id(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_thread_id() {
ret void
}