xunge/DecIR huggingface dataset:
int dcheck(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<dcheck>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcheck>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @dcheck(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *xreallocarray(void *optr, size_t nmemb, size_t elem_size) {
  void *ptr = realloc(optr, nmemb * elem_size);
  if (ptr == NULL) {
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xreallocarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115c <xreallocarray+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xreallocarray>:
push   %rax
imul   %rdx,%rsi
call   1040 <realloc@plt>
test   %rax,%rax
je     1131 <xreallocarray+0x11>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xreallocarray(i8* nocapture %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
ret i8* %5
}
int add(int n) {
  static int a = 0;
  a = a + n;
  return a;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
add    -0x4(%rbp),%eax
mov    %eax,0x2f0e(%rip)
mov    0x2f08(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %edi,%eax
add    0x2f1c(%rip),%eax
mov    %eax,0x2f16(%rip)
ret

LLVM IR (-O0):
@add.a = internal global i32 0
define i32 @add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @add.a
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
store i32 %5, i32* @add.a
%6 = load i32, i32* @add.a
ret i32 %6
}

LLVM IR (-O2):
@add.a = internal unnamed_addr global i32 0
define i32 @add(i32 %0) {
%2 = load i32, i32* @add.a
%3 = add nsw i32 %2, %0
store i32 %3, i32* @add.a
ret i32 %3
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void print_backtrace(void) {
  if (write(1, "No libexec. Backtrace disabled\n", 32) < 0) {
  }
}


x86 assembly (clang, -O0):
<print_backtrace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x20,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1139 <print_backtrace+0x29>
jmp    1139 <print_backtrace+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_backtrace>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x20,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"No libexec. Backtrace disabled\0A\00"
define void @print_backtrace() {
%1 = call i64 @write(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 32)
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"No libexec. Backtrace disabled\0A\00"
define void @print_backtrace() {
%1 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 32)
ret void
}
float func(float x, float y, float z) { return x * x + y * y + z * z; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @func(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void blinkOn(void) { printf("\x01B[5m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[5m\00"
define void @blinkOn() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sckDestroy(int *sock) { close(*sock); }


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

x86 assembly (clang, -O2):
<sckDestroy>:
mov    (%rdi),%edi
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sckDestroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
ret void
}
int ispunct(int c) {
  return ((c >= 33 && c <= 47) | (c >= 58 && c <= 64) | (c >= 91 && c <= 96) |
          (c >= 123 && c <= 126));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ispunct+0x20>
cmpl   $0x2f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x3a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1144 <ispunct+0x44>
cmpl   $0x40,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x6(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x5b,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jl     116e <ispunct+0x6e>
cmpl   $0x60,-0x4(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xd(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jl     1198 <ispunct+0x98>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x15(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 58
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 64
br label %16
16: ; preds = %13, %8
%17 = phi i1 [ false, %8 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = or i32 %10, %18
%20 = load i32, i32* %2
%21 = icmp sge i32 %20, 91
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 96
br label %25
25: ; preds = %22, %16
%26 = phi i1 [ false, %16 ], [ %24, %22 ]
%27 = zext i1 %26 to i32
%28 = or i32 %19, %27
%29 = load i32, i32* %2
%30 = icmp sge i32 %29, 123
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 126
br label %34
34: ; preds = %31, %25
%35 = phi i1 [ false, %25 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
%37 = or i32 %28, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int initI2cBus(char *, int);
int main() {
  int i2cFileDesc = initI2cBus("/dev/i2c-1", 0x1C);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @initI2cBus(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 28)
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
define i32 @main() {
%1 = tail call i32 @initI2cBus(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 28)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *_TOML_cstringCopy(char *str) {
  if (!str) {
    return NULL;
  }
  int size = strlen(str);
  char *newstr = malloc(size + 1);
  newstr[size] = 0;
  strncpy(newstr, str, size);
  return newstr;
}


x86 assembly (clang, -O0):
<_TOML_cstringCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <_TOML_cstringCopy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1193 <_TOML_cstringCopy+0x63>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_TOML_cstringCopy>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1165 <_TOML_cstringCopy+0x35>
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movslq %r15d,%rdx
movb   $0x0,(%rax,%rdx,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
jmp    1167 <_TOML_cstringCopy+0x37>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_TOML_cstringCopy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %6, i8* %0, i32 %4)
br label %10
10: ; preds = %1, %3
%11 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_RDWR;
int open(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  int fd;
  if ((fd = open("/tmp/test", O_RDWR | O_CREAT, (mode_t)0)) < 0)
    perror("open()");
  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)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
or     (%rax),%esi
lea    0xeb1(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    116e <main+0x4e>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
test   %eax,%eax
js     1149 <main+0x29>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
jmp    1145 <main+0x25>

LLVM IR (-O0):
@.str = [10 x i8] c"/tmp/test\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [7 x i8] c"open()\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* @O_RDWR
%8 = load i32, i32* @O_CREAT
%9 = or i32 %7, %8
%10 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i32 0)
store i32 %10, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/tmp/test\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [7 x i8] c"open()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Send(int, char *);
int main() { Send(8080, "127.0.0.1"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f90,%edi
lea    0xee0(%rip),%rsi
call   1030 <Send@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main() {
%1 = call i32 @Send(i32 8080, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main() {
%1 = tail call i32 @Send(i32 8080, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1269() { return 1269; }


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

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

LLVM IR (-O0):
define i32 @fun1269() {
ret i32 1269
}

LLVM IR (-O2):
define i32 @fun1269() {
ret i32 1269
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void *thr_fn1(void *arg) {
  printf("thread 1 will sleep %d ms\n", (5));
  sleep((5));
  printf("thread 1 wake up \n");
  printf("thread 1 returning\n");
  return ((void *)1);
}


x86 assembly (clang, -O0):
<thr_fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn1>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"thread 1 will sleep %d ms\0A\00"
@.str.1 = [19 x i8] c"thread 1 wake up \0A\00"
@.str.2 = [20 x i8] c"thread 1 returning\0A\00"
define i8* @thr_fn1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = call i32 @sleep(i32 5)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@.str = [27 x i8] c"thread 1 will sleep %d ms\0A\00"
@str = [18 x i8] c"thread 1 wake up \00"
@str.3 = [19 x i8] c"thread 1 returning\00"
define i8* @thr_fn1(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ colle(int, int);
int main(void) {
  colle(4, 4);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
call   1030 <colle@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @colle(i32 4, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _puts(char *);
int main(void) {
  _puts("\"At the end of the day, my goal was to be the best hacker\"\n\t- "
        "Kevin Mitnick");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <_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 = [76 x i8] c"\22At the end of the day, my goal was to be the best hacker\22\0A\09- Kevin Mitnick\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"\22At the end of the day, my goal was to be the best hacker\22\0A\09- Kevin Mitnick\00"
define i32 @main() {
%1 = tail call i32 @_puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8b() {
  Assert_real((isprint(139) == 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",
              700, ("isprint should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%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 0x8b\00"
define void @t_isprint_0x8b() {
%1 = call i64 @isprint(i32 139)
%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 700, 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 0x8b\00"
define void @t_isprint_0x8b() {
%1 = tail call i64 @isprint(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_keyboard_send_repeat_info(struct wl_resource *resource_, int32_t rate,
                                  int32_t delay) {
  wl_resource_post_event(resource_, 5, rate, delay);
}


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

x86 assembly (clang, -O2):
<wl_keyboard_send_repeat_info>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_keyboard_send_repeat_info(%struct.wl_resource* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wl_resource*
%5 = alloca i32
%6 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.wl_resource*, %struct.wl_resource** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @wl_resource_post_event(%struct.wl_resource* %7, i32 5, i32 %8, i32 %9)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ parse_u16(int /*<<< orphan*/ *);
int16_t parse_i16(uint8_t *d) { return (int16_t)parse_u16(d); }


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

x86 assembly (clang, -O2):
<parse_i16>:
jmp    1030 <parse_u16@plt>

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

LLVM IR (-O2):
define i32 @parse_i16(i32* %0) {
%2 = tail call i32 @parse_u16(i32* %0)
ret i32 %2
}
void yy_1_ptTpPlus(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ptTpPlus(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int open_listenfd(int);
int /*<<< orphan*/ unix_error(char *);
int csapp_open_listenfd(int port) {
  int rc;
  if ((rc = open_listenfd(port)) < 0)
    unix_error("open_listenfd error");
  return rc;
}


x86 assembly (clang, -O0):
<csapp_open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <open_listenfd@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <csapp_open_listenfd+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_open_listenfd>:
push   %rbx
call   1040 <open_listenfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <csapp_open_listenfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"open_listenfd error\00"
define i32 @csapp_open_listenfd(i32 %0) {
%2 = tail call i32 @open_listenfd(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int *, int *, int *);
void foo(int alpha, int beta) { f(&alpha, &beta, &alpha, &alpha); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rcx
lea    -0x8(%rbp),%rsi
mov    %rcx,%rdi
mov    %rcx,%rdx
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rcx
mov    %rcx,%rdi
mov    %rcx,%rdx
call   1030 <f@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @f(i32* %3, i32* %4, i32* %3, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __aeabi_memset8(void *, size_t, int /*<<< orphan*/);
void __aeabi_memclr8(void *dest, size_t n) { __aeabi_memset8(dest, n, 0); }


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

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

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

LLVM IR (-O2):
define void @__aeabi_memclr8(i8* %0, i64 %1) {
%3 = tail call i32 @__aeabi_memset8(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void dosignal(int i, int j, int k) {
  if (i == 0)
    exit(0);
  exit(1);
}


x86 assembly (clang, -O0):
<dosignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <dosignal+0x22>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<dosignal>:
push   %rax
test   %edi,%edi
jne    111c <dosignal+0xc>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @dosignal(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @dosignal(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 @exit(i32 1)
unreachable
}
void flux_to_E(const double *Flux, const double *Ustr, const double *x,
               double *E1_riemann, double *B1_riemann, double *E2_riemann,
               double *B2_riemann, int dim) {}


x86 assembly (clang, -O0):
<flux_to_E>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @flux_to_E(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store i32 %7, i32* %16
ret void
}

LLVM IR (-O2):
define void @flux_to_E(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, i32 %7) {
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t Ltc4151BusRawToMillivolts(uint16_t bus_raw) {
  return (int32_t)(bus_raw >> 4) * 25;
}


x86 assembly (clang, -O0):
<Ltc4151BusRawToMillivolts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
imul   $0x19,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ltc4151BusRawToMillivolts>:
sar    $0x4,%edi
lea    (%rdi,%rdi,4),%eax
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @Ltc4151BusRawToMillivolts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = mul nsw i32 %4, 25
ret i32 %5
}

LLVM IR (-O2):
define i32 @Ltc4151BusRawToMillivolts(i32 %0) {
%2 = ashr i32 %0, 4
%3 = mul nsw i32 %2, 25
ret i32 %3
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzNullAdapt_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQUP(int /*<<< orphan*/);
int /*<<< orphan*/ TRACE_FOLLOW_THREAD(int /*<<< orphan*/, int);
void BrzNullAdapt_requp(struct comp *comp, int port) {
  struct BrzNullAdapt_ *c = (struct BrzNullAdapt_ *)comp;
  TRACE_FOLLOW_THREAD(0, 1);
  SEND_REQUP(0);
}


x86 assembly (clang, -O0):
<BrzNullAdapt_requp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
xor    %edi,%edi
call   1040 <SEND_REQUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzNullAdapt_requp>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <TRACE_FOLLOW_THREAD@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <SEND_REQUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzNullAdapt_ = type { i32 }
define void @BrzNullAdapt_requp(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzNullAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzNullAdapt_*
store %struct.BrzNullAdapt_* %7, %struct.BrzNullAdapt_** %5
%8 = call i32 @TRACE_FOLLOW_THREAD(i32 0, i32 1)
%9 = call i32 @SEND_REQUP(i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzNullAdapt_requp(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @TRACE_FOLLOW_THREAD(i32 0, i32 1)
%4 = tail call i32 @SEND_REQUP(i32 0)
ret void
}
/* Variables and functions */
size_t two_loops(int);
void call_two_loops_Good() {
  int a[10];
  int m = 5;
  a[two_loops(m)] = 1;
}


x86 assembly (clang, -O0):
<call_two_loops_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x5,-0x34(%rbp)
mov    -0x34(%rbp),%edi
call   1030 <two_loops@plt>
movl   $0x1,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_two_loops_Good>:
mov    $0x5,%edi
jmp    1030 <two_loops@plt>

LLVM IR (-O0):
define void @call_two_loops_Good() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @two_loops(i32 %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @call_two_loops_Good() {
%1 = tail call i64 @two_loops(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, ...);
void interceptor_increaseBy(unsigned long v) {
  unsigned long gs;
  syscall(158, 0x1004, &gs);
  gs += v;
  syscall(158, 0x1001, gs);
  return;
}


x86 assembly (clang, -O0):
<interceptor_increaseBy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x9e,%edi
mov    $0x1004,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <syscall@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x9e,%edi
mov    $0x1001,%esi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interceptor_increaseBy>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdx
mov    $0x9e,%edi
mov    $0x1004,%esi
xor    %eax,%eax
call   1030 <syscall@plt>
add    0x8(%rsp),%rbx
mov    %rbx,0x8(%rsp)
mov    $0x9e,%edi
mov    $0x1001,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @interceptor_increaseBy(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i32 (i32, i32, ...) @syscall(i32 158, i32 4100, i64* %3)
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = add i64 %6, %5
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 (i32, i32, ...) @syscall(i32 158, i32 4097, i64 %8)
ret void
}

LLVM IR (-O2):
define void @interceptor_increaseBy(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (i32, i32, ...) @syscall(i32 158, i32 4100, i64* %2)
%5 = load i64, i64* %2
%6 = add i64 %5, %0
store i64 %6, i64* %2
%7 = call i32 (i32, i32, ...) @syscall(i32 158, i32 4097, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outstr(char *);
void comment() { outstr(";; "); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c";; \00"
define void @comment() {
%1 = tail call i32 @outstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int f89(unsigned int x, unsigned int y) {
  return (x << (8 * sizeof(unsigned int) - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f89>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
mov    $0x20,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f89>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f89(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 = zext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %5, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = lshr i32 %11, %12
%14 = add i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f89(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = add i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgetc(int /*<<< orphan*/ *);
void fillBuffer(FILE *fp, unsigned char *buffer, int size) {
  int k;
  for (k = 0; k < size; k++)
    buffer[k] = (unsigned char)fgetc(fp);
}


x86 assembly (clang, -O0):
<fillBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <fillBuffer+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <fillBuffer+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillBuffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <fillBuffer+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <fillBuffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fillBuffer(i32* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i64 @fgetc(i32* %0)
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %10, i8* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DISPLAY(char *, char const *);
int /*<<< orphan*/ abort();
void FATAL_ERROR(const char *pszMsg) {
  DISPLAY("FATAL", pszMsg);
  abort();
}


x86 assembly (clang, -O0):
<FATAL_ERROR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <DISPLAY@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<FATAL_ERROR>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <DISPLAY@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"FATAL\00"
define void @FATAL_ERROR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @DISPLAY(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"FATAL\00"
define void @FATAL_ERROR(i8* %0) {
%2 = tail call i32 @DISPLAY(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int EINVAL;
int linear_interpolate(int y0, int x0, int y1, int x1, int x) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<linear_interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_interpolate>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @linear_interpolate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @linear_interpolate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc0(void) {
  printf("Executing exitfunc"
         "0"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc0>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc0.\0A\00"
define void @exitfunc0() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc0.\00"
define void @exitfunc0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_5Cint16_reg(short val) {
  return ((val) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 92
%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_5Cint16_reg(i16 signext %0) {
%2 = and i16 %0, 92
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_9Eint16_reg(short val) {
  return ((val) & (-0x9E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff62,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_9Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -158
%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_9Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -158
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}