xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10, y = 10;
  if (y < x)
    printf("y: %d is greater than x: %d", y, x);
  else if (y <= x)
    printf("y: %d is equal x: %d", y, x);
  else
    printf("comparison is false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <main+0x42>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x7a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1177 <main+0x67>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1185 <main+0x75>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x7a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [21 x i8] c"y: %d is equal x: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
unsigned char *ss2gt_(unsigned int *iid, int *width, int *height) {
  _s2warn("ss2gt", "function not available from FORTRAN");
  return NULL;
}


x86 assembly (clang, -O0):
<ss2gt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <_s2warn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ss2gt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define i8* @ss2gt_(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [6 x i8] c"ss2gt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define noalias i8* @ss2gt_(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @_s2warn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
struct miscDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int miscCompareDevice(struct miscDevice *dev1, struct miscDevice *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


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

x86 assembly (clang, -O2):
<miscCompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.miscDevice = type { i32 }
%struct.device = type { i32 }
define i32 @miscCompareDevice(%struct.miscDevice* %0, %struct.miscDevice* %1) {
%3 = alloca %struct.miscDevice*
%4 = alloca %struct.miscDevice*
store %struct.miscDevice* %0, %struct.miscDevice** %3
store %struct.miscDevice* %1, %struct.miscDevice** %4
%5 = load %struct.miscDevice*, %struct.miscDevice** %3
%6 = bitcast %struct.miscDevice* %5 to %struct.device*
%7 = load %struct.miscDevice*, %struct.miscDevice** %4
%8 = bitcast %struct.miscDevice* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.miscDevice = type { i32 }
%struct.device = type { i32 }
define i32 @miscCompareDevice(%struct.miscDevice* %0, %struct.miscDevice* %1) {
%3 = bitcast %struct.miscDevice* %0 to %struct.device*
%4 = bitcast %struct.miscDevice* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
size_t strlen(char const *);
char *strcat(char *__restrict dst, const char *__restrict src) {
  const size_t dstlen = strlen(dst);
  const size_t srclen = strlen(src);
  memcpy(dst + dstlen, src, srclen + 1);
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r15,%rbx
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strcat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8*, i8** %4
%15 = load i64, i64* %6
%16 = add i64 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i64 %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = add i64 %4, 1
%7 = tail call i32 @memcpy(i8* %5, i8* %1, i64 %6)
ret i8* %0
}
/* Variables and functions */
int rand();
int chooseReg(void) {
  int r;
  r = (rand() >> 8) % 16;
  return r + 8;
}


x86 assembly (clang, -O0):
<chooseReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0x8,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseReg>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x8,%eax
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @chooseReg() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = ashr i32 %2, 8
%4 = srem i32 %3, 16
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 8
ret i32 %6
}

LLVM IR (-O2):
define i32 @chooseReg() {
%1 = tail call i32 (...) @rand()
%2 = ashr i32 %1, 8
%3 = srem i32 %2, 16
%4 = add nsw i32 %3, 8
ret i32 %4
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sigaction(int signum __attribute__((unused)),
              const struct sigaction *act __attribute__((unused)),
              struct sigaction *oldact __attribute__((unused))) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sigaction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigaction>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigaction(i32 %0, %struct.sigaction* nocapture readnone %1, %struct.sigaction* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int fsize(char const *);
int FILE_SIZE_(const char *fname, int len) { return fsize(fname); }


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

x86 assembly (clang, -O2):
<FILE_SIZE_>:
jmp    1030 <fsize@plt>

LLVM IR (-O0):
define i32 @FILE_SIZE_(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 = call i32 @fsize(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @FILE_SIZE_(i8* %0, i32 %1) {
%3 = tail call i32 @fsize(i8* %0)
ret i32 %3
}
void av_stereo3d_create_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_stereo3d_create_side_data() {
ret void
}
int errnos_msgidxof(int code) {
  return (0 ? 0 : ((code >= 0) && (code <= 140)) ? (code - 0) : -1);
}


x86 assembly (clang, -O0):
<errnos_msgidxof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112c <errnos_msgidxof+0x2c>
cmpl   $0x8c,-0x4(%rbp)
jg     112c <errnos_msgidxof+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x0,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <errnos_msgidxof+0x39>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <errnos_msgidxof+0x39>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errnos_msgidxof>:
cmp    $0x8d,%edi
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @errnos_msgidxof(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 140
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 0
br label %12
11: ; preds = %5, %1
br label %12
12: ; preds = %11, %8
%13 = phi i32 [ %10, %8 ], [ -1, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @errnos_msgidxof(i32 %0) {
%2 = icmp ult i32 %0, 141
%3 = select i1 %2, i32 %0, i32 -1
ret i32 %3
}
int test_imm_C8int16_reg(short val) {
  return ((val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int16_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, 200
%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_C8int16_reg(i16 signext %0) {
%2 = and i16 %0, 200
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void colormat_display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1.0, 20, 16);
  glFlush();
}


x86 assembly (clang, -O0):
<colormat_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xead(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<colormat_display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @colormat_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @colormat_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void regerror(char *s) { printf("re error %s\n", s); }


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

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"re error %s\0A\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"re error %s\0A\00"
define void @regerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double lineral_interpolate(double y0, double y1, double mu) {
  return y0 * (1 - mu) + y1 * mu;
}


x86 assembly (clang, -O0):
<lineral_interpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineral_interpolate>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lineral_interpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %7, double %9, double %12)
ret double %13
}

LLVM IR (-O2):
define double @lineral_interpolate(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void mcfioC_CloseSequentialTape(int jstr) {
  fprintf(stderr,
          "mcfioC_CloseSequentialTape: Not available in this library. \n");
  return;
}


x86 assembly (clang, -O0):
<mcfioC_CloseSequentialTape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"mcfioC_CloseSequentialTape: Not available in this library. \0A\00"
define void @mcfioC_CloseSequentialTape(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"mcfioC_CloseSequentialTape: Not available in this library. \0A\00"
define void @mcfioC_CloseSequentialTape(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char op1;
  scanf("%c", &op1);
  switch (op1) {
  case '+':
    printf("ola");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x5(%rbp),%al
sub    $0x2b,%al
jne    115b <main+0x3b>
jmp    114f <main+0x2f>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
cmpb   $0x2b,0x7(%rsp)
jne    1145 <main+0x25>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"ola\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 43, label %6
]
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"ola\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 43
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *);
void GenStartAsciiString(void) { printf2("\tdb\t"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\09db\09\00"
define void @GenStartAsciiString() {
%1 = tail call i32 @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
char *strdup(char *);
char *block() {
  sleep(5);
  return strdup("slept for 5 seconds");
}


x86 assembly (clang, -O0):
<block>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xecb(%rip),%rdi
call   1030 <strdup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<block>:
push   %rax
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <strdup@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"slept for 5 seconds\00"
define i8* @block() {
%1 = call i32 @sleep(i32 5)
%2 = call i8* @strdup(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}

LLVM IR (-O2):
@.str = [20 x i8] c"slept for 5 seconds\00"
define noalias i8* @block() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call dereferenceable_or_null(20) i8* @strdup(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
char alphanumeric_62(int resto) {
  char tabela62[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  return tabela62[resto];
}


x86 assembly (clang, -O0):
<alphanumeric_62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x3f,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphanumeric_62>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.alphanumeric_62.tabela62 = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define signext i8 @alphanumeric_62(i32 %0) {
%2 = alloca i32
%3 = alloca [63 x i8]
store i32 %0, i32* %2
%4 = bitcast [63 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [63 x i8], [63 x i8]* %3, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@__const.alphanumeric_62.tabela62 = [63 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\00"
define signext i8 @alphanumeric_62(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [63 x i8], [63 x i8]* @__const.alphanumeric_62.tabela62, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void esleep() { printf("saved_state.exception = SIGSTOP;\n"); }


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"saved_state.exception = SIGSTOP;\00"
define void @esleep() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *shmem_Listen();
int /*<<< orphan*/ shmem_SendData(char *, char);
char *shmem_GetService(char *text) {
  shmem_SendData(text, '?');
  return (shmem_Listen());
}


x86 assembly (clang, -O0):
<shmem_GetService>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
call   1030 <shmem_SendData@plt>
mov    $0x0,%al
call   1040 <shmem_Listen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_GetService>:
push   %rax
mov    $0x3f,%esi
call   1030 <shmem_SendData@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <shmem_Listen@plt>

LLVM IR (-O0):
define i8* @shmem_GetService(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @shmem_SendData(i8* %3, i8 signext 63)
%5 = call i8* (...) @shmem_Listen()
ret i8* %5
}

LLVM IR (-O2):
define i8* @shmem_GetService(i8* %0) {
%2 = tail call i32 @shmem_SendData(i8* %0, i8 signext 63)
%3 = tail call i8* (...) @shmem_Listen()
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ f1(int *);
int /*<<< orphan*/ f2(int *);
int mod(int p[]) {
  (void)f1(p);
  (void)f2(p);
  return 5;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <f1@plt>
mov    -0x8(%rbp),%rdi
call   1030 <f2@plt>
mov    $0x5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
push   %rbx
mov    %rdi,%rbx
call   1040 <f1@plt>
mov    %rbx,%rdi
call   1030 <f2@plt>
mov    $0x5,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mod(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f1(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @f2(i32* %5)
ret i32 5
}

LLVM IR (-O2):
define i32 @mod(i32* %0) {
%2 = tail call i32 @f1(i32* %0)
%3 = tail call i32 @f2(i32* %0)
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main() {
  printf("rightrot(11, 1) -> %u\n", rightrot(11, 1));
  printf("rightrot(1024, 14) -> %u\n", rightrot(1024, 14));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
mov    $0x1,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x400,%edi
mov    $0xe,%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
mov    $0x1,%esi
call   1040 <rightrot@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x400,%edi
mov    $0xe,%esi
call   1040 <rightrot@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"rightrot(11, 1) -> %u\0A\00"
@.str.1 = [26 x i8] c"rightrot(1024, 14) -> %u\0A\00"
define i32 @main() {
%1 = call i32 @rightrot(i32 11, i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @rightrot(i32 1024, i32 14)
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"rightrot(11, 1) -> %u\0A\00"
@.str.1 = [26 x i8] c"rightrot(1024, 14) -> %u\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 11, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @rightrot(i32 1024, i32 14)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool utf16_is_trailing_surrogate(uint16_t c) {
  return c >= 0xdc00U && c <= 0xdfffU;
}


x86 assembly (clang, -O0):
<utf16_is_trailing_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xdc00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1126 <utf16_is_trailing_surrogate+0x26>
cmpl   $0xdfff,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_is_trailing_surrogate>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xdc00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @utf16_is_trailing_surrogate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 56320
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 57343
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @utf16_is_trailing_surrogate(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 56320
%4 = zext i1 %3 to i32
ret i32 %4
}
double prob_unif(float minfrac, double x) {
  double unif = 0.0;
  float upper = 1.0 - minfrac;
  if (x >= minfrac && x <= upper) {
    unif = 1 / (upper - minfrac);
  }
  return unif;
}


x86 assembly (clang, -O0):
<prob_unif>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1183 <prob_unif+0x83>
movsd  -0x10(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1183 <prob_unif+0x83>
movss  -0x1c(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xe92(%rip),%xmm0
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob_unif>:
movaps %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
ucomisd %xmm0,%xmm1
xorps  %xmm0,%xmm0
jb     1138 <prob_unif+0x38>
movss  0xee8(%rip),%xmm3
movaps %xmm3,%xmm4
subss  %xmm2,%xmm4
cvtss2sd %xmm4,%xmm5
ucomisd %xmm1,%xmm5
jb     1138 <prob_unif+0x38>
subss  %xmm2,%xmm4
divss  %xmm4,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @prob_unif(float %0, double %1) {
%3 = alloca float
%4 = alloca double
%5 = alloca double
%6 = alloca float
store float %0, float* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = fptrunc double %9 to float
store float %10, float* %6
%11 = load double, double* %4
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fcmp oge double %11, %13
br i1 %14, label %15, label %26
15: ; preds = %2
%16 = load double, double* %4
%17 = load float, float* %6
%18 = fpext float %17 to double
%19 = fcmp ole double %16, %18
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load float, float* %6
%22 = load float, float* %3
%23 = fsub float %21, %22
%24 = fdiv float 1.000000e+00, %23
%25 = fpext float %24 to double
store double %25, double* %5
br label %26
26: ; preds = %20, %15, %2
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @prob_unif(float %0, double %1) {
%3 = fpext float %0 to double
%4 = fsub float 1.000000e+00, %0
%5 = fcmp ugt double %3, %1
%6 = fpext float %4 to double
%7 = fcmp ult double %6, %1
%8 = or i1 %5, %7
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = fsub float %4, %0
%11 = fdiv float 1.000000e+00, %10
%12 = fpext float %11 to double
br label %13
13: ; preds = %9, %2
%14 = phi double [ %12, %9 ], [ 0.000000e+00, %2 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *calloc(size_t const, int);
size_t str_get_size(char const *);
char *strcpy(char *, char const *);
char *str_get_copy(const char *s) {
  assert(s != NULL);
  const size_t size = str_get_size(s);
  char *copy = calloc(size, sizeof(char));
  return copy ? strcpy(copy, s) : NULL;
}


x86 assembly (clang, -O0):
<str_get_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <str_get_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119e <str_get_copy+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    11a9 <str_get_copy+0x69>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    11a9 <str_get_copy+0x69>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_get_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1060 <assert@plt>
mov    %r14,%rdi
call   1040 <str_get_size@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     117d <str_get_copy+0x3d>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_get_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %2
%10 = call i64 @str_get_size(i8* %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = call i8* @calloc(i64 %11, i32 1)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = call i8* @strcpy(i8* %16, i8* %17)
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %15
%21 = phi i8* [ %18, %15 ], [ null, %19 ]
ret i8* %21
}

LLVM IR (-O2):
define i8* @str_get_copy(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @str_get_size(i8* %0)
%6 = tail call i8* @calloc(i64 %5, i32 1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i8* @strcpy(i8* %6, i8* dereferenceable(1) %0)
br label %10
10: ; preds = %1, %8
ret i8* %6
}
void act_integer_update(const struct XCSF *xcsf, const struct Cl *c,
                        const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @act_integer_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @act_integer_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("main");
  init();
  puts("end");
  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    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <init@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"main\00"
@.str.1 = [4 x i8] c"end\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @init()
%8 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
@.str.1 = [4 x i8] c"end\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @init()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void spoil(char a) {
  if (a) {
  };
}


x86 assembly (clang, -O0):
<spoil>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1119 <spoil+0x19>
jmp    1119 <spoil+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @spoil(i8 signext %0) {
ret void
}
int idxof(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @idxof(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp1(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<cmp1>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp1(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
__attribute__((weak, section(".after_vectors"))) void BusFault_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define weak void @BusFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @BusFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
int YabThreadStart(unsigned int id, void (*func)(void)) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @YabThreadStart(i32 %0, void ()* nocapture readnone %1) {
ret i32 -1
}
int test_imm_3Dint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x3D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Dint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3997696
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int socket(int, int, int);
int idrnet_socket(int domain, int type, int protocol) {
  return socket(domain, type, protocol);
}


x86 assembly (clang, -O0):
<idrnet_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_socket>:
jmp    1030 <socket@plt>

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

LLVM IR (-O2):
define i32 @idrnet_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  short int i1 = 32767;
  printf("First debug int is %d\n", i1);
  i1++;
  i1 += 32768;
  printf("Second debug int is now %d \n", i1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x7fff,-0x12(%rbp)
lea    0xed4(%rip),%rdi
movswl -0x12(%rbp),%esi
call   1030 <printf@plt>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
add    $0x8000,%eax
mov    %ax,-0x12(%rbp)
lea    0xec2(%rip),%rdi
movswl -0x12(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"First debug int is %d\0A\00"
@.str.1 = [29 x i8] c"Second debug int is now %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i16
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
store i16 32767, i16* %5
%8 = load i16, i16* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 signext %8)
%10 = load i16, i16* %5
%11 = add i16 %10, 1
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = add nsw i32 %13, 32768
%15 = trunc i32 %14 to i16
store i16 %15, i16* %5
%16 = load i16, i16* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 signext %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"First debug int is %d\0A\00"
@.str.1 = [29 x i8] c"Second debug int is now %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 signext 32767)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 signext 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int ZERO_EXTEND_L_W(int reg) {
  addbyte(0x0f);
  addbyte(0xb7);
  addbyte(0xc0 | reg | (reg << 3));
  return reg;
}


x86 assembly (clang, -O0):
<ZERO_EXTEND_L_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xb7,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZERO_EXTEND_L_W>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xb7,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%edi
or     %ebx,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ZERO_EXTEND_L_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 15)
%4 = call i32 @addbyte(i32 183)
%5 = load i32, i32* %2
%6 = or i32 192, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 3
%9 = or i32 %6, %8
%10 = call i32 @addbyte(i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @ZERO_EXTEND_L_W(i32 returned %0) {
%2 = tail call i32 @addbyte(i32 15)
%3 = tail call i32 @addbyte(i32 183)
%4 = shl i32 %0, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @addbyte(i32 %6)
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int *malloc(int);
int main() {
  int a[10];
  int *p = malloc(sizeof(a));
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 40)
store i32* %4, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
ret i32 0
}
/* Type definitions */
struct firmata_conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ firmata_send_code(struct firmata_conn *, int);
void firmata_get_firmware_version(struct firmata_conn *c) {
  firmata_send_code(c, 0x79);
}


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

x86 assembly (clang, -O2):
<firmata_get_firmware_version>:
mov    $0x79,%esi
jmp    1030 <firmata_send_code@plt>

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

LLVM IR (-O2):
%struct.firmata_conn = type { i32 }
define void @firmata_get_firmware_version(%struct.firmata_conn* %0) {
%2 = tail call i32 @firmata_send_code(%struct.firmata_conn* %0, i32 121)
ret void
}