xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
char *trim(char *path) {
  int len;
  while (1) {
    len = strlen(path);
    if (path[len - 1] == '/') {
      path[len - 1] = '\0';
    } else {
      return path;
    }
  }
  return path;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1158 <trim+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1162 <trim+0x52>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
jmp    111c <trim+0xc>

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    114d <trim+0x3d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    (%rcx,%rbx,1),%rax
add    $0xffffffffffffffff,%rax
cmpb   $0x2f,-0x1(%rcx,%rbx,1)
je     1130 <trim+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %8, label %16
8: ; preds = %1, %8
%9 = phi i8* [ %13, %8 ], [ %5, %1 ]
store i8 0, i8* %9
%10 = tail call i32 @strlen(i8* %0)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 47
br i1 %15, label %8, label %16
16: ; preds = %8, %1
ret i8* %0
}
void anetBlock(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               38, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<anetBlock>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x26,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetBlock>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x26,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetBlock = [10 x i8] c"anetBlock\00"
define void @anetBlock() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.anetBlock, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetBlock = [10 x i8] c"anetBlock\00"
define void @anetBlock() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.anetBlock, i64 0, i64 0))
ret void
}
int fn1(int a, int b) {
  int tem1 = a & b;
  int tem2 = a ^ b;
  return tem1 ^ tem2;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void waitDatabaseSync() { sleep(2); }


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

x86 assembly (clang, -O2):
<waitDatabaseSync>:
mov    $0x2,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @waitDatabaseSync() {
%1 = call i32 @sleep(i32 2)
ret void
}

LLVM IR (-O2):
define void @waitDatabaseSync() {
%1 = tail call i32 @sleep(i32 2)
ret void
}
add(a, b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void printPrompt() {
  printf("talk> ");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<printPrompt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPrompt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"talk> \00"
@stdout = global i32 0
define void @printPrompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"talk> \00"
@stdout = global i32 0
define void @printPrompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void free_matrix(long long **m, int n) {
  int i;
  for (i = 0; i < n; ++i)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i64** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i64*, i64** %0, i64 %7
%9 = bitcast i64** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i64** %0 to i8*
tail call void @free(i8* %14)
ret void
}
int test_imm_2Cint64_lowword_reg(long long val) {
  return ((val) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_2Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 44
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t u64_b2(uint64_t value) {
  return (uint8_t)((value & 0x0000000000FF0000) >> 16);
}


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

x86 assembly (clang, -O2):
<u64_b2>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @u64_b2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @u64_b2(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
void main() {
  int x;
  x = 0;
  while (1) {
    x = x + 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 4
store i32 %4, i32* %1
br label %2
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
float min3(float a, float b, float c) {
  float ret = a;
  if (b < a)
    ret = b;
  if (c < a)
    ret = c;
  return ret;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <min3+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1157 <min3+0x57>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
minss  %xmm0,%xmm1
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @min3(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* %4
store float %8, float* %7
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load float, float* %5
store float %13, float* %7
br label %14
14: ; preds = %12, %3
%15 = load float, float* %6
%16 = load float, float* %4
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load float, float* %6
store float %19, float* %7
br label %20
20: ; preds = %18, %14
%21 = load float, float* %7
ret float %21
}

LLVM IR (-O2):
define float @min3(float %0, float %1, float %2) {
%4 = fcmp olt float %1, %0
%5 = select i1 %4, float %1, float %0
%6 = fcmp olt float %2, %0
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int failure() {
  __VERIFIER_error();
  return 1;
}


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

x86 assembly (clang, -O2):
<failure>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @failure() {
%1 = call i32 (...) @__VERIFIER_error()
ret i32 1
}

LLVM IR (-O2):
define i32 @failure() {
%1 = tail call i32 (...) @__VERIFIER_error()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xf9() {
  Assert_real((isprint(249) == 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",
              1250, ("isprint should be 0 for 0xf9"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xf9>:
push   %rax
mov    $0xf9,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e2,%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 0xf9\00"
define void @t_isprint_0xf9() {
%1 = call i64 @isprint(i32 249)
%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 1250, 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 0xf9\00"
define void @t_isprint_0xf9() {
%1 = tail call i64 @isprint(i32 249)
%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 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(
      stderr,
      "Usage: rpjtag [options]\n"
      "   -h      Print help\n"
      "	-D	    Debug info\n"
      "	-b		use BDSL file(s) use , as between multiple files\n"
      "			only needed if program doesn't know IDCODE->BDSL file\n"
      "\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [178 x i8] c"Usage: rpjtag [options]\0A -h Print help\0A\09-D\09 Debug info\0A\09-b\09\09use BDSL file(s) use , as between multiple files\0A\09\09\09only needed if program doesn't know IDCODE->BDSL file\0A\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [178 x i8] c"Usage: rpjtag [options]\0A -h Print help\0A\09-D\09 Debug info\0A\09-b\09\09use BDSL file(s) use , as between multiple files\0A\09\09\09only needed if program doesn't know IDCODE->BDSL file\0A\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_dashed_line(void) {
  printf(" --------------------------------------------------------------------"
         "-----------\n");
  return;
}


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

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

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

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

/* Variables and functions */
int lexeme_ring_buffer_size(struct lexeme_ring_buffer const *);
__attribute__((unused)) bool
lexeme_ring_buffer_full(const struct lexeme_ring_buffer *rb) {
  return lexeme_ring_buffer_size(rb) == (4);
}


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

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

LLVM IR (-O0):
%struct.lexeme_ring_buffer = type { i32 }
define i32 @lexeme_ring_buffer_full(%struct.lexeme_ring_buffer* %0) {
%2 = alloca %struct.lexeme_ring_buffer*
store %struct.lexeme_ring_buffer* %0, %struct.lexeme_ring_buffer** %2
%3 = load %struct.lexeme_ring_buffer*, %struct.lexeme_ring_buffer** %2
%4 = call i32 @lexeme_ring_buffer_size(%struct.lexeme_ring_buffer* %3)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.lexeme_ring_buffer = type { i32 }
define i32 @lexeme_ring_buffer_full(%struct.lexeme_ring_buffer* %0) {
%2 = tail call i32 @lexeme_ring_buffer_size(%struct.lexeme_ring_buffer* %0)
%3 = icmp eq i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey_it;
RSA *RSAPublicKey_dup(RSA *rsa) { return ASN1_item_dup(&RSAPublicKey_it, rsa); }


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

x86 assembly (clang, -O2):
<RSAPublicKey_dup>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rdi
jmp    1030 <ASN1_item_dup@plt>

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

LLVM IR (-O2):
@RSAPublicKey_it = global i32 0
define i32* @RSAPublicKey_dup(i32* %0) {
%2 = tail call i32* @ASN1_item_dup(i32* @RSAPublicKey_it, i32* %0)
ret i32* %2
}
/* Variables and functions */
int snprintf(char *, int, char *, char const *, int);
bool service_path(const char *name, int port, char *buf, int buflen) {
  if (buflen == snprintf(buf, buflen, "/tmp/.ecore_service|%s|%d", name, port))
    return false;
  return true;
}


x86 assembly (clang, -O0):
<service_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jne    1160 <service_path+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1167 <service_path+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<service_path>:
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%rax
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0xedd(%rip),%rdx
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <snprintf@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/tmp/.ecore_service|%s|%d\00"
define i32 @service_path(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = load i8*, i8** %8
%12 = load i32, i32* %9
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
%16 = icmp eq i32 %10, %15
br i1 %16, label %17, label %18
17: ; preds = %4
store i32 0, i32* %5
br label %19
18: ; preds = %4
store i32 1, i32* %5
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@.str = [26 x i8] c"/tmp/.ecore_service|%s|%d\00"
define i32 @service_path(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = icmp ne i32 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LefReadLayers(int /*<<< orphan*/ *, int /*<<< orphan*/, int *);
int LefReadLayer(FILE *f, u_char obstruct) {
  return LefReadLayers(f, obstruct, (int *)NULL);
}


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

x86 assembly (clang, -O2):
<LefReadLayer>:
xor    %edx,%edx
jmp    1030 <LefReadLayers@plt>

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

LLVM IR (-O2):
define i32 @LefReadLayer(i32* %0, i32 %1) {
%3 = tail call i32 @LefReadLayers(i32* %0, i32 %1, i32* null)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *const, char *);
void usage(FILE *const f, int exitcode) {
  fprintf(f, "Usage: ");
  fprintf(f, "exiter -o reportfile unixcommand [args_for_unixcommand]\n");
  fprintf(f, "(mostly like GNU time, but report file is mandatory for now)\n");
  exit(exitcode);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xec0(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xee0(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %ebp,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage: \00"
@.str.1 = [57 x i8] c"exiter -o reportfile unixcommand [args_for_unixcommand]\0A\00"
@.str.2 = [62 x i8] c"(mostly like GNU time, but report file is mandatory for now)\0A\00"
define void @usage(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"Usage: \00"
@.str.1 = [57 x i8] c"exiter -o reportfile unixcommand [args_for_unixcommand]\0A\00"
@.str.2 = [62 x i8] c"(mostly like GNU time, but report file is mandatory for now)\0A\00"
define void @usage(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i64 56, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i64 61, i64 1, i32* %0)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
int test_imm_01int8_reg(signed char val) {
  return ((val) & (-0x01 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_01int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -1
%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_01int8_reg(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
float f(float x) { return x * x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1(void) { printf("test1\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test1\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ starA();
int main() {
  starA();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @starA()
ret i32 0
}
/* Variables and functions */
char *strchr(char const *, int);
__attribute__((regparm(0))) char *(_win_strchr)(const char *s, int c) {
  return strchr(s, c);
}


x86 assembly (clang, -O0):
<_win_strchr>:
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 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_win_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @_win_strchr(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 i8* @strchr(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @_win_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct wordsplit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int wordsplit_len(char const *, int /*<<< orphan*/, struct wordsplit *, int);
int wordsplit(const char *command, struct wordsplit *ws, int flags) {
  return wordsplit_len(command, command ? strlen(command) : 0, ws, flags);
}


x86 assembly (clang, -O0):
<wordsplit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <wordsplit+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
jmp    1161 <wordsplit+0x41>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <wordsplit+0x41>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <wordsplit_len@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordsplit>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
test   %rdi,%rdi
je     113e <wordsplit+0x1e>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
jmp    1140 <wordsplit+0x20>
xor    %esi,%esi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <wordsplit_len@plt>

LLVM IR (-O0):
%struct.wordsplit = type { i32 }
define i32 @wordsplit(i8* %0, %struct.wordsplit* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.wordsplit*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.wordsplit* %1, %struct.wordsplit** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %10
%15 = phi i32 [ %12, %10 ], [ 0, %13 ]
%16 = load %struct.wordsplit*, %struct.wordsplit** %5
%17 = load i32, i32* %6
%18 = call i32 @wordsplit_len(i8* %7, i32 %15, %struct.wordsplit* %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.wordsplit = type { i32 }
define i32 @wordsplit(i8* %0, %struct.wordsplit* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %0)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
%9 = tail call i32 @wordsplit_len(i8* %0, i32 %8, %struct.wordsplit* %1, i32 %2)
ret i32 %9
}
void _free(ptr) void *ptr;
{ free(ptr); }


x86 assembly (clang, -O0):
<_free>:
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>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
int main() {
  int arr[] = {5, 4, 3, 2, 1};
  int *ptr = arr;
  printf("%d\n", 3 [ptr]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 0; }


x86 assembly (clang, -O0):
<acpi_madt_oem_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @acpi_madt_oem_check(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello, World.");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ showip(char *);
int main(int argc, const char *argv[]) {
  showip("google.com");
  showip("mozilla.org");
  showip("apple.com");
  showip("microsoft.com");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"google.com\00"
@.str.1 = [12 x i8] c"mozilla.org\00"
@.str.2 = [10 x i8] c"apple.com\00"
@.str.3 = [14 x i8] c"microsoft.com\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @showip(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @showip(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @showip(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @showip(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"google.com\00"
@.str.1 = [12 x i8] c"mozilla.org\00"
@.str.2 = [10 x i8] c"apple.com\00"
@.str.3 = [14 x i8] c"microsoft.com\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @showip(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @showip(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @showip(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @showip(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DieWithError(char *errorMessage) {
  fprintf(stderr, "Error: %s\n", errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<DieWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DieWithError>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @DieWithError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void write_nothing() {}


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

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

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

LLVM IR (-O2):
define void @write_nothing() {
ret void
}
int test_imm_E6uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xe6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E6uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 230
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int fastio_read(int, int *, int);
int fastio_read_int(int fd, int *val) {
  return fastio_read(fd, val, sizeof(int));
}


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

x86 assembly (clang, -O2):
<fastio_read_int>:
mov    $0x4,%edx
jmp    1030 <fastio_read@plt>

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

LLVM IR (-O2):
define i32 @fastio_read_int(i32 %0, i32* %1) {
%3 = tail call i32 @fastio_read(i32 %0, i32* %1, i32 4)
ret i32 %3
}
int setup_allrouters_membership(int sock, struct Interface *iface) {
  return (0);
}


x86 assembly (clang, -O0):
<setup_allrouters_membership>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.Interface = type opaque
define i32 @setup_allrouters_membership(i32 %0, %struct.Interface* nocapture readnone %1) {
ret i32 0
}
int is_number_seperator(unsigned char c) {
  if ((c == 0x2e || c == 0x2c))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_number_seperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     1124 <is_number_seperator+0x24>
movzbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1130 <is_number_seperator+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_number_seperator+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number_seperator>:
and    $0xfd,%dil
xor    %eax,%eax
cmp    $0x2c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_number_seperator(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 46
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 44
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_number_seperator(i8 zeroext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 44
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int subtotal = 200, tax, grandtotal;
  double taxrate = 0.174;
  tax = subtotal * taxrate;
  grandtotal = subtotal + tax;
  printf("The tax on %d is %d, so the grand total is %d.\n", subtotal, tax,
         grandtotal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc8,-0x14(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc8,%esi
mov    $0x22,%edx
mov    $0xea,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"The tax on %d is %d, so the grand total is %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 200, i32* %6
store double 1.740000e-01, double* %9
%10 = load i32, i32* %6
%11 = sitofp i32 %10 to double
%12 = load double, double* %9
%13 = fmul double %11, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
store i32 %17, i32* %8
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"The tax on %d is %d, so the grand total is %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 200, i32 34, i32 234)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callSelf();
int main() {
  callSelf();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @callSelf()
ret i32 0
}