xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *strdup(char *);
scalar_t__ strlen(char const *);
int main() {
  const char *test = "asdfasdf";
  char *s = malloc(strlen(test) + 1);
  strcpy(s, test);
  char *new = strdup(s);
  free(s);
  puts(new);
  free(new);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1080 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe98(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"asdfasdf\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = load i8*, i8** %1
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %2
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @puts(i8* %15)
%17 = load i8*, i8** %3
%18 = call i32 @free(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"asdfasdf\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(9) i8* @malloc(i64 9)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strdup(i8* %1)
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
%6 = tail call i32 @free(i8* %3)
ret i32 0
}
int reverse(int num) {
  int res = 0;
  int bit_count = sizeof(unsigned int) * 8;
  for (int i = 0; i < bit_count; i++) {
    if ((num & (1 << i)) != 0) {
      res |= 1 << (bit_count - i - 1);
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116b <reverse+0x6b>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1158 <reverse+0x58>
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115d <reverse+0x5d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <reverse+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %r8d,%r8d
xor    %edx,%edx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    $0x80000000,%esi
mov    %edx,%ecx
shr    %cl,%esi
bt     %edx,%edi
cmovae %r8d,%esi
or     %eax,%esi
lea    0x1(%rdx),%eax
movzbl %al,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
bt     %ecx,%edi
cmovae %r8d,%eax
or     %esi,%eax
add    $0x2,%edx
cmp    $0x20,%edx
jne    1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %18
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %19, %3 ]
%5 = phi i32 [ 0, %1 ], [ %18, %3 ]
%6 = shl nuw i32 1, %4
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = lshr i32 -2147483648, %4
%10 = select i1 %8, i32 0, i32 %9
%11 = or i32 %10, %5
%12 = or i32 %4, 1
%13 = shl nuw i32 1, %12
%14 = and i32 %13, %0
%15 = icmp eq i32 %14, 0
%16 = lshr i32 -2147483648, %12
%17 = select i1 %15, i32 0, i32 %16
%18 = or i32 %17, %11
%19 = add nuw nsw i32 %4, 2
%20 = icmp eq i32 %19, 32
br i1 %20, label %2, label %3
}
int raise(int sig) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 -1
}
void foo21() {}


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

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

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

LLVM IR (-O2):
define void @foo21() {
ret void
}
/* Variables and functions */
int getnpar(int /*<<< orphan*/, char *, char *, long *);
int getparlong(char *name, long *ptr) { return getnpar(0, name, "l", ptr); }


x86 assembly (clang, -O0):
<getparlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
lea    0xecf(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getparlong>:
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdx
xor    %edi,%edi
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"l\00"
define i32 @getparlong(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 @getnpar(i32 0, i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"l\00"
define i32 @getparlong(i8* %0, i64* %1) {
%3 = tail call i32 @getnpar(i32 0, i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, scalar_t__, int);
float ptr_ret_float(void *arg1, int offset) {
  float tmp;
  memcpy(&tmp, (caddr_t)arg1 + offset, sizeof(tmp));
  return tmp;
}


x86 assembly (clang, -O0):
<ptr_ret_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_ret_float>:
push   %rax
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ptr_ret_float(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca float
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = call i32 @memcpy(float* %5, i64 %10, i32 4)
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @ptr_ret_float(i8* %0, i32 %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(float* %3, i64 %7, i32 4)
%9 = load float, float* %3
ret float %9
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t byteorder_lebuftohs(const uint8_t *buf) {
  return (uint16_t)((buf[0] << 8) | buf[1]);
}


x86 assembly (clang, -O0):
<byteorder_lebuftohs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder_lebuftohs>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @byteorder_lebuftohs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @byteorder_lebuftohs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
void XtAppSetFallbackResources() {}


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

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

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

LLVM IR (-O2):
define void @XtAppSetFallbackResources() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gator_annotate_channel_color(int /*<<< orphan*/, int,
                                                char const *);
void gator_annotate_color(int color, const char *str) {
  gator_annotate_channel_color(0, color, str);
}


x86 assembly (clang, -O0):
<gator_annotate_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <gator_annotate_channel_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_color>:
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <gator_annotate_channel_color@plt>

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

LLVM IR (-O2):
define void @gator_annotate_color(i32 %0, i8* %1) {
%3 = tail call i32 @gator_annotate_channel_color(i32 0, i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int threeSumClosest(int *, int, int);
int main() {
  int arr[] = {1, 1, 1, 0};
  printf("%d\n", threeSumClosest(arr, 4, -100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0xffffff9c,%edx
call   1030 <threeSumClosest@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0xffffff9c,%edx
call   1030 <threeSumClosest@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [4 x i32] [i32 1, i32 1, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @threeSumClosest(i32* %3, i32 4, i32 -100)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void I2CDataPut(unsigned long ulBase, unsigned char ucData) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ucData;
}


x86 assembly (clang, -O0):
<I2CDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CDataPut>:
mov    %esi,%eax
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CDataPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i64, i64* %3
%8 = add i64 %7, 16
%9 = inttoptr i64 %8 to i64*
store volatile i64 %6, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2CDataPut(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = add i64 %0, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glCopyTexSubImage2D(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
                       GLint x, GLint y, GLsizei width, GLsizei height) {
  glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}


x86 assembly (clang, -O0):
<CopyTexSubImage2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <glCopyTexSubImage2D@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyTexSubImage2D>:
jmp    1030 <glCopyTexSubImage2D@plt>

LLVM IR (-O0):
define void @CopyTexSubImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @glCopyTexSubImage2D(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @CopyTexSubImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @glCopyTexSubImage2D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
char *test16_aux();
void test16() {
  char *p = test16_aux();
  for (unsigned i = 0; i < 100; i++)
    p[i] = 'a';
}


x86 assembly (clang, -O0):
<test16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <test16_aux@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jae    114d <test16+0x3d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x61,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <test16+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test16>:
push   %rax
xor    %eax,%eax
call   1030 <test16_aux@plt>
movaps 0xee1(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movl   $0x61616161,0x60(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test16() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* (...) @test16_aux()
store i8* %3, i8** %1
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 97, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test16() {
%1 = tail call i8* (...) @test16_aux()
ret void
}
int log_n(int iterations) {
  int result = 0;
  int i = 0;
  while (i < iterations) {
    result = result + i;
    iterations = iterations / 2;
    i = i + 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<log_n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <log_n+0x46>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <log_n+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_n>:
test   %edi,%edi
jle    1123 <log_n+0x23>
xor    %ecx,%ecx
xor    %eax,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
add    %ecx,%eax
shr    $0x1f,%edx
add    %edi,%edx
sar    %edx
add    $0x1,%ecx
mov    %edx,%edi
cmp    %edx,%ecx
jl     1110 <log_n+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @log_n(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = phi i32 [ %8, %3 ], [ %0, %1 ]
%7 = add nuw nsw i32 %4, %5
%8 = sdiv i32 %6, 2
%9 = add nuw nsw i32 %4, 1
%10 = icmp slt i32 %9, %8
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
char hex(int i) {
  if (i > 16)
    return '?';
  if (i > 9)
    return 'A' + (i - 10);
  else
    return '0' + i;
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jle    111a <hex+0x1a>
movb   $0x3f,-0x1(%rbp)
jmp    113e <hex+0x3e>
cmpl   $0x9,-0x8(%rbp)
jle    1135 <hex+0x35>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113e <hex+0x3e>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
mov    $0x3f,%al
cmp    $0x10,%edi
jg     1118 <hex+0x18>
cmp    $0xa,%edi
jl     1112 <hex+0x12>
add    $0x37,%dil
jmp    1116 <hex+0x16>
add    $0x30,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 16
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 63, i8* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 9
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 10
%13 = add nsw i32 65, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %19
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 48, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %19
19: ; preds = %15, %10, %6
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @hex(i32 %0) {
%2 = icmp sgt i32 %0, 16
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 9
%5 = trunc i32 %0 to i8
br i1 %4, label %6, label %8
6: ; preds = %3
%7 = add nuw nsw i8 %5, 55
br label %10
8: ; preds = %3
%9 = add i8 %5, 48
br label %10
10: ; preds = %1, %8, %6
%11 = phi i8 [ %7, %6 ], [ %9, %8 ], [ 63, %1 ]
ret i8 %11
}
long long cpucycles_amd64cpuspeed(void) {
  unsigned long long result;
  asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
               : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<cpucycles_amd64cpuspeed>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles_amd64cpuspeed>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @cpucycles_amd64cpuspeed() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles_amd64cpuspeed() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int euler_problem_76();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_76());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_76()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int remove(char const *);
int RemovePath(const char *path, const struct stat *st, int flags,
               struct FTW *ftw) {
  int rv = remove(path);
  if (rv != 0)
    perror(path);
  return rv;
  do {
    (void)(st);
  } while (0);
  do {
    (void)(flags);
  } while (0);
  do {
    (void)(ftw);
  } while (0);
}


x86 assembly (clang, -O0):
<RemovePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1156 <RemovePath+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemovePath>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <remove@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113a <RemovePath+0x1a>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
jmp    1131 <RemovePath+0x11>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @RemovePath(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* %0)
br label %9
9: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
char input();
int /*<<< orphan*/ output(char *);
int main(int argc, char *argv[]) {
  char c;
  c = input();
  output(&c);
  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    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x11(%rbp)
lea    -0x11(%rbp),%rdi
call   1040 <output@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <input@plt>
mov    %al,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1040 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call signext i8 (...) @input()
store i8 %7, i8* %6
%8 = call i32 @output(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = tail call signext i8 (...) @input()
store i8 %4, i8* %3
%5 = call i32 @output(i8* %3)
ret i32 0
}
int d_blt_cr2(double a1) { return !(__builtin_isless(100, a1)); }


x86 assembly (clang, -O0):
<d_blt_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_cr2>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_blt_cr2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_blt_cr2(double %0) {
%2 = fcmp ule double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int OSDDummyInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OSDDummyInit() {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sstdevch(int, int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sstdevch(N, 1, x, stride);
  printf("sample standard deviation: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1040 <stdlib_strided_sstdevch@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_sstdevch@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sstdevch(i32 %6, i32 1, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sstdevch(i32 4, i32 1, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
f() {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define i32 @f() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @f() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_0Aint64_lowword_reg(long long val) {
  return ((val) & (0x0A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Aint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 10
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void markBlock(int *p) { *(p - 1) = (*(p - 1) | 0x2); }


x86 assembly (clang, -O0):
<markBlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%ecx
or     $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<markBlock>:
orb    $0x2,-0x4(%rdi)
ret

LLVM IR (-O0):
define void @markBlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %4
%6 = or i32 %5, 2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 -1
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @markBlock(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
%4 = or i32 %3, 2
store i32 %4, i32* %2
ret void
}
int isdigit(int character) { return (character >= '0' && character <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
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 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int DRV_GET_DLOAD_VERSION(unsigned char *str, int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_DLOAD_VERSION(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
void c_rmdir_(char *path, int plen) { rmdir(path); }


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

x86 assembly (clang, -O2):
<c_rmdir_>:
jmp    1030 <rmdir@plt>

LLVM IR (-O0):
define void @c_rmdir_(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 @rmdir(i8* %5)
ret void
}

LLVM IR (-O2):
define void @c_rmdir_(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @rmdir(i8* %0)
ret void
}
/* Type definitions */
struct apacheAccessLog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ badFormat(struct apacheAccessLog **, char *, char *, int,
                             char *);
void badTimeStamp(struct apacheAccessLog **pLl, char *line, char *fileName,
                  int lineIx) {
  badFormat(pLl, line, fileName, lineIx, "bad time stamp");
}


x86 assembly (clang, -O0):
<badTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xec3(%rip),%r8
call   1030 <badFormat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badTimeStamp>:
lea    0xee9(%rip),%r8
jmp    1030 <badFormat@plt>

LLVM IR (-O0):
%struct.apacheAccessLog = type { i32 }
@.str = [15 x i8] c"bad time stamp\00"
define void @badTimeStamp(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.apacheAccessLog**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.apacheAccessLog** %0, %struct.apacheAccessLog*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.apacheAccessLog**, %struct.apacheAccessLog*** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @badFormat(%struct.apacheAccessLog** %9, i8* %10, i8* %11, i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.apacheAccessLog = type { i32 }
@.str = [15 x i8] c"bad time stamp\00"
define void @badTimeStamp(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @badFormat(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xproperty_display(void *_p) {
  return (void *)((XEvent *)_p)->xproperty.display;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xproperty_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xproperty_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xproperty_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
unsigned short CommonMain_2_D2_13_15(const unsigned char *data,
                                     const unsigned long num) {
  unsigned long bb1, bb2;
  bb1 = num >> 3;
  bb2 = (data[bb1] << 24) + (data[bb1 + 1] << 16) + (data[bb1 + 2] << 8);
  return ((bb2 >> (21 - (num & 7))) & 0x7FF);
}


x86 assembly (clang, -O0):
<CommonMain_2_D2_13_15>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl 0x1(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl 0x2(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rdx
and    $0x7,%rdx
mov    $0x15,%ecx
sub    %rdx,%rcx
shr    %cl,%rax
and    $0x7ff,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommonMain_2_D2_13_15>:
mov    %rsi,%rax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%ecx
shl    $0x18,%ecx
movzbl 0x1(%rdi,%rax,1),%edx
shl    $0x10,%rdx
movslq %ecx,%rcx
or     %rdx,%rcx
movzbl 0x2(%rdi,%rax,1),%eax
shl    $0x8,%rax
or     %rcx,%rax
and    $0x7,%sil
mov    $0x15,%cl
sub    %sil,%cl
shr    %cl,%rax
and    $0x7ff,%eax
ret

LLVM IR (-O0):
define zeroext i16 @CommonMain_2_D2_13_15(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = lshr i64 %7, 3
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = getelementptr inbounds i8, i8* %9, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 24
%15 = load i8*, i8** %3
%16 = load i64, i64* %5
%17 = add i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 16
%22 = add nsw i32 %14, %21
%23 = load i8*, i8** %3
%24 = load i64, i64* %5
%25 = add i64 %24, 2
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 8
%30 = add nsw i32 %22, %29
%31 = sext i32 %30 to i64
store i64 %31, i64* %6
%32 = load i64, i64* %6
%33 = load i64, i64* %4
%34 = and i64 %33, 7
%35 = sub i64 21, %34
%36 = lshr i64 %32, %35
%37 = and i64 %36, 2047
%38 = trunc i64 %37 to i16
ret i16 %38
}

LLVM IR (-O2):
define zeroext i16 @CommonMain_2_D2_13_15(i8* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 3
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw i32 %6, 24
%8 = add nuw nsw i64 %3, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %7
%14 = add nuw nsw i64 %3, 2
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw nsw i32 %17, 8
%19 = or i32 %13, %18
%20 = sext i32 %19 to i64
%21 = and i64 %1, 7
%22 = sub nuw nsw i64 21, %21
%23 = lshr i64 %20, %22
%24 = trunc i64 %23 to i16
%25 = and i16 %24, 2047
ret i16 %25
}
int main() {
  int i;
  int c;
  i = 0;
  c = 0;
  while (i <= 10) {
    i = i + 1;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_LE();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sle_8_al(void) { m68ki_write_8(EA_AL_8(), COND_LE() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sle_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sle_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sle_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_LE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sle_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_LE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void SmartMac_Send() {}


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

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

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

LLVM IR (-O2):
define void @SmartMac_Send() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xf3() {
  Assert_real((ispunct(243) == 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_ispunct.c",
              1220, ("ispunct should be 0 for 0xf3"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xf3>:
push   %rax
mov    $0xf3,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c4,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf3\00"
define void @t_ispunct_0xf3() {
%1 = call i64 @ispunct(i32 243)
%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 1220, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf3\00"
define void @t_ispunct_0xf3() {
%1 = tail call i64 @ispunct(i32 243)
%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 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i]) {
    write(1, &s[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <ft_putstr+0x4a>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 1)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}