xunge/DecIR huggingface dataset:
int LZ4_compressBound(int isize) {
  return ((unsigned int)(isize) > (unsigned int)0x7E000000
              ? 0
              : (isize) + ((isize) / 255) + 16);
}


x86 assembly (clang, -O0):
<LZ4_compressBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7e000000,-0x4(%rbp)
jbe    111e <LZ4_compressBound+0x1e>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <LZ4_compressBound+0x3c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressBound>:
xor    %eax,%eax
cmp    $0x7e000000,%edi
ja     111f <LZ4_compressBound+0x1f>
mov    %edi,%eax
mov    $0x80808081,%ecx
imul   %rax,%rcx
shr    $0x27,%rcx
lea    (%rdi,%rcx,1),%eax
add    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @LZ4_compressBound(i32 %0) {
%2 = icmp ugt i32 %0, 2113929216
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = udiv i32 %0, 255
%5 = add nuw nsw i32 %0, 16
%6 = add nuw nsw i32 %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void printLog(char *hint, char *params, int rtn) {
  printf("> %s\n>> Action: %s\n>>> Returned: 0x%X\n\n", hint, params, rtn);
}


x86 assembly (clang, -O0):
<printLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLog>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"> %s\0A>> Action: %s\0A>>> Returned: 0x%X\0A\0A\00"
define void @printLog(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"> %s\0A>> Action: %s\0A>>> Returned: 0x%X\0A\0A\00"
define void @printLog(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(scalar_t__ volatile);
void TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(_TimerBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000018))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<TimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntEnable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
or     %rax,0x18(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @TimerIntEnable(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* %3
%6 = call i32 @_TimerBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %3
%10 = add nsw i64 %9, 24
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @TimerIntEnable(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* %3
%6 = tail call i32 @_TimerBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %3
%10 = add nsw i64 %9, 24
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}
void __attribute__((noreturn)) baz(void) {
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <baz+0x9>
jmp    1109 <baz+0x9>

x86 assembly (clang, -O2):
<baz>:
jmp    1100 <baz>

LLVM IR (-O0):
define void @baz() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @baz() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t read(int, char *, int);
int /*<<< orphan*/ stderr;
void devnull(int fd) {
  char buf[65536];
  size_t len;
  while (1) {
    len = read(fd, buf, 65536);
    if (len < 1) {
      fprintf(stderr, "Child exiting\n");
      return;
    }
  }
}


x86 assembly (clang, -O0):
<devnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10010(%rbp),%rsi
mov    $0x10000,%edx
call   1030 <read@plt>
mov    %rax,-0x10018(%rbp)
cmpq   $0x1,-0x10018(%rbp)
01
jae    1175 <devnull+0x55>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10020,%rsp
pop    %rbp
ret
jmp    112e <devnull+0xe>

x86 assembly (clang, -O2):
<devnull>:
push   %r14
push   %rbx
sub    $0x10008,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x10000,%edx
call   1030 <read@plt>
test   %rax,%rax
jne    1130 <devnull+0x10>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
add    $0x10008,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Child exiting\0A\00"
define void @devnull(i32 %0) {
%2 = alloca i32
%3 = alloca [65536 x i8]
%4 = alloca i64
store i32 %0, i32* %2
br label %5
5: ; preds = %1, %14
%6 = load i32, i32* %2
%7 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%8 = call i64 @read(i32 %6, i8* %7, i32 65536)
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
14: ; preds = %5
br label %5
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Child exiting\0A\00"
define void @devnull(i32 %0) {
%2 = alloca [65536 x i8]
%3 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i64 @read(i32 %0, i8* %3, i32 65536)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void mapc(int *x) { *x = *x * 5 / 24; }


x86 assembly (clang, -O0):
<mapc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x5,(%rax),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapc>:
mov    (%rdi),%eax
lea    (%rax,%rax,4),%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @mapc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 5
%4 = sdiv i32 %3, 24
store i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha3_512(int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_512(uint8_t *ret, uint8_t const *data, size_t const size) {
  sha3_512(ret, 64, data, size);
}


x86 assembly (clang, -O0):
<SHA3_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x40,%esi
call   1030 <sha3_512@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA3_512>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x40,%esi
jmp    1030 <sha3_512@plt>

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

LLVM IR (-O2):
define void @SHA3_512(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @sha3_512(i32* %0, i32 64, i32* %1, i64 %2)
ret void
}
/* Variables and functions */
double F_edgeBlendQuad(int *, double *);
double F_edgeBlendTri(int *, double *);
double E_blendOnFace(int eindex[], int etype, double *L) {
  if (etype == 2)
    return F_edgeBlendTri(eindex, L);
  else if (etype == 3)
    return F_edgeBlendQuad(eindex, L);
  else
    return 0.0e0;
}


x86 assembly (clang, -O0):
<E_blendOnFace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1154 <E_blendOnFace+0x34>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <F_edgeBlendTri@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    117d <E_blendOnFace+0x5d>
cmpl   $0x3,-0x14(%rbp)
jne    1175 <E_blendOnFace+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <F_edgeBlendQuad@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    117d <E_blendOnFace+0x5d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E_blendOnFace>:
cmp    $0x3,%esi
je     1132 <E_blendOnFace+0x12>
cmp    $0x2,%esi
jne    113a <E_blendOnFace+0x1a>
mov    %rdx,%rsi
jmp    1040 <F_edgeBlendTri@plt>
mov    %rdx,%rsi
jmp    1030 <F_edgeBlendQuad@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @E_blendOnFace(i32* %0, i32 %1, double* %2) {
%4 = alloca double
%5 = alloca i32*
%6 = alloca i32
%7 = alloca double*
store i32* %0, i32** %5
store i32 %1, i32* %6
store double* %2, double** %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32*, i32** %5
%12 = load double*, double** %7
%13 = call double @F_edgeBlendTri(i32* %11, double* %12)
store double %13, double* %4
br label %22
14: ; preds = %3
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32*, i32** %5
%19 = load double*, double** %7
%20 = call double @F_edgeBlendQuad(i32* %18, double* %19)
store double %20, double* %4
br label %22
21: ; preds = %14
store double 0.000000e+00, double* %4
br label %22
22: ; preds = %21, %17, %10
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @E_blendOnFace(i32* %0, i32 %1, double* %2) {
switch i32 %1, label %8 [
i32 2, label %4
i32 3, label %6
]
4: ; preds = %3
%5 = tail call double @F_edgeBlendTri(i32* %0, double* %2)
br label %8
6: ; preds = %3
%7 = tail call double @F_edgeBlendQuad(i32* %0, double* %2)
br label %8
8: ; preds = %3, %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ], [ 0.000000e+00, %3 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("A very nice wong is \"SUMMERTIME\" \n");
  printf("(So hush little baby, don't you cry...)\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"A very nice wong is \22SUMMERTIME\22 \0A\00"
@.str.1 = [41 x i8] c"(So hush little baby, don't you cry...)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"A very nice wong is \22SUMMERTIME\22 \00"
@str.2 = [40 x i8] c"(So hush little baby, don't you cry...)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calculate_tests();
int /*<<< orphan*/ lifetime_tests();
int /*<<< orphan*/ update_tests();
void all_tests(void) {
  calculate_tests();
  lifetime_tests();
  update_tests();
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <calculate_tests@plt>
mov    $0x0,%al
call   1040 <lifetime_tests@plt>
mov    $0x0,%al
call   1030 <update_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1050 <calculate_tests@plt>
xor    %eax,%eax
call   1040 <lifetime_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <update_tests@plt>

LLVM IR (-O0):
define void @all_tests() {
%1 = call i32 (...) @calculate_tests()
%2 = call i32 (...) @lifetime_tests()
%3 = call i32 (...) @update_tests()
ret void
}

LLVM IR (-O2):
define void @all_tests() {
%1 = tail call i32 (...) @calculate_tests()
%2 = tail call i32 (...) @lifetime_tests()
%3 = tail call i32 (...) @update_tests()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void sigterm(int sig) {
  fprintf(stderr, "W:\t%s\n", "trapped TERM and exit");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xec5(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecf(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [22 x i8] c"trapped TERM and exit\00"
@EXIT_SUCCESS = global i32 0
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [22 x i8] c"trapped TERM and exit\00"
@EXIT_SUCCESS = global i32 0
define void @sigterm(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World");
  printf("God Bye GG WP GL HF");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [20 x i8] c"God Bye GG WP GL HF\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [20 x i8] c"God Bye GG WP GL HF\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void putchar(void) {}


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

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

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

LLVM IR (-O2):
define void @putchar() {
ret void
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  char name[81];
  char *ptr;
  printf("Hi, what's your name?\n");
  ptr = fgets(name, 81, stdin);
  printf("%s? Ah! %s!\n", name, ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0x51,%esi
call   1040 <fgets@plt>
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rsi
mov    -0x68(%rbp),%rdx
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x51,%esi
call   1050 <fgets@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hi, what's your name?\0A\00"
@stdin = global i32 0
@.str.1 = [13 x i8] c"%s? Ah! %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i8* @fgets(i8* %5, i32 81, i32 %6)
store i8* %7, i8** %3
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [13 x i8] c"%s? Ah! %s!\0A\00"
@str = [22 x i8] c"Hi, what's your name?\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i8* @fgets(i8* %2, i32 81, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %5)
ret i32 0
}
int f1(int i) { return i + 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
long core__math___Int____38d(long self, long p0) {
  long var;
  long var1;
  var1 = self & p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

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

LLVM IR (-O0):
define i64 @core__math___Int____38d(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = and i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core__math___Int____38d(i64 %0, i64 %1) {
%3 = and i64 %1, %0
ret i64 %3
}
/* Variables and functions */
double atof(char const *);
char *strstr_after(char const *, char const *);
double xml_copy_field_number(const char *parent_start, const char *parent_end,
                             const char *tag_start) {
  const char *p;
  double v = 0.;
  p = strstr_after(parent_start, tag_start);
  if (p && p < parent_end)
    v = atof(p);
  return v;
}


x86 assembly (clang, -O0):
<xml_copy_field_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr_after@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1174 <xml_copy_field_number+0x54>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1174 <xml_copy_field_number+0x54>
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_copy_field_number>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1040 <strstr_after@plt>
test   %rax,%rax
je     113f <xml_copy_field_number+0x1f>
cmp    %rbx,%rax
jae    113f <xml_copy_field_number+0x1f>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <atof@plt>
xorps  %xmm0,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @xml_copy_field_number(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store double 0.000000e+00, double* %8
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = call i8* @strstr_after(i8* %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = load i8*, i8** %5
%17 = icmp ult i8* %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %7
%20 = call double @atof(i8* %19)
store double %20, double* %8
br label %21
21: ; preds = %18, %14, %3
%22 = load double, double* %8
ret double %22
}

LLVM IR (-O2):
define double @xml_copy_field_number(i8* %0, i8* readnone %1, i8* %2) {
%4 = tail call i8* @strstr_after(i8* %0, i8* %2)
%5 = icmp ne i8* %4, null
%6 = icmp ult i8* %4, %1
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call double @atof(i8* %4)
br label %10
10: ; preds = %8, %3
%11 = phi double [ %9, %8 ], [ 0.000000e+00, %3 ]
ret double %11
}
/* Type definitions */
struct ether_addr {
  int dummy;
};

/* Variables and functions */
char *ether_ntoa_zz(struct ether_addr *, char *);
char *ether_ntoa_z(struct ether_addr *addr) {
  static char buf[18];
  return ether_ntoa_zz(addr, buf);
}


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

x86 assembly (clang, -O2):
<ether_ntoa_z>:
lea    0x2f29(%rip),%rsi
jmp    1030 <ether_ntoa_zz@plt>

LLVM IR (-O0):
%struct.ether_addr = type { i32 }
@ether_ntoa_z.buf = internal global [18 x i8] zeroinitializer
define i8* @ether_ntoa_z(%struct.ether_addr* %0) {
%2 = alloca %struct.ether_addr*
store %struct.ether_addr* %0, %struct.ether_addr** %2
%3 = load %struct.ether_addr*, %struct.ether_addr** %2
%4 = call i8* @ether_ntoa_zz(%struct.ether_addr* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @ether_ntoa_z.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
@ether_ntoa_z.buf = internal global [18 x i8] zeroinitializer
define i8* @ether_ntoa_z(%struct.ether_addr* %0) {
%2 = tail call i8* @ether_ntoa_zz(%struct.ether_addr* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @ether_ntoa_z.buf, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ f;

/* Variables and functions */
int /*<<< orphan*/ dump_bits(float *, int);
int /*<<< orphan*/ scanf(char *, float *);
int main(int argc, char *argv[]) {
  float f;
  scanf("%f", &f);
  dump_bits(&f, sizeof(f));
  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    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <dump_bits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <dump_bits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%8 = call i32 @dump_bits(float* %6, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = call i32 @dump_bits(float* %3, i32 4)
ret i32 0
}
double color_clamp(double x, double a, double b) {
  if (x < a)
    return a;
  else if (x > b)
    return b;
  else
    return x;
}


x86 assembly (clang, -O0):
<color_clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <color_clamp+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <color_clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <color_clamp+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <color_clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_clamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @color_clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @color_clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int *zeros_return(int n) {
  int *B = (int *)calloc(n, sizeof(int));
  return B;
}


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

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

LLVM IR (-O0):
define i32* @zeros_return(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define i32* @zeros_return(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = inttoptr i64 %2 to i32*
ret i32* %3
}
int main(int arg, char *argv[]) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void rec_echo_command(int type) {
  printf("server says it will echo: %d\n", type);
  printf("stop echoing for now\n");
}


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

x86 assembly (clang, -O2):
<rec_echo_command>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"server says it will echo: %d\0A\00"
@.str.1 = [22 x i8] c"stop echoing for now\0A\00"
define void @rec_echo_command(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"server says it will echo: %d\0A\00"
@str = [21 x i8] c"stop echoing for now\00"
define void @rec_echo_command(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int main() {
  int idBitLength, material_length, nlen;
  int j, k;
  assume(nlen == idBitLength / 32);
  for (j = 0; (j < idBitLength / 8) && (j < material_length); j++) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assume@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x1d(%rbp)
jge    1174 <main+0x64>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x74>
jmp    1197 <main+0x87>
jmp    1189 <main+0x79>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x3b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 32
%10 = icmp eq i32 %7, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assume(i32 %11)
store i32 0, i32* %5
br label %13
13: ; preds = %25, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 8
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br label %22
22: ; preds = %18, %13
%23 = phi i1 [ false, %13 ], [ %21, %18 ]
br i1 %23, label %24, label %28
24: ; preds = %22
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %13
28: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
ret i32 0
}
__complex__ float ctest_float(__complex__ float x) {
  __complex__ float res;
  res = ~x;
  return res;
}


x86 assembly (clang, -O0):
<ctest_float>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movaps 0xeeb(%rip),%xmm2
movss  -0xc(%rbp),%xmm0
pxor   %xmm2,%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_float>:
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
xorps  0xef2(%rip),%xmm1
movlhps %xmm0,%xmm1
shufps $0xe2,%xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @ctest_float(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%7 = load float, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%9 = load float, float* %8
%10 = fneg float %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %7, float* %11
store float %10, float* %12
%13 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%14 = load float, float* %13
%15 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%18 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %14, float* %17
store float %16, float* %18
%19 = bitcast { float, float }* %2 to <2 x float>*
%20 = load <2 x float>, <2 x float>* %19
ret <2 x float> %20
}

LLVM IR (-O2):
define <2 x float> @ctest_float(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 1
%3 = fneg float %2
%4 = insertelement <2 x float> %0, float %3, i64 1
ret <2 x float> %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int searchForBytes(int const *, int /*<<< orphan*/, int *, int, int);
int isProbably3F(const uint8_t *image, uint32_t size) {
  uint8_t signature[] = {0x85, 0x3F};
  return searchForBytes(image, size, signature, 2, 2);
}


x86 assembly (clang, -O0):
<isProbably3F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x14(%rbp),%rdx
mov    $0x2,%r8d
mov    %r8d,%ecx
call   1030 <searchForBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isProbably3F>:
push   %rax
movabs $0x3f00000085,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1030 <searchForBytes@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.isProbably3F.signature = [2 x i32] [i32 133, i32 63]
define i32 @isProbably3F(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [2 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast [2 x i32]* %5 to i8*
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%10 = call i32 @searchForBytes(i32* %7, i32 %8, i32* %9, i32 2, i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @isProbably3F(i32* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 270582939781, i64* %3
%5 = bitcast i64* %3 to i32*
%6 = call i32 @searchForBytes(i32* %0, i32 %1, i32* %5, i32 2, i32 2)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gen(int *, int *, int, int, int, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int *, int *, int);
void gen_129026(uint8_t *b, uint32_t *buflen) {
  gen(b, buflen, 8, 129026, 2, 0, 0);
  uint8_t sentence[] = {0x12, 0xfc, 0x70, 0x76, 0xff, 0xff, 0xff, 0xff};
  memcpy(&b[10], sentence, 8);
  *buflen = 18;
}


x86 assembly (clang, -O0):
<gen_129026>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
mov    $0x1f802,%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1040 <gen@plt>
mov    0xea2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9c(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
lea    -0x30(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movl   $0x12,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_129026>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,(%rsp)
mov    $0x8,%edx
mov    $0x1f802,%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
call   1040 <gen@plt>
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
add    $0x28,%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movl   $0x12,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.gen_129026.sentence = [8 x i32] [i32 18, i32 252, i32 112, i32 118, i32 255, i32 255, i32 255, i32 255]
define void @gen_129026(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [8 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @gen(i32* %6, i32* %7, i32 8, i32 129026, i32 2, i32 0, i32 0)
%9 = bitcast [8 x i32]* %5 to i8*
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 10
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 8)
%14 = load i32*, i32** %4
store i32 18, i32* %14
ret void
}

LLVM IR (-O2):
@__const.gen_129026.sentence = [8 x i32] [i32 18, i32 252, i32 112, i32 118, i32 255, i32 255, i32 255, i32 255]
define void @gen_129026(i32* %0, i32* %1) {
%3 = alloca [8 x i32]
%4 = tail call i32 @gen(i32* %0, i32* %1, i32 8, i32 129026, i32 2, i32 0, i32 0)
%5 = bitcast [8 x i32]* %3 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 10
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 8)
store i32 18, i32* %1
ret void
}
/* Variables and functions */
double angleDistance(float, float);
float normalizedAngleRad(float);
float angleAverage(float angle1, float angle2) {
  return normalizedAngleRad(angle1 + 0.5 * angleDistance(angle1, angle2));
}


x86 assembly (clang, -O0):
<angleAverage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <angleDistance@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xea4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <normalizedAngleRad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angleAverage>:
push   %rax
cvtss2sd %xmm0,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <angleDistance@plt>
mulsd  0xec9(%rip),%xmm0
addsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
jmp    1040 <normalizedAngleRad@plt>

LLVM IR (-O0):
define float @angleAverage(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call double @angleDistance(float %7, float %8)
%10 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %9, double %6)
%11 = fptrunc double %10 to float
%12 = call float @normalizedAngleRad(float %11)
ret float %12
}

LLVM IR (-O2):
define float @angleAverage(float %0, float %1) {
%3 = fpext float %0 to double
%4 = tail call double @angleDistance(float %0, float %1)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 5.000000e-01, double %3)
%6 = fptrunc double %5 to float
%7 = tail call float @normalizedAngleRad(float %6)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int x;
  srand(time(NULL));
  x = rand() % 6 + 1;
  if ((x >= 1) && (x <= 6)) {
    printf("congratulations you rolled a %d\n", x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1197 <main+0x57>
cmpl   $0x6,-0x8(%rbp)
jg     1197 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rsi
imul   $0x2aaaaaab,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%esi
js     1185 <main+0x45>
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"congratulations you rolled a %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 6
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"congratulations you rolled a %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stors() {
  int j;
  for (j = 0; j < 5; j++) {
    printf("*.*");
  }
}


x86 assembly (clang, -O0):
<stors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1143 <stors+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <stors+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stors>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

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