xunge/DecIR huggingface dataset:
/* Variables and functions */
int f162(int *);
int f163(int *p) { return f162(p); }


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

x86 assembly (clang, -O2):
<f163>:
jmp    1030 <f162@plt>

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

LLVM IR (-O2):
define i32 @f163(i32* %0) {
%2 = tail call i32 @f162(i32* %0)
ret i32 %2
}
int char_needs_escaping(int c) {
  if ((c >= 0) && (c < 0x20 || c == 0x22 || c == 0x5c)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<char_needs_escaping>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113b <char_needs_escaping+0x3b>
cmpl   $0x20,-0x8(%rbp)
jl     112f <char_needs_escaping+0x2f>
cmpl   $0x22,-0x8(%rbp)
je     112f <char_needs_escaping+0x2f>
cmpl   $0x5c,-0x8(%rbp)
jne    113b <char_needs_escaping+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <char_needs_escaping+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_needs_escaping>:
test   %edi,%edi
js     1120 <char_needs_escaping+0x20>
mov    $0x1,%eax
cmp    $0x20,%edi
jb     111f <char_needs_escaping+0x1f>
cmp    $0x5c,%edi
sete   %al
cmp    $0x22,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @char_needs_escaping(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 32
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 34
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 92
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @char_needs_escaping(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = icmp ult i32 %0, 32
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp eq i32 %0, 92
%7 = icmp eq i32 %0, 34
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %5, %3
%11 = phi i32 [ 1, %3 ], [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ BITHLm(int);
void BIT7HLm() { BITHLm(0x80); }


x86 assembly (clang, -O0):
<BIT7HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <BITHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIT7HLm>:
mov    $0x80,%edi
jmp    1030 <BITHLm@plt>

LLVM IR (-O0):
define void @BIT7HLm() {
%1 = call i32 @BITHLm(i32 128)
ret void
}

LLVM IR (-O2):
define void @BIT7HLm() {
%1 = tail call i32 @BITHLm(i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_queue();
int /*<<< orphan*/ test_queue_array_pos();
int /*<<< orphan*/ test_queue_internals();
int main() {
  test_queue_array_pos();
  test_queue_internals();
  test_queue();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_queue_array_pos@plt>
mov    $0x0,%al
call   1030 <test_queue_internals@plt>
mov    $0x0,%al
call   1050 <test_queue@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_queue_array_pos()
%2 = tail call i32 (...) @test_queue_internals()
%3 = tail call i32 (...) @test_queue()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int dk_free(void *ptr, size_t sz) {
  free(ptr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dk_free(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *mmalloc(size_t size) {
  void *alloc;
  alloc = malloc(size);
  if (!alloc) {
    fprintf(stderr, "CRITICAL: Can't allocate memory (%ld bytes).\n",
            (long int)size);
    _exit(71);
    return NULL;
  } else
    return alloc;
}


x86 assembly (clang, -O0):
<mmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <mmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x47,%edi
call   1030 <_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <mmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x47,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"CRITICAL: Can't allocate memory (%ld bytes).\0A\00"
define i8* @mmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @_exit(i32 71)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"CRITICAL: Can't allocate memory (%ld bytes).\0A\00"
define noalias i8* @mmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @_exit(i32 71)
unreachable
8: ; preds = %1
ret i8* %2
}
void display_clear(unsigned int color) {
  *((volatile unsigned int *)((void *)((char *)(0x040000c0 << 2) +
                                       (0x00000000 << 2)))) = color;
}


x86 assembly (clang, -O0):
<display_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10000300,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_clear>:
mov    %edi,0x10000300
ret

LLVM IR (-O0):
define void @display_clear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 268436224 to i32*)
ret void
}

LLVM IR (-O2):
define void @display_clear(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 268436224 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hel\lo, \world\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main() {
  int a = 100;
  int b = 20;
  return a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 120
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t pix888(const void *buf, unsigned i) {
  const uint8_t *pix = (const uint8_t *)buf + 3 * i;
  uint32_t r = pix[0];
  uint32_t g = pix[1];
  uint32_t b = pix[2];
  return (r << 16) | (g << 8) | (b);
}


x86 assembly (clang, -O0):
<pix888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
mov    %ecx,%ecx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x10,%eax
mov    -0x20(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix888>:
lea    (%rsi,%rsi,2),%ecx
mov    (%rdi,%rcx,4),%edx
mov    0x4(%rdi,%rcx,4),%eax
shl    $0x10,%edx
shl    $0x8,%eax
or     %edx,%eax
or     0x8(%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @pix888(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %4
%12 = mul i32 3, %11
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
store i32 %17, i32* %6
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
store i32 %20, i32* %7
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
store i32 %23, i32* %8
%24 = load i32, i32* %6
%25 = shl i32 %24, 16
%26 = load i32, i32* %7
%27 = shl i32 %26, 8
%28 = or i32 %25, %27
%29 = load i32, i32* %8
%30 = or i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @pix888(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = mul i32 %1, 3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %6, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %7, 16
%13 = shl i32 %9, 8
%14 = or i32 %13, %12
%15 = or i32 %14, %11
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ csc_strlcpy(char *, char *, int);
char *getenv(char *);
char *smm_userpath(char *buffer, int len) {
  char *bpath;
  *buffer = 0;
  if ((bpath = getenv("HOME")) != NULL) {
    csc_strlcpy(buffer, bpath, len);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<smm_userpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
lea    0xec3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <smm_userpath+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <csc_strlcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smm_userpath>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0x0,(%rdi)
lea    0xece(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1149 <smm_userpath+0x29>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1040 <csc_strlcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i8* @smm_userpath(i8* returned %0, i32 %1) {
store i8 0, i8* %0
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @csc_strlcpy(i8* %0, i8* %3, i32 %1)
br label %7
7: ; preds = %5, %2
ret i8* %0
}
int bitcount_(double *x) {
  int b;
  unsigned long *y;
  double z;
  z = *x;
  y = (unsigned long *)&z;
  for (b = 0; *y != 0; *y >>= 1)
    if (*y & 01)
      b++;
  return b;
}


x86 assembly (clang, -O0):
<bitcount_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <bitcount_+0x68>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1150 <bitcount_+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <bitcount_+0x55>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
shr    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1124 <bitcount_+0x24>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount_>:
mov    (%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1123 <bitcount_+0x23>
mov    %rcx,%rdx
nopl   (%rax)
mov    %ecx,%esi
and    $0x1,%esi
add    %esi,%eax
shr    %rdx
cmp    $0x1,%rcx
mov    %rdx,%rcx
ja     1110 <bitcount_+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount_(double* nocapture %0) {
%2 = bitcast double* %0 to i64*
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %10, %5 ], [ 0, %1 ]
%7 = phi i64 [ %11, %5 ], [ %3, %1 ]
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 1
%10 = add nuw nsw i32 %9, %6
%11 = lshr i64 %7, 1
%12 = icmp ult i64 %7, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ test_dmd_block_comment();
int /*<<< orphan*/ test_dmd_comment_entities();
int /*<<< orphan*/ test_dmd_comments();
int /*<<< orphan*/ test_dmd_empty_comments();
int /*<<< orphan*/ test_dmd_nested_block_comment();
int /*<<< orphan*/ test_dmd_strings();
void all_dmd_tests() {
  test_dmd_comments();
  test_dmd_empty_comments();
  test_dmd_strings();
  test_dmd_block_comment();
  test_dmd_nested_block_comment();
  test_dmd_comment_entities();
}


x86 assembly (clang, -O0):
<all_dmd_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_dmd_comments@plt>
mov    $0x0,%al
call   1040 <test_dmd_empty_comments@plt>
mov    $0x0,%al
call   1070 <test_dmd_strings@plt>
mov    $0x0,%al
call   1050 <test_dmd_block_comment@plt>
mov    $0x0,%al
call   1080 <test_dmd_nested_block_comment@plt>
mov    $0x0,%al
call   1060 <test_dmd_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_dmd_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_dmd_comments@plt>
xor    %eax,%eax
call   1040 <test_dmd_empty_comments@plt>
xor    %eax,%eax
call   1070 <test_dmd_strings@plt>
xor    %eax,%eax
call   1050 <test_dmd_block_comment@plt>
xor    %eax,%eax
call   1080 <test_dmd_nested_block_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_dmd_comment_entities@plt>

LLVM IR (-O0):
define void @all_dmd_tests() {
%1 = call i32 (...) @test_dmd_comments()
%2 = call i32 (...) @test_dmd_empty_comments()
%3 = call i32 (...) @test_dmd_strings()
%4 = call i32 (...) @test_dmd_block_comment()
%5 = call i32 (...) @test_dmd_nested_block_comment()
%6 = call i32 (...) @test_dmd_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_dmd_tests() {
%1 = tail call i32 (...) @test_dmd_comments()
%2 = tail call i32 (...) @test_dmd_empty_comments()
%3 = tail call i32 (...) @test_dmd_strings()
%4 = tail call i32 (...) @test_dmd_block_comment()
%5 = tail call i32 (...) @test_dmd_nested_block_comment()
%6 = tail call i32 (...) @test_dmd_comment_entities()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *subwin(int /*<<< orphan*/ *, int, int, int, int);
WINDOW *create_window(WINDOW *main, int wid, int hgt, int x, int y) {
  WINDOW *win;
  win = subwin(main, wid, hgt, x, y);
  return win;
}


x86 assembly (clang, -O0):
<create_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <subwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_window>:
jmp    1030 <subwin@plt>

LLVM IR (-O0):
define i32* @create_window(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32* @subwin(i32* %12, i32 %13, i32 %14, i32 %15, i32 %16)
store i32* %17, i32** %11
%18 = load i32*, i32** %11
ret i32* %18
}

LLVM IR (-O2):
define i32* @create_window(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32* @subwin(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ marker_B();
int /*<<< orphan*/ mutual_test_3(int);
void mutual_test_2(int flag) {
  marker_B();
  if (flag)
    mutual_test_3(flag);
}


x86 assembly (clang, -O0):
<mutual_test_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <marker_B@plt>
cmpl   $0x0,-0x4(%rbp)
je     1144 <mutual_test_2+0x24>
mov    -0x4(%rbp),%edi
call   1030 <mutual_test_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutual_test_2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <marker_B@plt>
test   %ebx,%ebx
je     1136 <mutual_test_2+0x16>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <mutual_test_3@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mutual_test_2(i32 %0) {
%2 = tail call i32 (...) @marker_B()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mutual_test_3(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_output_send_done(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 2);
}


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

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

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_output_send_done(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 2)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_output_send_done(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void short_put(signed short number, FILE *stream) {
  if (number > (signed short)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    short_put(number / (signed short)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (signed short)10), stream);
}


x86 assembly (clang, -O0):
<short_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    1158 <short_put+0x38>
movswl -0x2(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1030 <short_put@plt>
movswl -0x2(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0xa,%bp
jl     1142 <short_put+0x22>
movzwl %bp,%eax
imul   $0xcccd,%eax,%edi
shr    $0x13,%edi
mov    %rbx,%rsi
call   1030 <short_put@plt>
movswl %bp,%eax
imul   $0x6667,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x12,%eax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
add    $0x30,%bpl
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
define void @short_put(i16 signext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = icmp sgt i32 %6, 9
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = sdiv i32 %10, 10
%12 = trunc i32 %11 to i16
%13 = load i32*, i32** %4
br label %14
14: ; preds = %8, %2
%15 = load i16, i16* %3
%16 = sext i16 %15 to i32
%17 = srem i32 %16, 10
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @short_put(i16 signext %0, i32* nocapture %1) {
%3 = icmp sgt i16 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i16 %0, 10
tail call void @short_put(i16 signext %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = srem i16 %0, 10
%8 = trunc i16 %7 to i8
%9 = add nsw i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
void _Jv_NewObjectArray() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_NewObjectArray() {
ret void
}
/* Variables and functions */
int allowed_env(char const *, char *);
int allowed(const char *pathname, int flags) {
  if (flags & 0100)
    return allowed_env(pathname, "ALLOWED_FOR_CREATE");
  else
    return allowed_env(pathname, "ALLOWED_FOR_READ");
}


x86 assembly (clang, -O0):
<allowed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1146 <allowed+0x36>
mov    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <allowed_env@plt>
mov    %eax,-0x4(%rbp)
jmp    1159 <allowed+0x49>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <allowed_env@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allowed>:
test   $0x40,%sil
lea    0xef8(%rip),%rax
lea    0xede(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <allowed_env@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"ALLOWED_FOR_CREATE\00"
@.str.1 = [17 x i8] c"ALLOWED_FOR_READ\00"
define i32 @allowed(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 64
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @allowed_env(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @allowed_env(i8* %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"ALLOWED_FOR_CREATE\00"
@.str.1 = [17 x i8] c"ALLOWED_FOR_READ\00"
define i32 @allowed(i8* %0, i32 %1) {
%3 = and i32 %1, 64
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @allowed_env(i8* %0, i8* %5)
ret i32 %6
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int t2p_orig_gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ t2p_time2posix_timeval(struct timeval *);
int gettimeofday(struct timeval *tv, struct timezone *tz) {
  int res = t2p_orig_gettimeofday(tv, tz);
  if (tv != NULL)
    t2p_time2posix_timeval(tv);
  return res;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <t2p_orig_gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <gettimeofday+0x34>
mov    -0x8(%rbp),%rdi
call   1040 <t2p_time2posix_timeval@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <t2p_orig_gettimeofday@plt>
mov    %eax,%ebp
test   %rbx,%rbx
je     113a <gettimeofday+0x1a>
mov    %rbx,%rdi
call   1040 <t2p_time2posix_timeval@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
%5 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = load %struct.timezone*, %struct.timezone** %4
%8 = call i32 @t2p_orig_gettimeofday(%struct.timeval* %6, %struct.timezone* %7)
store i32 %8, i32* %5
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = icmp ne %struct.timeval* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = call i32 @t2p_time2posix_timeval(%struct.timeval* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = tail call i32 @t2p_orig_gettimeofday(%struct.timeval* %0, %struct.timezone* %1)
%4 = icmp eq %struct.timeval* %0, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @t2p_time2posix_timeval(%struct.timeval* %0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
double floor(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.floor = [6 x i8] c"floor\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.floor, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.floor = [6 x i8] c"floor\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @floor(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.floor, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "Hello world!\n", 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_preg32pimm32_reg32(int reg1, unsigned int imm32, int reg2) {
  put8(0x89);
  put8(0x80 | reg1 | (reg2 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_preg32pimm32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg32pimm32_reg32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x89,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_preg32pimm32_reg32(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 137)
%8 = load i32, i32* %4
%9 = or i32 128, %8
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = or i32 %9, %11
%13 = call i32 @put8(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @put32(i32 %14)
ret void
}

LLVM IR (-O2):
define void @mov_preg32pimm32_reg32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 137)
%5 = shl i32 %2, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 128
%8 = tail call i32 @put8(i32 %7)
%9 = tail call i32 @put32(i32 %1)
ret void
}
void library_finalizer(void *client_state) {}


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

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

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

LLVM IR (-O2):
define void @library_finalizer(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char);
void makeStatus(char *status, int floor, char dir) {
  sprintf(status, "MY_STATUS_%d_%c", floor, dir);
}


x86 assembly (clang, -O0):
<makeStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rsi
movsbl -0xd(%rbp),%ecx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeStatus>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"MY_STATUS_%d_%c\00"
define void @makeStatus(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"MY_STATUS_%d_%c\00"
define void @makeStatus(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i8 signext %2)
ret void
}
void test39_Test0_isr__I() {}


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

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

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

LLVM IR (-O2):
define void @test39_Test0_isr__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo3(int *);
void bar3(void) {
  int x;
  if (x)
    foo3(&x);
}


x86 assembly (clang, -O0):
<bar3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x4(%rbp)
je     112b <bar3+0x1b>
lea    -0x4(%rbp),%rdi
call   1030 <foo3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar3>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <foo3@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @bar3() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @foo3(i32* %1)
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @bar3() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @foo3(i32* %1)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ terminal_putchar(char const);
void terminal_writestring(const char *data) {
  size_t len = strlen(data);
  for (size_t i = 0; i < len; i++)
    terminal_putchar(data[i]);
}


x86 assembly (clang, -O0):
<terminal_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <terminal_writestring+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <terminal_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <terminal_writestring+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_writestring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <terminal_writestring+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <terminal_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <terminal_writestring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @terminal_writestring(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @terminal_putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
int atomic_cas(volatile int *i, int before, int after) {
  return __sync_bool_compare_and_swap(i, before, after);
}


x86 assembly (clang, -O0):
<atomic_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cas>:
mov    %esi,%eax
xor    %ecx,%ecx
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atomic_cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @atomic_cas(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void setupBoard() {
  (*(volatile unsigned char *)(void *)(0x80000000 + 0x000A4F)) =
      (0 | (0x04) | (0x08));
  (*(volatile unsigned char *)(void *)(0x80000000 + 0x000A4E)) =
      (0 | (0x04) | (0x08));
  (*(volatile unsigned int *)(void *)(0x80000000 + 0x00050C)) = 0xF0000000;
  (*(volatile unsigned char *)(void *)(0x80000000 + 0x000A43)) &= 0x3F;
}


x86 assembly (clang, -O0):
<setupBoard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000a4f,%eax
movb   $0xc,(%rax)
mov    $0x80000a4e,%eax
movb   $0xc,(%rax)
mov    $0x8000050c,%eax
movl   $0xf0000000,(%rax)
mov    $0x80000a43,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x3f,%eax
mov    %al,%cl
mov    $0x80000a43,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupBoard>:
mov    $0x80000a43,%eax
movb   $0xc,0xc(%rax)
movb   $0xc,0xb(%rax)
movl   $0xf0000000,-0x537(%rax)
andb   $0x3f,(%rax)
ret

LLVM IR (-O0):
define void @setupBoard() {
store volatile i8 12, i8* inttoptr (i64 2147486287 to i8*)
store volatile i8 12, i8* inttoptr (i64 2147486286 to i8*)
store volatile i32 -268435456, i32* inttoptr (i64 2147484940 to i32*)
%1 = load volatile i8, i8* inttoptr (i64 2147486275 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, 63
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 2147486275 to i8*)
ret void
}

LLVM IR (-O2):
define void @setupBoard() {
store volatile i8 12, i8* inttoptr (i64 2147486287 to i8*)
store volatile i8 12, i8* inttoptr (i64 2147486286 to i8*)
store volatile i32 -268435456, i32* inttoptr (i64 2147484940 to i32*)
%1 = load volatile i8, i8* inttoptr (i64 2147486275 to i8*)
%2 = and i8 %1, 63
store volatile i8 %2, i8* inttoptr (i64 2147486275 to i8*)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool des_getParityBitFromKey(uint8_t key) {
  bool parity = ((key & 0x80) >> 7) ^ ((key & 0x40) >> 6) ^
                ((key & 0x20) >> 5) ^ ((key & 0x10) >> 4) ^
                ((key & 0x08) >> 3) ^ ((key & 0x04) >> 2) ^ ((key & 0x02) >> 1);
  return !parity;
}


x86 assembly (clang, -O0):
<des_getParityBitFromKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
sar    $0x7,%eax
mov    -0x4(%rbp),%ecx
and    $0x40,%ecx
sar    $0x6,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x20,%ecx
sar    $0x5,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x10,%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x8,%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x4,%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<des_getParityBitFromKey>:
mov    %edi,%eax
shr    $0x7,%eax
mov    %edi,%ecx
shr    $0x6,%ecx
xor    %eax,%ecx
mov    %edi,%eax
shr    $0x5,%eax
mov    %edi,%edx
shr    $0x4,%edx
xor    %eax,%edx
xor    %ecx,%edx
mov    %edi,%ecx
shr    $0x3,%ecx
mov    %edi,%eax
shr    $0x2,%eax
xor    %ecx,%eax
shr    %edi
xor    %edi,%eax
xor    %edx,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @des_getParityBitFromKey(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 128
%6 = ashr i32 %5, 7
%7 = load i32, i32* %2
%8 = and i32 %7, 64
%9 = ashr i32 %8, 6
%10 = xor i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 32
%13 = ashr i32 %12, 5
%14 = xor i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 16
%17 = ashr i32 %16, 4
%18 = xor i32 %14, %17
%19 = load i32, i32* %2
%20 = and i32 %19, 8
%21 = ashr i32 %20, 3
%22 = xor i32 %18, %21
%23 = load i32, i32* %2
%24 = and i32 %23, 4
%25 = ashr i32 %24, 2
%26 = xor i32 %22, %25
%27 = load i32, i32* %2
%28 = and i32 %27, 2
%29 = ashr i32 %28, 1
%30 = xor i32 %26, %29
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @des_getParityBitFromKey(i32 %0) {
%2 = lshr i32 %0, 7
%3 = lshr i32 %0, 6
%4 = xor i32 %2, %3
%5 = lshr i32 %0, 5
%6 = xor i32 %4, %5
%7 = lshr i32 %0, 4
%8 = xor i32 %6, %7
%9 = lshr i32 %0, 3
%10 = xor i32 %8, %9
%11 = lshr i32 %0, 2
%12 = xor i32 %10, %11
%13 = lshr i32 %0, 1
%14 = xor i32 %12, %13
%15 = and i32 %14, 1
%16 = xor i32 %15, 1
ret i32 %16
}
void set(int *a, int *b, int a_val, int b_val) {
  *a = a_val;
  *b = b_val;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
mov    %edx,(%rdi)
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define void @set(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i32 %3) {
store i32 %2, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __inc_remove_counter();
int __renameat(int, char const *, int, char const *);
int renameat(int oldfd, const char *old, int newfd, const char *new) {
  int res = __renameat(oldfd, old, newfd, new);
  if (res == 0)
    __inc_remove_counter();
  return res;
}


x86 assembly (clang, -O0):
<renameat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <__renameat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    115d <renameat+0x3d>
mov    $0x0,%al
call   1040 <__inc_remove_counter@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameat>:
push   %rbx
call   1030 <__renameat@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1133 <renameat+0x13>
xor    %eax,%eax
call   1040 <__inc_remove_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @renameat(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @__renameat(i32 %0, i8* %1, i32 %2, i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @__inc_remove_counter()
br label %9
9: ; preds = %7, %4
ret i32 %5
}