xunge/DecIR huggingface dataset:
char binto6bit(char value) {
  if (value > 0x3F)
    return -1;
  if (value < 0x28)
    return value + 0x30;
  else
    return value + 0x38;
}


x86 assembly (clang, -O0):
<binto6bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jle    1120 <binto6bit+0x20>
movb   $0xff,-0x1(%rbp)
jmp    1146 <binto6bit+0x46>
movsbl -0x2(%rbp),%eax
cmp    $0x28,%eax
jge    113c <binto6bit+0x3c>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1146 <binto6bit+0x46>
movsbl -0x2(%rbp),%eax
add    $0x38,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binto6bit>:
mov    $0xff,%al
cmp    $0x3f,%dil
jg     111a <binto6bit+0x1a>
cmp    $0x27,%dil
jg     1114 <binto6bit+0x14>
add    $0x30,%dil
jmp    1118 <binto6bit+0x18>
add    $0x38,%dil
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @binto6bit(i8 signext %0) {
%2 = icmp sgt i8 %0, 63
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp slt i8 %0, 40
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nsw i8 %0, 48
br label %9
7: ; preds = %3
%8 = add nuw nsw i8 %0, 56
br label %9
9: ; preds = %1, %7, %5
%10 = phi i8 [ %6, %5 ], [ %8, %7 ], [ -1, %1 ]
ret i8 %10
}
int *snew_dsf(int size) {
  int *ret;
  ret = ((int *)smalloc((size) * sizeof(int)));
  dsf_init(ret, size);
  return ret;
}


