xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main() {
  char buf[12];
  short sval = 4;
  int ival = 3;
  *(short *)(buf + 1) = sval;
  *(int *)(buf + 1) = ival;
  buf[0] = 0;
  puts(buf);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x4,-0x12(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0xf(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xf(%rbp)
movb   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x3,0xd(%rsp)
movb   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i16
%4 = alloca i32
store i32 0, i32* %1
store i16 4, i16* %3
store i32 3, i32* %4
%5 = load i16, i16* %3
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i16*
store i16 %5, i16* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = bitcast i8* %11 to i32*
store i32 %9, i32* %12
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
store i8 0, i8* %13
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
%4 = bitcast i8* %3 to i32*
store i32 3, i32* %4
store i8 0, i8* %2
%5 = call i32 @puts(i8* %2)
%6 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int float_to_unsigned_int(float src) { return src; }


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

x86 assembly (clang, -O2):
<float_to_unsigned_int>:
cvttss2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @float_to_unsigned_int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptoui float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @float_to_unsigned_int(float %0) {
%2 = fptoui float %0 to i32
ret i32 %2
}
void h_modeselect(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_modeselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_modeselect>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_modeselect = [13 x i8] c"h_modeselect\00"
define void @h_modeselect(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.h_modeselect, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_modeselect = [13 x i8] c"h_modeselect\00"
define void @h_modeselect(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.h_modeselect, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
void uninitvar_strcmp(char *s1, char *s2) {
  char *str1;
  char *str2;
  (void)strcmp(str1, s2);
  (void)strcmp(s1, str2);
  (void)strcmp(str1, str2);
  (void)strcmp(s1, s2);
}


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

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

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

LLVM IR (-O2):
define void @uninitvar_strcmp(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "-C   select by command name (minimal ps only accepts one)\n"
          "-p   select by process ID (minimal ps only accepts one)\n"
          "-e   all processes (same as ax)\n"
          "a    all processes w/ tty, including other users\n"
          "x    processes w/o controlling ttys\n"
          "-f   full format\n"
          "-j,j job control format\n"
          "v    virtual memory format\n"
          "-l,l long format\n"
          "u    user-oriented format\n"
          "-o   user-defined format (limited support, only \"ps -o pid=\")\n"
          "h    no header\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [420 x i8] c"-C select by command name (minimal ps only accepts one)\0A-p select by process ID (minimal ps only accepts one)\0A-e all processes (same as ax)\0Aa all processes w/ tty, including other users\0Ax processes w/o controlling ttys\0A-f full format\0A-j,j job control format\0Av virtual memory format\0A-l,l long format\0Au user-oriented format\0A-o user-defined format (limited support, only \22ps -o pid=\22)\0Ah no header\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([420 x i8], [420 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [420 x i8] c"-C select by command name (minimal ps only accepts one)\0A-p select by process ID (minimal ps only accepts one)\0A-e all processes (same as ax)\0Aa all processes w/ tty, including other users\0Ax processes w/o controlling ttys\0A-f full format\0A-j,j job control format\0Av virtual memory format\0A-l,l long format\0Au user-oriented format\0A-o user-defined format (limited support, only \22ps -o pid=\22)\0Ah no header\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([420 x i8], [420 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t ELF32_ST_VISIBILITY(unsigned char);
const char *get_st_visibility(unsigned char val) {
  static const char *const visibilities[] = {"DEFAULT", "INTERNAL", "HIDDEN",
                                             "PROTECTED"};
  return visibilities[ELF32_ST_VISIBILITY(val)];
}


x86 assembly (clang, -O0):
<get_st_visibility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <ELF32_ST_VISIBILITY@plt>
mov    %rax,%rcx
lea    0x2ccf(%rip),%rax
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_st_visibility>:
push   %rax
call   1030 <ELF32_ST_VISIBILITY@plt>
lea    0xee3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@get_st_visibility.visibilities = internal constant [4 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0)]
@.str = [8 x i8] c"DEFAULT\00"
@.str.1 = [9 x i8] c"INTERNAL\00"
@.str.2 = [7 x i8] c"HIDDEN\00"
@.str.3 = [10 x i8] c"PROTECTED\00"
define i8* @get_st_visibility(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @ELF32_ST_VISIBILITY(i8 zeroext %3)
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* @get_st_visibility.visibilities, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.get_st_visibility = internal unnamed_addr constant [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.get_st_visibility to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_st_visibility to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_st_visibility to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.get_st_visibility to i64)) to i32)]
@.str = [8 x i8] c"DEFAULT\00"
@.str.1 = [9 x i8] c"INTERNAL\00"
@.str.2 = [7 x i8] c"HIDDEN\00"
@.str.3 = [10 x i8] c"PROTECTED\00"
define i8* @get_st_visibility(i8 zeroext %0) {
%2 = tail call i64 @ELF32_ST_VISIBILITY(i8 zeroext %0)
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.get_st_visibility to i8*), i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int i;
  int x = 20;
  for (i = 0; i < x; i--)
    printf("*");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114c <main+0x3c>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(i32 42)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int Cnd_IsRope(void) {
  ArgItem();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @Cnd_IsRope() {
%1 = call i32 (...) @ArgItem()
ret i32 0
}

LLVM IR (-O2):
define i32 @Cnd_IsRope() {
%1 = tail call i32 (...) @ArgItem()
ret i32 0
}
/* Variables and functions */
bool point_lt(int x1, int y1, int x2, int y2) {
  if ((x1 < x2) || (x1 == x2 && y1 <= y2)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<point_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1134 <point_lt+0x34>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1140 <point_lt+0x40>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1140 <point_lt+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <point_lt+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_lt>:
cmp    %edx,%edi
setl   %al
sete   %dl
cmp    %ecx,%esi
setle  %cl
and    %dl,%cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @point_lt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = icmp slt i32 %10, %11
br i1 %12, label %21, label %13
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i32, i32* %7
%19 = load i32, i32* %9
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17, %4
store i32 1, i32* %5
br label %23
22: ; preds = %17, %13
store i32 0, i32* %5
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @point_lt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %2
%6 = icmp eq i32 %0, %2
%7 = icmp sle i32 %1, %3
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c = 48;
  printf("Char: %c\n", c);
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ gpg_close(struct gpg_t *);
void gpg_closep(struct gpg_t **p) {
  if (*p)
    gpg_close(*p);
}


x86 assembly (clang, -O0):
<gpg_closep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <gpg_closep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <gpg_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpg_closep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <gpg_closep+0xd>
jmp    1030 <gpg_close@plt>
ret

LLVM IR (-O0):
%struct.gpg_t = type { i32 }
define void @gpg_closep(%struct.gpg_t** %0) {
%2 = alloca %struct.gpg_t**
store %struct.gpg_t** %0, %struct.gpg_t*** %2
%3 = load %struct.gpg_t**, %struct.gpg_t*** %2
%4 = load %struct.gpg_t*, %struct.gpg_t** %3
%5 = icmp ne %struct.gpg_t* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.gpg_t**, %struct.gpg_t*** %2
%8 = load %struct.gpg_t*, %struct.gpg_t** %7
%9 = call i32 @gpg_close(%struct.gpg_t* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.gpg_t = type { i32 }
define void @gpg_closep(%struct.gpg_t** nocapture %0) {
%2 = load %struct.gpg_t*, %struct.gpg_t** %0
%3 = icmp eq %struct.gpg_t* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @gpg_close(%struct.gpg_t* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
double u32tod(uint32_t u, uint32_t scale) {
  return ((double)u * (double)scale) / (double)UINT32_MAX;
}


x86 assembly (clang, -O0):
<u32tod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ed5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32tod>:
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
mulsd  %xmm1,%xmm0
mov    0x2ee3(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@UINT32_MAX = global i64 0
define double @u32tod(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 = sitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fmul double %6, %8
%10 = load i64, i64* @UINT32_MAX
%11 = sitofp i64 %10 to double
%12 = fdiv double %9, %11
ret double %12
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define double @u32tod(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fmul double %3, %4
%6 = load i64, i64* @UINT32_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
ret double %8
}
/* Variables and functions */
unsigned roundup_allones(unsigned limit) {
  unsigned m = 1;
  while (m < limit)
    m = (m << 1) + 1;
  return m;
}


x86 assembly (clang, -O0):
<roundup_allones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112b <roundup_allones+0x2b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <roundup_allones+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_allones>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1119 <roundup_allones+0x19>
mov    $0x1,%eax
nop
add    %eax,%eax
add    $0x1,%eax
cmp    %edi,%eax
jb     1110 <roundup_allones+0x10>
ret

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

LLVM IR (-O2):
define i32 @roundup_allones(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = shl i32 %4, 1
%6 = or i32 %5, 1
%7 = icmp ult i32 %6, %0
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %9
}
int always_one_1(int a) {
  if (a / 100 >= -999999999)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<always_one_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0xc4653601,%eax
jl     1129 <always_one_1+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <always_one_1+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @always_one_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 100
%6 = icmp sge i32 %5, -999999999
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @always_one_1(i32 %0) {
ret i32 1
}
int retval(int a, int b) {
  if (a < 0 && a != 0) {
    return b;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<retval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1129 <retval+0x29>
cmpl   $0x0,-0x8(%rbp)
je     1129 <retval+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112f <retval+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<retval>:
mov    %esi,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @retval(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int const *);
int label_is_pointer(const uint8_t *label) {
  assert(label);
  return (label[0] & 0xc0) == 0xc0;
}


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

x86 assembly (clang, -O2):
<label_is_pointer>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%ecx
not    %ecx
xor    %eax,%eax
test   $0xc0,%cl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @label_is_pointer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @assert(i32* %3)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 192
%9 = icmp eq i32 %8, 192
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @label_is_pointer(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = load i32, i32* %0
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 192
%6 = zext i1 %5 to i32
ret i32 %6
}
f(int b, int c) {
  if (b != 0 && b != 1 && c != 0)
    b = 0;
  return b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <f+0x2f>
cmpl   $0x1,-0x4(%rbp)
je     112f <f+0x2f>
cmpl   $0x0,-0x8(%rbp)
je     112f <f+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %esi,%esi
cmove  %edi,%eax
cmp    $0x2,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 1
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = select i1 %5, i32 0, i32 %0
ret i32 %6
}
int sum_it(int value) {
  static int total = 0;
  total += value;
  return total;
}


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

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

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

LLVM IR (-O2):
@sum_it.total = internal unnamed_addr global i32 0
define i32 @sum_it(i32 %0) {
%2 = load i32, i32* @sum_it.total
%3 = add nsw i32 %2, %0
store i32 %3, i32* @sum_it.total
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int /*<<< orphan*/ set_port4(struct sockaddr *, int /*<<< orphan*/ const);
int /*<<< orphan*/ set_port6(struct sockaddr *, int /*<<< orphan*/ const);
void nfs_set_port(struct sockaddr *sap, const uint16_t port) {
  switch (sap->sa_family) {
  case AF_INET:
    set_port4(sap, port);
    break;
  case AF_INET6:
    set_port6(sap, port);
    break;
  }
}


x86 assembly (clang, -O0):
<nfs_set_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     116c <nfs_set_port+0x4c>
jmp    1148 <nfs_set_port+0x28>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    1178 <nfs_set_port+0x58>
jmp    115b <nfs_set_port+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <set_port4@plt>
jmp    1178 <nfs_set_port+0x58>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <set_port6@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfs_set_port>:
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1135 <nfs_set_port+0x15>
cmp    $0x81,%eax
jne    113a <nfs_set_port+0x1a>
jmp    1030 <set_port4@plt>
jmp    1040 <set_port6@plt>
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @nfs_set_port(%struct.sockaddr* %0, i32 %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i32 %1, i32* %4
%5 = load %struct.sockaddr*, %struct.sockaddr** %3
%6 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %5, i32 0, i32 0
%7 = load i32, i32* %6
switch i32 %7, label %16 [
i32 129, label %8
i32 128, label %12
]
8: ; preds = %2
%9 = load %struct.sockaddr*, %struct.sockaddr** %3
%10 = load i32, i32* %4
%11 = call i32 @set_port4(%struct.sockaddr* %9, i32 %10)
br label %16
12: ; preds = %2
%13 = load %struct.sockaddr*, %struct.sockaddr** %3
%14 = load i32, i32* %4
%15 = call i32 @set_port6(%struct.sockaddr* %13, i32 %14)
br label %16
16: ; preds = %2, %12, %8
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @nfs_set_port(%struct.sockaddr* %0, i32 %1) {
%3 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 129, label %5
i32 128, label %7
]
5: ; preds = %2
%6 = tail call i32 @set_port4(%struct.sockaddr* %0, i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @set_port6(%struct.sockaddr* %0, i32 %1)
br label %9
9: ; preds = %2, %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *strstr(char const *, char const *);
char *trio_substring(const char *string, const char *substring) {
  assert(string);
  assert(substring);
  return strstr(string, substring);
}


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

x86 assembly (clang, -O2):
<trio_substring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strstr@plt>

LLVM IR (-O0):
define i8* @trio_substring(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 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @strstr(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @trio_substring(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %5
}
int isPower2(int x) {
  int mask = ~(x >> 31);
  return !((!x) | (x & (x + mask)));
}


x86 assembly (clang, -O0):
<isPower2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
add    -0x8(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPower2>:
mov    %edi,%ecx
sar    $0x1f,%ecx
not    %ecx
xor    %edx,%edx
test   %edi,%edi
sete   %dl
add    %edi,%ecx
and    %edi,%ecx
xor    %eax,%eax
or     %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @isPower2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
%6 = xor i32 %5, -1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = and i32 %11, %14
%16 = or i32 %10, %15
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isPower2(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, -1
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %3, %0
%7 = and i32 %6, %0
%8 = or i32 %7, %5
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bsd_htons(uint16_t a) {
  return (((uint16_t)(((((((uint16_t)a) >> 8) & 0xff))) |
                      ((((uint16_t)a) & 0xff) << 8))));
}


x86 assembly (clang, -O0):
<bsd_htons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsd_htons>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @bsd_htons(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bsd_htons(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void foo167() {}


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

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

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

LLVM IR (-O2):
define void @foo167() {
ret void
}
/* Variables and functions */
double atan(float);
float deg_atan(float deg) { return atan(deg) / 0.01745329251; }


x86 assembly (clang, -O0):
<deg_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atan@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_atan>:
push   %rax
call   1030 <atan@plt>
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @deg_atan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @atan(float %3)
%5 = fdiv double %4, 0x3F91DF46A226E211
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @deg_atan(float %0) {
%2 = tail call double @atan(float %0)
%3 = fdiv double %2, 0x3F91DF46A226E211
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void speckey(uint16_t *left, uint16_t *right) {
  *left = (((*left) >> (7)) | ((*left) << (16 - 7)));
  *left += *right;
  *right = (((*right) << (2)) | ((*right) >> (16 - 2)));
  *right ^= *left;
}


x86 assembly (clang, -O0):
<speckey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x7,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x9,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0xe,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<speckey>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0x7,%ecx
shl    $0x9,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
add    (%rsi),%eax
mov    %eax,(%rdi)
mov    (%rsi),%eax
lea    0x0(,%rax,4),%ecx
sar    $0xe,%eax
or     %ecx,%eax
mov    %eax,(%rsi)
xor    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @speckey(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = ashr i32 %6, 7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = shl i32 %9, 9
%11 = or i32 %7, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %14
store i32 %17, i32* %15
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = shl i32 %19, 2
%21 = load i32*, i32** %4
%22 = load i32, i32* %21
%23 = ashr i32 %22, 14
%24 = or i32 %20, %23
%25 = load i32*, i32** %4
store i32 %24, i32* %25
%26 = load i32*, i32** %3
%27 = load i32, i32* %26
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = xor i32 %29, %27
store i32 %30, i32* %28
ret void
}

LLVM IR (-O2):
define void @speckey(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = ashr i32 %3, 7
%5 = shl i32 %3, 9
%6 = or i32 %4, %5
store i32 %6, i32* %0
%7 = load i32, i32* %1
%8 = add nsw i32 %6, %7
store i32 %8, i32* %0
%9 = load i32, i32* %1
%10 = shl i32 %9, 2
%11 = ashr i32 %9, 14
%12 = or i32 %10, %11
store i32 %12, i32* %1
%13 = load i32, i32* %0
%14 = xor i32 %12, %13
store i32 %14, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf0() {
  Assert_real((isupper(240) == 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_isupper.c",
              1205, ("isupper should be 0 for 0xf0"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xf0>:
push   %rax
mov    $0xf0,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b5,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf0\00"
define void @t_isupper_0xf0() {
%1 = call i64 @isupper(i32 240)
%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 1205, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf0\00"
define void @t_isupper_0xf0() {
%1 = tail call i64 @isupper(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pmm_get_block(int);
int pmm_block_status(int block) { return pmm_get_block(block); }


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

x86 assembly (clang, -O2):
<pmm_block_status>:
jmp    1030 <pmm_get_block@plt>

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

LLVM IR (-O2):
define i32 @pmm_block_status(i32 %0) {
%2 = tail call i32 @pmm_get_block(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(scalar_t__, scalar_t__);
int test(void) {
  time_t time1;
  time_t time2;
  double difference;
  time1 = 0;
  time2 = 0;
  difference = difftime(time1, time2);
  return (difference != 0.0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <difftime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <difftime@plt>
xorpd  %xmm1,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca double
store i64 0, i64* %1
store i64 0, i64* %2
%4 = load i64, i64* %1
%5 = load i64, i64* %2
%6 = call double @difftime(i64 %4, i64 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = fcmp une double %7, 0.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call double @difftime(i64 0, i64 0)
%2 = fcmp une double %1, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int fcntl(int, int, int);
int xfcntl(int fd, int cmd, int arg) {
  int rv = fcntl(fd, cmd, arg);
  if (rv < 0)
    die("fcntl:");
  return rv;
}


x86 assembly (clang, -O0):
<xfcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1158 <xfcntl+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"fcntl:\00"
define i32 @xfcntl(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void SSMR3GetS64(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetS64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(unsigned int);
void *alloc(unsigned n) {
  void *new = malloc(n);
  assert(new);
  return new;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
int IsPasswordOK();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  bool PwStatus;
  puts("Enter password:");
  PwStatus = IsPasswordOK();
  if (PwStatus == false) {
    puts("Access denied");
    exit(-1);
  }
  puts("Access approved");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <IsPasswordOK@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116e <main+0x3e>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <IsPasswordOK@plt>
test   %eax,%eax
je     1158 <main+0x28>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Enter password:\00"
@.str.1 = [14 x i8] c"Access denied\00"
@.str.2 = [16 x i8] c"Access approved\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @IsPasswordOK()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter password:\00"
@.str.1 = [14 x i8] c"Access denied\00"
@.str.2 = [16 x i8] c"Access approved\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @IsPasswordOK()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hithere2();
int main() {
  hithere2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hithere2()
ret i32 0
}
int test_imm_9Eint8_reg(signed char val) {
  return ((val) & (-0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Eint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -158
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}