xunge/DecIR huggingface dataset:
int GCD(int x, int y) {
  while (x != y) {
    if (x > y)
      x -= y;
    else
      y -= x;
  }
  return x;
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <GCD+0x42>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1132 <GCD+0x32>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <GCD+0x3d>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <GCD+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <GCD+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <GCD+0x10>
ret

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
void XkbAllocGeomPoints() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomPoints() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ hex_char(char);
void print_hex(char c, FILE *output) {
  fputc(hex_char(c >> 4), output);
  fputc(hex_char(c & 0x0F), output);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
movsbl %al,%edi
call   1040 <hex_char@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl %al,%edi
call   1040 <hex_char@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebp,%eax
sar    $0x4,%al
movsbl %al,%edi
call   1040 <hex_char@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
and    $0xf,%ebp
mov    %ebp,%edi
call   1040 <hex_char@plt>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @print_hex(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = trunc i32 %7 to i8
%9 = call i32 @hex_char(i8 signext %8)
%10 = load i32*, i32** %4
%11 = call i32 @fputc(i32 %9, i32* %10)
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = and i32 %13, 15
%15 = trunc i32 %14 to i8
%16 = call i32 @hex_char(i8 signext %15)
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @print_hex(i8 signext %0, i32* nocapture %1) {
%3 = ashr i8 %0, 4
%4 = tail call i32 @hex_char(i8 signext %3)
%5 = tail call i32 @fputc(i32 %4, i32* %1)
%6 = and i8 %0, 15
%7 = tail call i32 @hex_char(i8 signext %6)
%8 = tail call i32 @fputc(i32 %7, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *myclock) {
  printf("usage: %s option\n\n		-C :    show clock at centre\n	"
         "	-X :	custom x-ordinate\n		-Y :	custom "
         "y-ordinate\ncolor options:\n                -r :    red(default)\n   "
         "             -g :    green\n                -y :    yellow\n         "
         "       -b :    blue\n                -m :    magenta\n               "
         " -c :    cyan\n                -w :    white\n",
         myclock);
  exit(0);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [333 x i8] c"usage: %s option\0A\0A\09\09-C : show clock at centre\0A\09\09-X :\09custom x-ordinate\0A\09\09-Y :\09custom y-ordinate\0Acolor options:\0A -r : red(default)\0A -g : green\0A -y : yellow\0A -b : blue\0A -m : magenta\0A -c : cyan\0A -w : white\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [333 x i8] c"usage: %s option\0A\0A\09\09-C : show clock at centre\0A\09\09-X :\09custom x-ordinate\0A\09\09-Y :\09custom y-ordinate\0Acolor options:\0A -r : red(default)\0A -g : green\0A -y : yellow\0A -b : blue\0A -m : magenta\0A -c : cyan\0A -w : white\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t ret = 0;
  while (str[ret] != '\0')
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int count_leading_zeros(int input) { return __builtin_clz(input); }


x86 assembly (clang, -O0):
<count_leading_zeros>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_leading_zeros>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @count_leading_zeros(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @count_leading_zeros(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
int isascii(int c) { return (c >= 0 && c < 128); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <isascii+0x23>
cmpl   $0x80,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ aes_decr(unsigned char *, unsigned char *);
int /*<<< orphan*/ expand_key(unsigned char *, unsigned char *);
void aes_decrypt(unsigned char *state, unsigned char *key) {
  unsigned char expanded_key[176];
  expand_key(expanded_key, key);
  aes_decr(state, expanded_key);
}


x86 assembly (clang, -O0):
<aes_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <expand_key@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1030 <aes_decr@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_decrypt>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <expand_key@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <aes_decr@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @aes_decrypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [176 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @expand_key(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%11 = call i32 @aes_decr(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @aes_decrypt(i8* %0, i8* %1) {
%3 = alloca [176 x i8]
%4 = getelementptr inbounds [176 x i8], [176 x i8]* %3, i64 0, i64 0
%5 = call i32 @expand_key(i8* %4, i8* %1)
%6 = call i32 @aes_decr(i8* %0, i8* %4)
ret void
}
void v_reverse(void *vec, int n) {
  void **v, *t;
  for (v = vec; --n > 0;) {
    t = v[n];
    v[n--] = v[0];
    *v++ = t;
  }
}


x86 assembly (clang, -O0):
<v_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    116d <v_reverse+0x6d>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
jmp    1113 <v_reverse+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_reverse>:
cmp    $0x2,%esi
jl     112c <v_reverse+0x2c>
lea    0x2(%rsi),%eax
add    $0xffffffff,%esi
lea    (%rdi,%rsi,8),%rcx
nop
mov    (%rcx),%rdx
mov    (%rdi),%rsi
mov    %rsi,(%rcx)
mov    %rdx,(%rdi)
add    $0x8,%rdi
add    $0xfffffffe,%eax
add    $0xfffffffffffffff8,%rcx
cmp    $0x3,%eax
ja     1110 <v_reverse+0x10>
ret

LLVM IR (-O0):
define void @v_reverse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
br label %9
9: ; preds = %13, %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %5
%23 = load i32, i32* %4
%24 = add nsw i32 %23, -1
store i32 %24, i32* %4
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds i8*, i8** %22, i64 %25
store i8* %21, i8** %26
%27 = load i8*, i8** %6
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i32 1
store i8** %29, i8*** %5
store i8* %27, i8** %28
br label %9
30: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @v_reverse(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = bitcast i8* %0 to i8**
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %14, %6 ], [ %1, %4 ]
%8 = phi i8** [ %15, %6 ], [ %5, %4 ]
%9 = add nsw i32 %7, -1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = load i8*, i8** %8
%14 = add nsw i32 %7, -2
store i8* %13, i8** %11
%15 = getelementptr inbounds i8*, i8** %8, i64 1
store i8* %12, i8** %8
%16 = icmp ugt i32 %7, 3
br i1 %16, label %6, label %17
17: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
unsigned long UARTTxIntModeGet(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          1054);
    }
  };
  return ((*((volatile unsigned long *)(ulBase + 0x00000030))) &
          (0x00000010 | 0x00000000));
}


x86 assembly (clang, -O0):
<UARTTxIntModeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTTxIntModeGet+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x41e,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
and    $0x10,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxIntModeGet>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTTxIntModeGet+0x1e>
lea    0xecc(%rip),%rdi
mov    $0x41e,%esi
call   1030 <AssertFailure@plt>
mov    0x30(%rbx),%rax
and    $0x10,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTTxIntModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1054)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 48
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 16
ret i64 %13
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTTxIntModeGet(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1054)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 48
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 16
ret i64 %10
}
int test_imm_65uint32_reg(unsigned int val) {
  return ((val) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint32_reg(i32 %0) {
%2 = and i32 %0, 101
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ irq_entry(int);
void host_signal_handler(int signal) { irq_entry(signal); }


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

x86 assembly (clang, -O2):
<host_signal_handler>:
jmp    1030 <irq_entry@plt>

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

LLVM IR (-O2):
define void @host_signal_handler(i32 %0) {
%2 = tail call i32 @irq_entry(i32 %0)
ret void
}
unsigned char cansid_convert_color(unsigned char color) {
  const unsigned char lookup_table[8] = {0, 4, 2, 6, 1, 5, 3, 7};
  return lookup_table[(int)color];
}


x86 assembly (clang, -O0):
<cansid_convert_color>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x9(%rbp)
movzbl -0x1(%rbp),%eax
cltq
movzbl -0x9(%rbp,%rax,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cansid_convert_color>:
mov    %edi,%eax
lea    0xef7(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.cansid_convert_color.lookup_table = [8 x i8] c"\00\04\02\06\01\05\03\07"
define zeroext i8 @cansid_convert_color(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [8 x i8]
store i8 %0, i8* %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
@__const.cansid_convert_color.lookup_table = [8 x i8] c"\00\04\02\06\01\05\03\07"
define zeroext i8 @cansid_convert_color(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.cansid_convert_color.lookup_table, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int gpio_write(int, int);
int gpio_setsda_val(int val) { return gpio_write(17, val); }


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

x86 assembly (clang, -O2):
<gpio_setsda_val>:
mov    %edi,%esi
mov    $0x11,%edi
jmp    1030 <gpio_write@plt>

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

LLVM IR (-O2):
define i32 @gpio_setsda_val(i32 %0) {
%2 = tail call i32 @gpio_write(i32 17, i32 %0)
ret i32 %2
}
/* Variables and functions */
char *_conf_value(char const *, char const *);
int /*<<< orphan*/ free(char *);
int _conf_val_str(const char *buf, const char *option, char **oldval) {
  char *value;
  int rc = 0;
  if ((value = _conf_value(buf, option)) != NULL) {
    free(*oldval);
    *oldval = value;
    rc = 1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<_conf_val_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_conf_value@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1174 <_conf_val_str+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_conf_val_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1040 <_conf_value@plt>
test   %rax,%rax
je     1146 <_conf_val_str+0x26>
mov    %rax,%rbx
mov    (%r14),%rdi
call   1030 <free@plt>
mov    %rbx,(%r14)
mov    $0x1,%eax
jmp    1148 <_conf_val_str+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_conf_val_str(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
store i32 0, i32* %8
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i8* @_conf_value(i8* %9, i8* %10)
store i8* %11, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %7
%18 = load i8**, i8*** %6
store i8* %17, i8** %18
store i32 1, i32* %8
br label %19
19: ; preds = %13, %3
%20 = load i32, i32* %8
ret i32 %20
}

LLVM IR (-O2):
define i32 @_conf_val_str(i8* %0, i8* %1, i8** nocapture %2) {
%4 = tail call i8* @_conf_value(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = tail call i32 @free(i8* %7)
store i8* %4, i8** %2
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
int do_971() { return 971; }


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

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

LLVM IR (-O0):
define i32 @do_971() {
ret i32 971
}

LLVM IR (-O2):
define i32 @do_971() {
ret i32 971
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int lis(int *, int);
int main() {
  int array_size = __VERIFIER_nondet_int();
  if (array_size < 1 || array_size >= 2147483647 / sizeof(int)) {
    array_size = 1;
  }
  int *numbers = (int *)alloca(array_size * sizeof(int));
  return lis(numbers, array_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1163 <main+0x33>
movslq -0x8(%rbp),%rax
cmp    $0x1fffffff,%rax
jb     116a <main+0x3a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <lis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
lea    -0x1fffffff(%rax),%ecx
cmp    $0xe0000002,%ecx
mov    $0x1,%ebx
cmovae %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <lis@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp uge i64 %9, 536870911
br i1 %10, label %11, label %12
11: ; preds = %7, %0
store i32 1, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 4
%16 = trunc i64 %15 to i32
%17 = call i64 @alloca(i32 %16)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %3
%19 = load i32*, i32** %3
%20 = load i32, i32* %2
%21 = call i32 @lis(i32* %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -536870911
%3 = icmp ult i32 %2, -536870910
%4 = select i1 %3, i32 1, i32 %1
%5 = shl nuw nsw i32 %4, 2
%6 = tail call i64 @alloca(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 @lis(i32* %7, i32 %4)
ret i32 %8
}
void BN_dec2bn(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_dec2bn() {
ret void
}
void insw(int port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep; insw" : "+D"(addr), "+c"(count) : "d"(port));
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep insw (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
void _who(char const **mode) { (*mode)++; }


x86 assembly (clang, -O0):
<_who>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_who>:
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @_who(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %3
ret void
}

LLVM IR (-O2):
define void @_who(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int main(int argc, char **argv) { init(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
ret i32 0
}
double f4_sum_pre_int_int_float(int v0, int v1, float v) {
  return (double)v0 + (double)v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_float>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm2
addsd  %xmm1,%xmm2
cvtss2sd %xmm0,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_float(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_float(i32 %0, i32 %1, float %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fadd double %4, %5
%7 = fpext float %2 to double
%8 = fadd double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ pal_col(int, int);
void dungeon_blue() { pal_col(1, 0x11); }


x86 assembly (clang, -O0):
<dungeon_blue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x11,%esi
call   1030 <pal_col@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dungeon_blue>:
mov    $0x1,%edi
mov    $0x11,%esi
jmp    1030 <pal_col@plt>

LLVM IR (-O0):
define void @dungeon_blue() {
%1 = call i32 @pal_col(i32 1, i32 17)
ret void
}

LLVM IR (-O2):
define void @dungeon_blue() {
%1 = tail call i32 @pal_col(i32 1, i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("bla bla %d blabla\n", distance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"bla bla %d blabla\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"bla bla %d blabla\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log10(double);
int /*<<< orphan*/ printf(char *, ...);
void calculate_log10(double num) {
  if (num > 0.0) {
    printf("log10 of %lf is %lf\n", num, log10(num));
  } else {
    printf("Could not calculate log10 for negative or zero value\n");
  }
}


x86 assembly (clang, -O0):
<calculate_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116d <calculate_log10+0x4d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  -0x10(%rbp),%xmm0
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    117b <calculate_log10+0x5b>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_log10>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115b <calculate_log10+0x2b>
push   %rax
movsd  %xmm0,(%rsp)
call   1050 <log10@plt>
lea    0xeb4(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
mov    $0x1,%al
pop    %rcx
jmp    1040 <printf@plt>
lea    0xeb3(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"log10 of %lf is %lf\0A\00"
@.str.1 = [54 x i8] c"Could not calculate log10 for negative or zero value\0A\00"
define void @calculate_log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call i32 @log10(double %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %6, i32 %8)
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"log10 of %lf is %lf\0A\00"
@str = [53 x i8] c"Could not calculate log10 for negative or zero value\00"
define void @calculate_log10(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @log10(double %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %0, i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
char const *disk(char *);
const char *disk_root() { return disk("/"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @disk_root() {
%1 = call i8* @disk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @disk_root() {
%1 = tail call i8* @disk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_C_RESET_READ_REQUEST;
scalar_t__ BIO_ctrl(int /*<<< orphan*/ *, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/ *);
int BIO_ctrl_reset_read_request(BIO *bio) {
  return (BIO_ctrl(bio, BIO_C_RESET_READ_REQUEST, 0, NULL) != 0);
}


x86 assembly (clang, -O0):
<BIO_ctrl_reset_read_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <BIO_ctrl@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_ctrl_reset_read_request>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <BIO_ctrl@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@BIO_C_RESET_READ_REQUEST = global i32 0
define i32 @BIO_ctrl_reset_read_request(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @BIO_C_RESET_READ_REQUEST
%5 = call i64 @BIO_ctrl(i32* %3, i32 %4, i32 0, i32* null)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@BIO_C_RESET_READ_REQUEST = global i32 0
define i32 @BIO_ctrl_reset_read_request(i32* %0) {
%2 = load i32, i32* @BIO_C_RESET_READ_REQUEST
%3 = tail call i64 @BIO_ctrl(i32* %0, i32 %2, i32 0, i32* null)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int mswin_minorver() { return (5); }


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

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

LLVM IR (-O0):
define i32 @mswin_minorver() {
ret i32 5
}

LLVM IR (-O2):
define i32 @mswin_minorver() {
ret i32 5
}
char *strcpy(char *dest, const char *src) {
  char *ret = dest;
  while (*src != '\0')
    *dest++ = *src++;
  *dest = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
void swap(int a[], int i, int p) {
  int temp = a[i];
  a[i] = a[p];
  a[p] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *z_rb_get_minmax(struct rbtree *, int);
struct rbnode *rb_get_max(struct rbtree *tree) {
  return z_rb_get_minmax(tree, 1);
}


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

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

LLVM IR (-O0):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %2
%3 = load %struct.rbtree*, %struct.rbtree** %2
%4 = call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %3, i32 1)
ret %struct.rbnode* %4
}

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %0, i32 1)
ret %struct.rbnode* %2
}
/* Type definitions */
struct _stor_fwrite_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fwrite_rsp *);
void stor_fwrite_rsp_free(struct _stor_fwrite_rsp *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fwrite_rsp_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._stor_fwrite_rsp = type { i32 }
define void @stor_fwrite_rsp_free(%struct._stor_fwrite_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fwrite_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(int *, int *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 3, b = 5;
  printf("a b\n½»»»Ç°:\n%d:%d\n", a, b);
  fun(&a, &b);
  printf("½»»»ºó:\n%d:%d\n", a, b);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <fun@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0xeb9(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <fun@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"a b\0A\C2\BD\C2\BB\C2\BB\C2\BB\C3\87\C2\B0:\0A%d:%d\0A\00"
@.str.1 = [21 x i8] c"\C2\BD\C2\BB\C2\BB\C2\BB\C2\BA\C3\B3:\0A%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @fun(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"a b\0A\C2\BD\C2\BB\C2\BB\C2\BB\C3\87\C2\B0:\0A%d:%d\0A\00"
@.str.1 = [21 x i8] c"\C2\BD\C2\BB\C2\BB\C2\BB\C2\BA\C3\B3:\0A%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3, i32 5)
%6 = call i32 @fun(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 (...) @getchar()
ret i32 0
}
int test_imm_96int64_midword_reg(long long val) {
  return ((val >> 16) & (0x96 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_96int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 150
%6 = icmp ne i64 %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_96int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9830400
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double my_random_double() {}


x86 assembly (clang, -O0):
<my_random_double>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @my_random_double() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @my_random_double() {
ret double undef
}