x86 assembly (clang, -O0):
<snew_dsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
shl    $0x2,%rdi
mov    $0x0,%al
call   1040 <smalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <dsf_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snew_dsf>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
lea    0x0(,%r14,4),%rdi
xor    %eax,%eax
call   1040 <smalloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <dsf_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @snew_dsf(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %2
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @dsf_init to i32 (i32*, i32, ...)*)(i32* %10, i32 %11)
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
define i32* @snew_dsf(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl nsw i64 %2, 2
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @dsf_init to i32 (i32*, i32, ...)*)(i32* %6, i32 %0)
ret i32* %6
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpstr(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

LLVM IR (-O0):
define i32 @cmpstr(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 @cmpstr(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MAC(char *, int, char *, char *);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/, int);
void MAC_E(char *data, int dataLength, char *ran, char *key16, char *result) {
  memcpy(result, MAC(data, dataLength, ran, key16), 8);
}


x86 assembly (clang, -O0):
<MAC_E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <MAC@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAC_E>:
push   %rbx
mov    %r8,%rbx
call   1040 <MAC@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x8,%edx
pop    %rbx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @MAC_E(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = call i32 @MAC(i8* %12, i32 %13, i8* %14, i8* %15)
%17 = call i32 @memcpy(i8* %11, i32 %16, i32 8)
ret void
}

LLVM IR (-O2):
define void @MAC_E(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @MAC(i8* %0, i32 %1, i8* %2, i8* %3)
%7 = tail call i32 @memcpy(i8* %4, i32 %6, i32 8)
ret void
}
/* Variables and functions */
int init_child_trusted(int);
int child_init(int rank) { return init_child_trusted(rank); }


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

x86 assembly (clang, -O2):
<child_init>:
jmp    1030 <init_child_trusted@plt>

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

LLVM IR (-O2):
define i32 @child_init(i32 %0) {
%2 = tail call i32 @init_child_trusted(i32 %0)
ret i32 %2
}
int register_vbat_check_cb(struct vbat_check *vcheck) {}


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

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

LLVM IR (-O0):
%struct.vbat_check = type opaque
define i32 @register_vbat_check_cb(%struct.vbat_check* %0) {
%2 = alloca i32
%3 = alloca %struct.vbat_check*
store %struct.vbat_check* %0, %struct.vbat_check** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.vbat_check = type opaque
define i32 @register_vbat_check_cb(%struct.vbat_check* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
size_t strlen(char *);
void loadstr(char *buf, char *s, size_t m) {
  size_t n;
  memset(buf, 0, m);
  n = strlen(s);
  if (n > m)
    n = m;
  memmove(buf, s, n);
}


x86 assembly (clang, -O0):
<loadstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1176 <loadstr+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %rbx,%rax
cmovbe %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <memmove@plt>

LLVM IR (-O0):
define void @loadstr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %5
%12 = call i64 @strlen(i8* %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = icmp ugt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i64, i64* %6
store i64 %17, i64* %7
br label %18
18: ; preds = %16, %3
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = load i64, i64* %7
%22 = call i32 @memmove(i8* %19, i8* %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @loadstr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i32 0, i64 %2)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = icmp ugt i64 %5, %2
%7 = select i1 %6, i64 %2, i64 %5
%8 = tail call i32 @memmove(i8* %0, i8* %1, i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_path_get_filename() {
  printf("NOT IMPLEMENTED:"
         "pa_path_get_filename"
         "\n");
}


x86 assembly (clang, -O0):
<pa_path_get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_path_get_filename\0A\00"
define i32 @pa_path_get_filename() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_path_get_filename\00"
define i32 @pa_path_get_filename() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void rop3_28_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_28_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_28_0_1>:
mov    (%rdi),%al
and    %dl,%al
mov    %eax,%ecx
or     %sil,%cl
and    %dl,%cl
xor    %al,%cl
not    %cl
and    %sil,%cl
xor    %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_28_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = or i32 %33, %39
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %46, %49
%51 = or i32 %40, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_28_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = and i8 %6, %2
%8 = xor i8 %7, -1
%9 = and i8 %8, %1
%10 = xor i8 %1, -1
%11 = and i8 %5, %10
%12 = or i8 %9, %11
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_init();
int /*<<< orphan*/ i2c_write_reg(int, int);
int /*<<< orphan*/ set_prescaler(int);
void init_9685(void) {
  i2c_init();
  i2c_write_reg(0x00, 17);
  set_prescaler(50);
  i2c_write_reg(0x00, 1);
}


x86 assembly (clang, -O0):
<init_9685>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <i2c_init@plt>
xor    %edi,%edi
mov    $0x11,%esi
call   1040 <i2c_write_reg@plt>
mov    $0x32,%edi
call   1050 <set_prescaler@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <i2c_write_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_9685>:
push   %rax
xor    %eax,%eax
call   1030 <i2c_init@plt>
xor    %edi,%edi
mov    $0x11,%esi
call   1040 <i2c_write_reg@plt>
mov    $0x32,%edi
call   1050 <set_prescaler@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <i2c_write_reg@plt>

LLVM IR (-O0):
define void @init_9685() {
%1 = call i32 (...) @i2c_init()
%2 = call i32 @i2c_write_reg(i32 0, i32 17)
%3 = call i32 @set_prescaler(i32 50)
%4 = call i32 @i2c_write_reg(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @init_9685() {
%1 = tail call i32 (...) @i2c_init()
%2 = tail call i32 @i2c_write_reg(i32 0, i32 17)
%3 = tail call i32 @set_prescaler(i32 50)
%4 = tail call i32 @i2c_write_reg(i32 0, i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t
UART_INT_ST(uint32_t i) {
  return (REG_UART_BASE(i) + 0x8);
}


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

x86 assembly (clang, -O2):
<UART_INT_ST>:
push   %rax
call   1030 <REG_UART_BASE@plt>
add    $0x8,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UART_INT_ST(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 8
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_INT_ST(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
%3 = add nsw i64 %2, 8
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("fft_r2r_test -- test real ffts, compare to fftw3\n");
  printf("options (default values in []):\n");
  printf("  u/h   : print usage/help\n");
  printf("  n     : number of points\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"fft_r2r_test -- test real ffts, compare to fftw3\0A\00"
@.str.1 = [33 x i8] c"options (default values in []):\0A\00"
@.str.2 = [28 x i8] c" u/h : print usage/help\0A\00"
@.str.3 = [28 x i8] c" n : number of points\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"fft_r2r_test -- test real ffts, compare to fftw3\00"
@str.4 = [32 x i8] c"options (default values in []):\00"
@str.5 = [27 x i8] c" u/h : print usage/help\00"
@str.6 = [27 x i8] c" n : number of points\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t max(int32_t a, int32_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void StopIntervalTimer() {}


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

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

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

LLVM IR (-O2):
define void @StopIntervalTimer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x2f() {
  Assert_real((isspace(47) == 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_isspace.c",
              240, ("isspace should be 0 for /"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf0,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for /\00"
define void @t_isspace_0x2f() {
%1 = call i64 @isspace(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for /\00"
define void @t_isspace_0x2f() {
%1 = tail call i64 @isspace(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sem_unlink(char const *);
int close_sem(const char *designator) { return sem_unlink(designator); }


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

x86 assembly (clang, -O2):
<close_sem>:
jmp    1030 <sem_unlink@plt>

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

LLVM IR (-O2):
define i32 @close_sem(i8* %0) {
%2 = tail call i32 @sem_unlink(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void sig_child(int signum) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
  }
  return;
}


x86 assembly (clang, -O0):
<sig_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1030 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1143 <sig_child+0x33>
jmp    111b <sig_child+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <waitpid@plt>
test   %eax,%eax
jg     1120 <sig_child+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %2, i32 %5)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
char *strcasestr(char *, char *);
char *find_end(char *buf) { return (strcasestr(buf, ">")); }


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

x86 assembly (clang, -O2):
<find_end>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcasestr@plt>

LLVM IR (-O0):
@.str = [2 x i8] c">\00"
define i8* @find_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strcasestr(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c">\00"
define i8* @find_end(i8* %0) {
%2 = tail call i8* @strcasestr(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ xprintf_putchar(void *, int);
void xputc(int c) { xprintf_putchar(((void *)0), c); }


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

x86 assembly (clang, -O2):
<xputc>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <xprintf_putchar@plt>

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

LLVM IR (-O2):
define void @xputc(i32 %0) {
%2 = tail call i32 @xprintf_putchar(i8* null, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printHEX(int hex) {
  if (hex < 0x10)
    printf("0%X", hex);
  else
    printf("%X", hex);
}


x86 assembly (clang, -O0):
<printHEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1139 <printHEX+0x29>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <printHEX+0x38>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHEX>:
mov    %edi,%esi
cmp    $0x10,%edi
lea    0xee4(%rip),%rax
lea    0xede(%rip),%rdi
cmovl  %rax,%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"0%X\00"
@.str.1 = [3 x i8] c"%X\00"
define void @printHEX(i32 %0) {
%2 = icmp slt i32 %0, 16
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* %3, i32 %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __xstat(int, char const *, struct stat *);
int stat(const char *file_name, struct stat *buf) {
  return __xstat(3, file_name, buf);
}


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

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <__xstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @__xstat(i32 3, i8* %0, %struct.stat* %1)
ret i32 %3
}
int isDst(int day, int month, int dow) {
  if (month < 3 || month > 10)
    return 0;
  if (month > 3 && month < 10)
    return 1;
  int previousSunday = day - dow;
  if (month == 3)
    return previousSunday >= 25;
  return previousSunday >= 25;
}


x86 assembly (clang, -O0):
<isDst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x3,-0xc(%rbp)
jl     1121 <isDst+0x21>
cmpl   $0xa,-0xc(%rbp)
jle    112d <isDst+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1183 <isDst+0x83>
cmpl   $0x3,-0xc(%rbp)
jle    114d <isDst+0x4d>
cmpl   $0xa,-0xc(%rbp)
jge    114d <isDst+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1183 <isDst+0x83>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    1174 <isDst+0x74>
cmpl   $0x19,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <isDst+0x83>
cmpl   $0x19,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDst>:
lea    -0xb(%rsi),%ecx
xor    %eax,%eax
cmp    $0xfffffff8,%ecx
jb     1121 <isDst+0x21>
add    $0xfffffffc,%esi
mov    $0x1,%eax
cmp    $0x6,%esi
jb     1121 <isDst+0x21>
sub    %edx,%edi
xor    %eax,%eax
cmp    $0x19,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @isDst(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 3
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* %6
%13 = icmp sgt i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %11, %3
store i32 0, i32* %4
br label %36
15: ; preds = %11
%16 = load i32, i32* %6
%17 = icmp sgt i32 %16, 3
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 1, i32* %4
br label %36
22: ; preds = %18, %15
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = sub nsw i32 %23, %24
store i32 %25, i32* %8
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = load i32, i32* %8
%30 = icmp sge i32 %29, 25
%31 = zext i1 %30 to i32
store i32 %31, i32* %4
br label %36
32: ; preds = %22
%33 = load i32, i32* %8
%34 = icmp sge i32 %33, 25
%35 = zext i1 %34 to i32
store i32 %35, i32* %4
br label %36
36: ; preds = %32, %28, %21, %14
%37 = load i32, i32* %4
ret i32 %37
}

LLVM IR (-O2):
define i32 @isDst(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, -11
%5 = icmp ult i32 %4, -8
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = add nsw i32 %1, -4
%8 = icmp ult i32 %7, 6
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = sub nsw i32 %0, %2
%11 = icmp sgt i32 %10, 24
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %3, %9
%14 = phi i32 [ %12, %9 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_uint32_t(int /*<<< orphan*/ *, int);
uint32_t atomic_dec_uint32_t(uint32_t *var) {
  return atomic_sub_uint32_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_dec_uint32_t>:
mov    $0x1,%esi
jmp    1030 <atomic_sub_uint32_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_dec_uint32_t(i32* %0) {
%2 = tail call i32 @atomic_sub_uint32_t(i32* %0, i32 1)
ret i32 %2
}
void g_arith_rem_f(void *s, void *d, void *o) {
  *((float *)o) = *((float *)s) - *((float *)d);
}


x86 assembly (clang, -O0):
<g_arith_rem_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_arith_rem_f>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @g_arith_rem_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load i8*, i8** %6
%15 = bitcast i8* %14 to float*
store float %13, float* %15
ret void
}

LLVM IR (-O2):
define void @g_arith_rem_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %0 to float*
%5 = load float, float* %4
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = fsub float %5, %7
%9 = bitcast i8* %2 to float*
store float %8, float* %9
ret void
}
int io_rpc() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @io_rpc() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main() {
  char buf[150];
  int i;
  read(0, buf, sizeof(buf));
  for (i = 0; i < 150; i++) {
    putchar(buf[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xa0(%rbp),%rsi
xor    %edi,%edi
mov    $0x96,%edx
call   1040 <read@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x96,-0xa4(%rbp)
jge    1187 <main+0x67>
movslq -0xa4(%rbp),%rax
movsbl -0xa0(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x96,%edx
call   1040 <read@plt>
nopl   0x0(%rax)
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x96,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [150 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 150)
store i32 0, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 150
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @putchar(i8 signext %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [150 x i8]
%2 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 150)
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %9, %4 ]
%6 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 150
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 0
}
void json_init() {}


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

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

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

LLVM IR (-O2):
define void @json_init() {
ret void
}
unsigned replace_byte(unsigned x, unsigned char b, int i) {
  unsigned y, z;
  y = ~(0xFF << (i << 3));
  z = b << (i << 3);
  return x & y | z;
}


x86 assembly (clang, -O0):
<replace_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
movzbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_byte>:
lea    0x0(,%rdx,8),%ecx
mov    $0xff,%eax
shl    %cl,%eax
shl    %cl,%esi
not    %eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @replace_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = shl i32 %9, 3
%11 = shl i32 255, %10
%12 = xor i32 %11, -1
store i32 %12, i32* %7
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = load i32, i32* %6
%16 = shl i32 %15, 3
%17 = shl i32 %14, %16
store i32 %17, i32* %8
%18 = load i32, i32* %4
%19 = load i32, i32* %7
%20 = and i32 %18, %19
%21 = load i32, i32* %8
%22 = or i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @replace_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = shl i32 255, %4
%6 = xor i32 %5, -1
%7 = zext i8 %1 to i32
%8 = shl i32 %7, %4
%9 = and i32 %6, %0
%10 = or i32 %9, %8
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ ungetcc(char);
void ungetsc(char *s) {
  char *p;
  for (p = s + strlen(s) - 1; p >= s; p--)
    ungetcc(*p);
}


x86 assembly (clang, -O0):
<ungetsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     117c <ungetsc+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ungetcc@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1151 <ungetsc+0x31>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetsc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jb     1151 <ungetsc+0x31>
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <ungetcc@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1140 <ungetsc+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ungetsc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %13, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %11, %7 ], [ %5, %1 ]
%9 = load i8, i8* %8
%10 = tail call i32 @ungetcc(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %8, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %7
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int gsdll_stdout(void *instance, const char *str, int len) {
  fwrite(str, 1, len, stdout);
  fflush(stdout);
  return len;
}


x86 assembly (clang, -O0):
<gsdll_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsdll_stdout>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%rdi
mov    0x2eb0(%rip),%r14
mov    (%r14),%ecx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    (%r14),%edi
call   1030 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @gsdll_stdout(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32, i32* @stdout
%10 = call i32 @fwrite(i8* %7, i32 1, i32 %8, i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @gsdll_stdout(i8* nocapture readnone %0, i8* %1, i32 returned %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ reg0();
int /*<<< orphan*/ reg1();
int /*<<< orphan*/ reg2();
int /*<<< orphan*/ reg3();
int /*<<< orphan*/ reg4();
int /*<<< orphan*/ reg5();
void main() {
  reg0();
  reg1();
  reg2();
  reg3();
  reg4();
  reg5();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <reg0@plt>
mov    $0x0,%al
call   1050 <reg1@plt>
mov    $0x0,%al
call   1070 <reg2@plt>
mov    $0x0,%al
call   1040 <reg3@plt>
mov    $0x0,%al
call   1060 <reg4@plt>
mov    $0x0,%al
call   1030 <reg5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <reg0@plt>
xor    %eax,%eax
call   1050 <reg1@plt>
xor    %eax,%eax
call   1070 <reg2@plt>
xor    %eax,%eax
call   1040 <reg3@plt>
xor    %eax,%eax
call   1060 <reg4@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reg5@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @reg0()
%2 = call i32 (...) @reg1()
%3 = call i32 (...) @reg2()
%4 = call i32 (...) @reg3()
%5 = call i32 (...) @reg4()
%6 = call i32 (...) @reg5()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @reg0()
%2 = tail call i32 (...) @reg1()
%3 = tail call i32 (...) @reg2()
%4 = tail call i32 (...) @reg3()
%5 = tail call i32 (...) @reg4()
%6 = tail call i32 (...) @reg5()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end();
void endscale(void) { end(); }


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

x86 assembly (clang, -O2):
<endscale>:
xor    %eax,%eax
jmp    1030 <end@plt>

LLVM IR (-O0):
define void @endscale() {
%1 = call i32 (...) @end()
ret void
}

LLVM IR (-O2):
define void @endscale() {
%1 = tail call i32 (...) @end()
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ oom();
void *xzmalloc(size_t size) {
  void *new;
  new = malloc(size);
  if (!new)
    oom();
  memset(new, 0, size);
  return new;
}


x86 assembly (clang, -O0):
<xzmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <xzmalloc+0x2b>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <xzmalloc+0x1b>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xzmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @oom()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @xzmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @oom()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ fibo_r(int);
int main(void) {
  int counter = 100;
  int fib;
  while (counter--) {
    fib += fibo_r(20);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1156 <main+0x46>
mov    $0x14,%edi
call   1030 <fibo_r@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffff9c,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x14,%edi
call   1030 <fibo_r@plt>
inc    %ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -1
%4 = tail call i64 @fibo_r(i32 20)
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostMode(uint32_t ui32Base) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x0000041C))) = 0x00000002;
}


x86 assembly (clang, -O0):
<USBHostMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostMode>:
movb   $0x2,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBHostMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1052
%5 = inttoptr i64 %4 to i8*
store volatile i8 2, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBHostMode(i64 %0) {
%2 = add nsw i64 %0, 1052
%3 = inttoptr i64 %2 to i8*
store volatile i8 2, i8* %3
ret void
}
long double foo(long double value) {
  long double const copy = value;
  return copy;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 returned %0) {
ret x86_fp80 %0
}