xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x99() {
  Assert_real((isprint(153) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              770, ("isprint should be 0 for 0x99"));
}


x86 assembly (clang, -O0):
<t_isprint_0x99>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x302,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x99>:
push   %rax
mov    $0x99,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x302,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x99\00"
define void @t_isprint_0x99() {
%1 = call i64 @isprint(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x99\00"
define void @t_isprint_0x99() {
%1 = tail call i64 @isprint(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_7Auint8_mem(unsigned char *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Auint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Auint8_mem>:
testb  $0x7a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Auint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 122
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_7Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 122
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rand_rel(struct RelationAttrib *ra, int relType) {}


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

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

LLVM IR (-O0):
%struct.RelationAttrib = type opaque
define void @rand_rel(%struct.RelationAttrib* %0, i32 %1) {
%3 = alloca %struct.RelationAttrib*
%4 = alloca i32
store %struct.RelationAttrib* %0, %struct.RelationAttrib** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.RelationAttrib = type opaque
define void @rand_rel(%struct.RelationAttrib* nocapture %0, i32 %1) {
ret void
}
int main(void) {
  int i;
  return 0;
  while (1) {
  }
  for (i = 0; i < 1;) {
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ss2sss(float);
void ss2sss_(float *spd) { ss2sss(*spd); }


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

x86 assembly (clang, -O2):
<ss2sss_>:
movss  (%rdi),%xmm0
jmp    1030 <ss2sss@plt>

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

LLVM IR (-O2):
define void @ss2sss_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @ss2sss(float %2)
ret void
}
/* Variables and functions */
float GGX(float, float);
float GeometrySmith(float NdotV, float NdotL, float roughness) {
  float a = (roughness * roughness);
  return GGX(NdotV, a) * GGX(NdotL, a);
}


x86 assembly (clang, -O0):
<GeometrySmith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <GGX@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <GGX@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeometrySmith>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
mulss  %xmm2,%xmm2
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm1
call   1030 <GGX@plt>
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <GGX@plt>
mulss  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @GeometrySmith(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %6
%10 = fmul float %8, %9
store float %10, float* %7
%11 = load float, float* %4
%12 = load float, float* %7
%13 = call float @GGX(float %11, float %12)
%14 = load float, float* %5
%15 = load float, float* %7
%16 = call float @GGX(float %14, float %15)
%17 = fmul float %13, %16
ret float %17
}

LLVM IR (-O2):
define float @GeometrySmith(float %0, float %1, float %2) {
%4 = fmul float %2, %2
%5 = tail call float @GGX(float %0, float %4)
%6 = tail call float @GGX(float %1, float %4)
%7 = fmul float %5, %6
ret float %7
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int UINT16(void const *const);
uint16_t DVB_PID(const void *const ptr) { return UINT16(ptr) & 0x1fff; }


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

x86 assembly (clang, -O2):
<DVB_PID>:
push   %rax
call   1030 <UINT16@plt>
and    $0x1fff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DVB_PID(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UINT16(i8* %3)
%5 = and i32 %4, 8191
ret i32 %5
}

LLVM IR (-O2):
define i32 @DVB_PID(i8* %0) {
%2 = tail call i32 @UINT16(i8* %0)
%3 = and i32 %2, 8191
ret i32 %3
}
int test_imm_E5uint8_reg(unsigned char val) {
  return ((val) & (-0xE5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E5uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff1b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E5uint8_reg>:
test   $0x1b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E5uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -229
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E5uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 27
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int atoi(char *);
int factorial(int);
int /*<<< orphan*/ printUsage();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  if (argc != 2) {
    printUsage();
    return 0;
  }
  int n = atoi(argv[1]);
  printf("factorial(%d): %d\n", n, factorial(n));
  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)
cmpl   $0x2,-0x8(%rbp)
je     1173 <main+0x33>
mov    $0x0,%al
call   1050 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a9 <main+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    116a <main+0x2a>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <factorial@plt>
lea    0xea1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
jmp    1171 <main+0x31>
xor    %eax,%eax
call   1050 <printUsage@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"factorial(%d): %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @printUsage()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @factorial(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
bool nrf51_errata_46(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_46() {
ret i32 0
}
void test_isgreaterequal(double x, double y, int true) {
  if (__builtin_isgreaterequal(x, y)) {
    if (!true)
      abort();
  } else {
    if (true)
      abort();
  }
}


x86 assembly (clang, -O0):
<test_isgreaterequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1149 <test_isgreaterequal+0x39>
cmpl   $0x0,-0x14(%rbp)
jne    1144 <test_isgreaterequal+0x34>
call   1030 <abort@plt>
jmp    115d <test_isgreaterequal+0x4d>
cmpl   $0x0,-0x14(%rbp)
je     1158 <test_isgreaterequal+0x48>
call   1030 <abort@plt>
jmp    115d <test_isgreaterequal+0x4d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isgreaterequal>:
push   %rax
ucomisd %xmm1,%xmm0
jae    1120 <test_isgreaterequal+0x10>
test   %edi,%edi
je     1124 <test_isgreaterequal+0x14>
call   1030 <abort@plt>
test   %edi,%edi
je     111b <test_isgreaterequal+0xb>
pop    %rax
ret

LLVM IR (-O0):
define void @test_isgreaterequal(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp oge double %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
unreachable
14: ; preds = %10
br label %20
15: ; preds = %3
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
unreachable
19: ; preds = %15
br label %20
20: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @test_isgreaterequal(double %0, double %1, i32 %2) {
%4 = fcmp ult double %0, %1
%5 = icmp eq i32 %2, 0
br i1 %4, label %8, label %6
6: ; preds = %3
br i1 %5, label %7, label %10
7: ; preds = %6
tail call void @abort()
unreachable
8: ; preds = %3
br i1 %5, label %10, label %9
9: ; preds = %8
tail call void @abort()
unreachable
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_stats();
int /*<<< orphan*/ printf(char *, int);
void event_replay_end(int err) {
  printf("# replay end: err=%d\n", err);
  dump_stats();
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"# replay end: err=%d\0A\00"
define void @event_replay_end(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @dump_stats()
ret void
}
int nextPOT(int in) {
  in--;
  in |= in >> 1;
  in |= in >> 2;
  in |= in >> 4;
  in |= in >> 8;
  in |= in >> 16;
  in++;
  return in;
}


x86 assembly (clang, -O0):
<nextPOT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPOT>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nextPOT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @nextPOT(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
void __svgalib_rendition_attscreen(int i) {}


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

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

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

LLVM IR (-O2):
define void @__svgalib_rendition_attscreen(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_36(void) {
  if ((*(uint32_t *)0x10000130ul == 0xAul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xa,%rax
jne    1134 <errata_36+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_36+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_36+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_36() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_36() {
ret i32 1
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_13(uint64_t x) {
  __asm__("rolq $13, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_13>:
mov    %rdi,%rax
rol    $0xd,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_13(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$13, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_13(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$13, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int op_add(int, int);
int test_add() {
  if (op_add(3, 4) != (3 + 4))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<test_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_add@plt>
cmp    $0x7,%eax
je     113c <test_add+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <test_add+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_add@plt>
xor    %ecx,%ecx
cmp    $0x7,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_add() {
%1 = tail call i32 @op_add(i32 3, i32 4)
%2 = icmp ne i32 %1, 7
%3 = sext i1 %2 to i32
ret i32 %3
}
int getStringSize(char *string) {
  int size = 0;
  while (string[++size] != '\x0')
    ;
  return size;
}


x86 assembly (clang, -O0):
<getStringSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <getStringSize+0x31>
jmp    110f <getStringSize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringSize>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <getStringSize+0x10>
ret

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

LLVM IR (-O2):
define i32 @getStringSize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void baz(void) { printf("weak_as_needed_b: baz\n"); }


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

x86 assembly (clang, -O2):
<baz>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [22 x i8] c"weak_as_needed_b: baz\00"
define void @baz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct lruTable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct lruTable *);
void free_lruTable(struct lruTable *lt) { free(lt); }


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

x86 assembly (clang, -O2):
<free_lruTable>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.lruTable = type { i32 }
define void @free_lruTable(%struct.lruTable* nocapture %0) {
%2 = tail call i32 @free(%struct.lruTable* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int const);
void prng_stdlib_init_seed_with_value(const unsigned int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<prng_stdlib_init_seed_with_value>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @prng_stdlib_init_seed_with_value(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
void nmra2_to_lenz2(unsigned int nmra_a, unsigned char nmra_p,
                    unsigned int *lenz, unsigned char *port) {
  if (nmra_a == 0) {
    *lenz = 0;
    *port = 0;
  } else {
    *lenz = (nmra_a - 1) << 2;
    *lenz += (nmra_p >> 1) + 1;
    *port = nmra_p & 0x01;
  }
}


x86 assembly (clang, -O0):
<nmra2_to_lenz2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1135 <nmra2_to_lenz2+0x35>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1165 <nmra2_to_lenz2+0x65>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x5(%rbp),%ecx
sar    $0x1,%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movzbl -0x5(%rbp),%eax
and    $0x1,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmra2_to_lenz2>:
test   %edi,%edi
je     111b <nmra2_to_lenz2+0x1b>
mov    %esi,%eax
shr    %al
movzbl %al,%eax
lea    (%rax,%rdi,4),%eax
add    $0xfffffffd,%eax
mov    %eax,(%rdx)
and    $0x1,%sil
mov    %sil,(%rcx)
ret
movl   $0x0,(%rdx)
xor    %esi,%esi
mov    %sil,(%rcx)
ret

LLVM IR (-O0):
define void @nmra2_to_lenz2(i32 %0, i8 zeroext %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i8*
store i32 %0, i32* %5
store i8 %1, i8* %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32*, i32** %7
store i32 0, i32* %12
%13 = load i8*, i8** %8
store i8 0, i8* %13
br label %31
14: ; preds = %4
%15 = load i32, i32* %5
%16 = sub i32 %15, 1
%17 = shl i32 %16, 2
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 1
%22 = add nsw i32 %21, 1
%23 = load i32*, i32** %7
%24 = load i32, i32* %23
%25 = add i32 %24, %22
store i32 %25, i32* %23
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = and i32 %27, 1
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %8
store i8 %29, i8* %30
br label %31
31: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
define void @nmra2_to_lenz2(i32 %0, i8 zeroext %1, i32* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %7
6: ; preds = %4
store i32 0, i32* %2
br label %14
7: ; preds = %4
%8 = shl i32 %0, 2
%9 = lshr i8 %1, 1
%10 = zext i8 %9 to i32
%11 = add i32 %8, -3
%12 = add i32 %11, %10
store i32 %12, i32* %2
%13 = and i8 %1, 1
br label %14
14: ; preds = %7, %6
%15 = phi i8 [ %13, %7 ], [ 0, %6 ]
store i8 %15, i8* %3
ret void
}
/* Variables and functions */
void *__sbrk(intptr_t increment) { return (void *)-1; }


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

x86 assembly (clang, -O2):
<__sbrk>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @__sbrk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @__sbrk(i64 %0) {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ tty_error(int, char *);
void mem_error(void) { tty_error(0x10, "the system is out of memory"); }


x86 assembly (clang, -O0):
<mem_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
lea    0xee0(%rip),%rsi
call   1030 <tty_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_error>:
lea    0xee9(%rip),%rsi
mov    $0x10,%edi
jmp    1030 <tty_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"the system is out of memory\00"
define void @mem_error() {
%1 = call i32 @tty_error(i32 16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"the system is out of memory\00"
define void @mem_error() {
%1 = tail call i32 @tty_error(i32 16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *D2Q9_Reverse() {
  int *vel;
  vel = (int *)malloc(9 * sizeof(int));
  vel[0] = 0;
  vel[1] = 3;
  vel[2] = 4;
  vel[3] = 1;
  vel[4] = 2;
  vel[5] = 7;
  vel[6] = 8;
  vel[7] = 5;
  vel[8] = 6;
  return vel;
}


x86 assembly (clang, -O0):
<D2Q9_Reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x24,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x4,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x7,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x6,0x20(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<D2Q9_Reverse>:
push   %rax
mov    $0x24,%edi
call   1030 <malloc@plt>
movaps 0xede(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xee4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movl   $0x6,0x20(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @D2Q9_Reverse() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 36)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 0, i32* %5
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 3, i32* %7
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 4, i32* %9
%10 = load i32*, i32** %1
%11 = getelementptr inbounds i32, i32* %10, i64 3
store i32 1, i32* %11
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 4
store i32 2, i32* %13
%14 = load i32*, i32** %1
%15 = getelementptr inbounds i32, i32* %14, i64 5
store i32 7, i32* %15
%16 = load i32*, i32** %1
%17 = getelementptr inbounds i32, i32* %16, i64 6
store i32 8, i32* %17
%18 = load i32*, i32** %1
%19 = getelementptr inbounds i32, i32* %18, i64 7
store i32 5, i32* %19
%20 = load i32*, i32** %1
%21 = getelementptr inbounds i32, i32* %20, i64 8
store i32 6, i32* %21
%22 = load i32*, i32** %1
ret i32* %22
}

LLVM IR (-O2):
define i32* @D2Q9_Reverse() {
%1 = tail call i64 @malloc(i32 36)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 3, i32 4, i32 1>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %2, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 2, i32 7, i32 8, i32 5>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %2, i64 8
store i32 6, i32* %6
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func3d88() {
  printf("func3d88 is called!\n");
  return 0x67abe24dd;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"func3d88 is called!\0A\00"
define i32 @func3d88() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 2059281629
}

LLVM IR (-O2):
@str = [20 x i8] c"func3d88 is called!\00"
define i32 @func3d88() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 2059281629
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void usage(void) {
  write(2, "date: [-u]\n", 11);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"date: [-u]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"date: [-u]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_twos_complement(void) { gen_call("_neg"); }


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

x86 assembly (clang, -O2):
<gen_twos_complement>:
lea    0xee9(%rip),%rdi
jmp    1030 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_neg\00"
define void @gen_twos_complement() {
%1 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_neg\00"
define void @gen_twos_complement() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_IO();
int /*<<< orphan*/ setup_TIM1();
void setup() {
  setup_IO();
  setup_TIM1();
}


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

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

LLVM IR (-O0):
define void @setup() {
%1 = call i32 (...) @setup_IO()
%2 = call i32 (...) @setup_TIM1()
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @setup_IO()
%2 = tail call i32 (...) @setup_TIM1()
ret void
}
int getStartValueImpl() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getStartValueImpl() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex32array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 32));
}


x86 assembly (clang, -O0):
<pushcomplex32array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x5,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex32array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 32
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int lchmod(char const *, int /*<<< orphan*/);
int _lchmod(const char *path, mode_t mode) { return lchmod(path, mode); }


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

x86 assembly (clang, -O2):
<_lchmod>:
jmp    1030 <lchmod@plt>

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

LLVM IR (-O2):
define i32 @_lchmod(i8* %0, i32 %1) {
%3 = tail call i32 @lchmod(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int fd;
  fd = open("/dev/zlc0", 0);
  if (fd < 0) {
    perror("111 222 333 444 openfail:");
    printf("555 666\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    118c <main+0x4c>
lea    0xe99(%rip),%rdi
call   1050 <perror@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
test   %eax,%eax
js     1157 <main+0x17>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/zlc0\00"
@.str.1 = [26 x i8] c"111 222 333 444 openfail:\00"
@.str.2 = [9 x i8] c"555 666\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/zlc0\00"
@.str.1 = [26 x i8] c"111 222 333 444 openfail:\00"
@str = [8 x i8] c"555 666\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           unsigned int);
void stic_assert_success(int test, const char function[], unsigned int line) {
  stic_simple_test_result(test == 0, "Should have been success (zero)",
                          function, line);
}


x86 assembly (clang, -O0):
<stic_assert_success>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xec4(%rip),%rsi
call   1030 <stic_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Should have been success (zero)\00"
define void @stic_assert_success(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @stic_simple_test_result(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Should have been success (zero)\00"
define void @stic_assert_success(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @stic_simple_test_result(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("bgrep"
         " version "
         "0.4.0"
         "\n");
}


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"bgrep version 0.4.0\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"bgrep version 0.4.0\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};
struct io_mapping {
  int dummy;
};

/* Variables and functions */
struct io_mapping *io_mapping_create_wc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pci_resource_len(struct pci_dev *, int);
int /*<<< orphan*/ pci_resource_start(struct pci_dev *, int);
struct io_mapping *fbmem_init(struct pci_dev *pdev) {
  return io_mapping_create_wc(pci_resource_start(pdev, 1),
                              pci_resource_len(pdev, 1));
}


x86 assembly (clang, -O0):
<fbmem_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <pci_resource_start@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <pci_resource_len@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <io_mapping_create_wc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbmem_init>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1050 <pci_resource_start@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <pci_resource_len@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <io_mapping_create_wc@plt>

LLVM IR (-O0):
%struct.io_mapping = type { i32 }
%struct.pci_dev = type { i32 }
define %struct.io_mapping* @fbmem_init(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load %struct.pci_dev*, %struct.pci_dev** %2
%4 = call i32 @pci_resource_start(%struct.pci_dev* %3, i32 1)
%5 = load %struct.pci_dev*, %struct.pci_dev** %2
%6 = call i32 @pci_resource_len(%struct.pci_dev* %5, i32 1)
%7 = call %struct.io_mapping* @io_mapping_create_wc(i32 %4, i32 %6)
ret %struct.io_mapping* %7
}

LLVM IR (-O2):
%struct.io_mapping = type { i32 }
%struct.pci_dev = type { i32 }
define %struct.io_mapping* @fbmem_init(%struct.pci_dev* %0) {
%2 = tail call i32 @pci_resource_start(%struct.pci_dev* %0, i32 1)
%3 = tail call i32 @pci_resource_len(%struct.pci_dev* %0, i32 1)
%4 = tail call %struct.io_mapping* @io_mapping_create_wc(i32 %2, i32 %3)
ret %struct.io_mapping* %4
}
/* Variables and functions */
int /*<<< orphan*/ enable_intr();
int /*<<< orphan*/ init_extint();
int /*<<< orphan*/ init_keyboard();
int /*<<< orphan*/ init_time(int);
int /*<<< orphan*/ init_vga(int);
int /*<<< orphan*/ machine_info();
int main() {
  init_vga(0x00010000);
  init_extint();
  init_time(0x000001f4);
  init_keyboard();
  enable_intr();
  machine_info();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10000,%edi
call   1070 <init_vga@plt>
mov    $0x0,%al
call   1030 <init_extint@plt>
mov    $0x1f4,%edi
call   1080 <init_time@plt>
mov    $0x0,%al
call   1050 <init_keyboard@plt>
mov    $0x0,%al
call   1040 <enable_intr@plt>
mov    $0x0,%al
call   1060 <machine_info@plt>
jmp    119f <main+0x3f>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10000,%edi
call   1070 <init_vga@plt>
xor    %eax,%eax
call   1030 <init_extint@plt>
mov    $0x1f4,%edi
call   1080 <init_time@plt>
xor    %eax,%eax
call   1050 <init_keyboard@plt>
xor    %eax,%eax
call   1040 <enable_intr@plt>
xor    %eax,%eax
call   1060 <machine_info@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    11a0 <main+0x40>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init_vga(i32 65536)
%3 = call i32 (...) @init_extint()
%4 = call i32 @init_time(i32 500)
%5 = call i32 (...) @init_keyboard()
%6 = call i32 (...) @enable_intr()
%7 = call i32 (...) @machine_info()
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init_vga(i32 65536)
%2 = tail call i32 (...) @init_extint()
%3 = tail call i32 @init_time(i32 500)
%4 = tail call i32 (...) @init_keyboard()
%5 = tail call i32 (...) @enable_intr()
%6 = tail call i32 (...) @machine_info()
br label %7
7: ; preds = %0, %7
br label %7
}
/* Variables and functions */
char *replace_env_n(char const *, int /*<<< orphan*/, char **, unsigned int);
int /*<<< orphan*/ strlen(char const *);
char *replace_env(const char *format, char **env, unsigned flags) {
  return replace_env_n(format, strlen(format), env, flags);
}


x86 assembly (clang, -O0):
<replace_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <replace_env_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_env>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <replace_env_n@plt>

LLVM IR (-O0):
define i8* @replace_env(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** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i8**, i8*** %5
%11 = load i32, i32* %6
%12 = call i8* @replace_env_n(i8* %7, i32 %9, i8** %10, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @replace_env(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @replace_env_n(i8* %0, i32 %4, i8** %1, i32 %2)
ret i8* %5
}