xunge/DecIR huggingface dataset:
unsigned int f41(unsigned int x, unsigned int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f41>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %ecx,%esi
mov    $0x20,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f41>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f41(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* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %8, %12
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f41(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int big2littlei(int);
scalar_t__ isLittleEndian();
int big2hosti(int num) {
  if (isLittleEndian())
    return big2littlei(num);
  return num;
}


x86 assembly (clang, -O0):
<big2hosti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <isLittleEndian@plt>
cmp    $0x0,%rax
je     114c <big2hosti+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <big2littlei@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <big2hosti+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big2hosti>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <isLittleEndian@plt>
test   %rax,%rax
je     1137 <big2hosti+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <big2littlei@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @big2hosti(i32 %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @big2littlei(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void rawprint(char *string) { printf("%s", string); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @rawprint(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isNumber(char *arg) {
  int i = 0;
  while (arg[i] != '\0') {
    if (arg[i] < '0' || arg[i] > '9')
      return 0;
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <isNumber+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     114e <isNumber+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    115a <isNumber+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    116f <isNumber+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <isNumber+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <isNumber+0x23>
add    $0x1,%rdi
nop
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <isNumber+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isNumber+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -58
%12 = icmp ult i8 %11, -10
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ ___arch__swab32p(int /*<<< orphan*/ *);
__u32 ___arch__swab32(__u32 x) { return ___arch__swab32p(&x); }


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

x86 assembly (clang, -O2):
<___arch__swab32>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <___arch__swab32p@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @___arch__swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @___arch__swab32p(i32* %2)
ret i32 %3
}
int ioCanGetFileTypeOfSize(char *pathString, int pathStringLength) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ioCanGetFileTypeOfSize(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __channel_to_freq(int /*<<< orphan*/);
void __configure_channel(uint8_t ch) {
  (*(volatile uint32_t *)(0x508 + (0x40001000))) = __channel_to_freq(ch);
  (*(volatile uint32_t *)(0x554 + (0x40001000))) = ch;
}


x86 assembly (clang, -O0):
<__configure_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__channel_to_freq@plt>
mov    %eax,%ecx
mov    $0x40001508,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    $0x40001554,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__configure_channel>:
push   %rbx
mov    %edi,%ebx
call   1030 <__channel_to_freq@plt>
mov    %eax,0x40001508
mov    %ebx,0x40001554
pop    %rbx
ret

LLVM IR (-O0):
define void @__configure_channel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__channel_to_freq(i32 %3)
store volatile i32 %4, i32* inttoptr (i64 1073747208 to i32*)
%5 = load i32, i32* %2
store volatile i32 %5, i32* inttoptr (i64 1073747284 to i32*)
ret void
}

LLVM IR (-O2):
define void @__configure_channel(i32 %0) {
%2 = tail call i32 @__channel_to_freq(i32 %0)
store volatile i32 %2, i32* inttoptr (i64 1073747208 to i32*)
store volatile i32 %0, i32* inttoptr (i64 1073747284 to i32*)
ret void
}
void fc237(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
  a:
    goto a;
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc237>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc237+0x7>

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

LLVM IR (-O0):
define void @fc237(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
br label %19
19: ; preds = %19, %1
br label %19
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc237(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
char *RCSid() {
  return RCSid("$Id: save.c,v 1.197 2011/10/25 05:10:58 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"$Id: save.c,v 1.197 2011/10/25 05:10:58 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
int longitud(char cadena[]) {
  int indice = 0;
  while (cadena[indice] != '\0')
    indice++;
  return indice;
}


x86 assembly (clang, -O0):
<longitud>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <longitud+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <longitud+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <longitud+0x10>
ret

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

LLVM IR (-O2):
define i32 @longitud(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void stop_proc(int signum) { exit(0); }


x86 assembly (clang, -O0):
<stop_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<stop_proc>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @stop_proc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @stop_proc(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int _rearr(unsigned int, unsigned int);
void _quick(unsigned lb, unsigned ub) {
  unsigned j;
  if (lb < ub) {
    if (j = _rearr(lb, ub))
      _quick(lb, j - 1);
    _quick(j + 1, ub);
  }
}


x86 assembly (clang, -O0):
<_quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    116d <_quick+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_rearr@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     115f <_quick+0x3f>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <_quick@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <_quick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jae    1156 <_quick+0x36>
mov    %esi,%r14d
mov    %edi,%ebp
jmp    113a <_quick+0x1a>
nop
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jae    1156 <_quick+0x36>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <_rearr@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1130 <_quick+0x10>
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1030 <_quick@plt>
jmp    1130 <_quick+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_quick(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %0, %2 ]
%6 = tail call i32 @_rearr(i32 %5, i32 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = add i32 %6, -1
tail call void @_quick(i32 %5, i32 %9)
br label %10
10: ; preds = %8, %4
%11 = add i32 %6, 1
%12 = icmp ult i32 %11, %1
br i1 %12, label %4, label %13
13: ; preds = %10, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int EVP_CIPHER_CTX_cleanup(int /*<<< orphan*/ *);
int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *a) {
  return EVP_CIPHER_CTX_cleanup(a);
}


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

x86 assembly (clang, -O2):
<EVP_CIPHER_CTX_reset>:
jmp    1030 <EVP_CIPHER_CTX_cleanup@plt>

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

LLVM IR (-O2):
define i32 @EVP_CIPHER_CTX_reset(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_CTX_cleanup(i32* %0)
ret i32 %2
}
void lif_read_phy_block(int input_device, int block, unsigned char *data) {}


x86 assembly (clang, -O0):
<lif_read_phy_block>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lif_read_phy_block(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @lif_read_phy_block(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int __vfprintf_chk(FILE *fp, int flag, const char *format, va_list ap) {
  return vfprintf(fp, format, ap);
}


x86 assembly (clang, -O0):
<__vfprintf_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vfprintf_chk>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
define i32 @__vfprintf_chk(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vfprintf(i32* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @__vfprintf_chk(i32* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vfprintf(i32* %0, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct hwtest_ctx {
  int dummy;
};

/* Variables and functions */
int nv50_ptherm_prep(struct hwtest_ctx *);
int nv50_clock_gating_prep(struct hwtest_ctx *ctx) {
  return nv50_ptherm_prep(ctx);
}


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

x86 assembly (clang, -O2):
<nv50_clock_gating_prep>:
jmp    1030 <nv50_ptherm_prep@plt>

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

LLVM IR (-O2):
%struct.hwtest_ctx = type { i32 }
define i32 @nv50_clock_gating_prep(%struct.hwtest_ctx* %0) {
%2 = tail call i32 @nv50_ptherm_prep(%struct.hwtest_ctx* %0)
ret i32 %2
}
char lower(char ch) {
  if (ch >= 'A' && ch <= 'Z')
    return ch + 32;
  return ch;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <lower+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <lower+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <lower+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
size_t readNothing(void *buff, size_t elsize, size_t nelem, void *parm) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @readNothing(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @readNothing(i8* nocapture readnone %0, i64 %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: %s [-sx] [-n count] [prefix [suffix]]\n",
          getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: %s [-sx] [-n count] [prefix [suffix]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: %s [-sx] [-n count] [prefix [suffix]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strrchr(char const *, int);
char *CString_strrchr(const char *a, int b) { return strrchr(a, b); }


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

x86 assembly (clang, -O2):
<CString_strrchr>:
jmp    1030 <strrchr@plt>

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

LLVM IR (-O2):
define i8* @CString_strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int stat(char const *, struct stat *);
int access(const char *pathname, int mode) {
  struct stat statBuf;
  if (stat(pathname, &statBuf) == -1) {
    errno = ENOENT;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1153 <access+0x43>
mov    0x2e94(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <access+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1124 <access+0x14>
pop    %rcx
ret
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    0x2eac(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @access(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.stat
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @stat(i8* %7, %struct.stat* %6)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @ENOENT
store i32 %11, i32* @errno
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @access(i8* nocapture %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* @ENOENT
store i32 %8, i32* @errno
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ -1, %7 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
float __infer_nondet_float();
float log10f(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int test_long(char *ptr) { return ++*((unsigned long *)ptr); }


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

x86 assembly (clang, -O2):
<test_long>:
mov    (%rdi),%rax
add    $0x1,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define i32 @test_long(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = add i64 %5, 1
store i64 %6, i64* %4
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_long(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = add i64 %3, 1
store i64 %4, i64* %2
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float a;
  float b;
  scanf("%f", &a);
  scanf("%f", &b);
  printf("%f + %f = %f \n", a, b, a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
addss  -0xc(%rbp),%xmm2
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [15 x i8] c"%f + %f = %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fadd float %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %6, float %7, float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [15 x i8] c"%f + %f = %f \0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fadd float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %7, float %8, float %9)
ret i32 0
}
void tick() { ; }


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

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

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

LLVM IR (-O2):
define void @tick() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outl(int, int);
void foo(void) { __builtin_outl(22, 0x5678); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
mov    $0x5678,%esi
call   1030 <__builtin_outl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x16,%edi
mov    $0x5678,%esi
jmp    1030 <__builtin_outl@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @__builtin_outl(i32 22, i32 22136)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @__builtin_outl(i32 22, i32 22136)
ret void
}
void f4() { char c[1 ?: 2]; }


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

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

LLVM IR (-O0):
define void @f4() {
%1 = alloca [1 x i8]
ret void
}

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

/* Variables and functions */
void Setup(uint8_t *state, uint8_t *key, uint8_t *iv) {}


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

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

LLVM IR (-O0):
define void @Setup(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @Setup(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __DCACHE_CIALL();
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ISB();
void csi_dcache_clean_invalid(void) {
  __DSB();
  __ISB();
  __DCACHE_CIALL();
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<csi_dcache_clean_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
mov    $0x0,%al
call   1050 <__DCACHE_CIALL@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<csi_dcache_clean_invalid>:
push   %rax
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
call   1030 <__ISB@plt>
xor    %eax,%eax
call   1050 <__DCACHE_CIALL@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @csi_dcache_clean_invalid() {
%1 = call i32 (...) @__DSB()
%2 = call i32 (...) @__ISB()
%3 = call i32 (...) @__DCACHE_CIALL()
%4 = call i32 (...) @__DSB()
%5 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @csi_dcache_clean_invalid() {
%1 = tail call i32 (...) @__DSB()
%2 = tail call i32 (...) @__ISB()
%3 = tail call i32 (...) @__DCACHE_CIALL()
%4 = tail call i32 (...) @__DSB()
%5 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
int cpuid(int);
int is_cpu_pre_c0(void) { return (cpuid(1) & 0xffef) < 0x0f48; }


x86 assembly (clang, -O0):
<is_cpu_pre_c0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <cpuid@plt>
and    $0xffef,%eax
cmp    $0xf48,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cpu_pre_c0>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid@plt>
and    $0xffe8,%eax
xor    %ecx,%ecx
cmp    $0xf48,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_cpu_pre_c0() {
%1 = call i32 @cpuid(i32 1)
%2 = and i32 %1, 65519
%3 = icmp slt i32 %2, 3912
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_cpu_pre_c0() {
%1 = tail call i32 @cpuid(i32 1)
%2 = and i32 %1, 65512
%3 = icmp ult i32 %2, 3912
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ testVaCopyArg(char *, char *);
int main() {
  testVaCopyArg("s", "abc");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <testVaCopyArg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call i32 @testVaCopyArg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ info_led_off();
int /*<<< orphan*/ info_led_on();
int /*<<< orphan*/ msleep(int);
void info_led_blink(int times, int delay_on, int delay_off) {
  for (int i = 0; i < times; i++) {
    info_led_on();
    msleep(delay_on);
    info_led_off();
    msleep(delay_off);
  }
}


x86 assembly (clang, -O0):
<info_led_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1180 <info_led_blink+0x50>
mov    $0x0,%al
call   1050 <info_led_on@plt>
mov    -0x8(%rbp),%edi
call   1030 <msleep@plt>
mov    $0x0,%al
call   1040 <info_led_off@plt>
mov    -0xc(%rbp),%edi
call   1030 <msleep@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <info_led_blink+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_led_blink>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1162 <info_led_blink+0x32>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nop
xor    %eax,%eax
call   1050 <info_led_on@plt>
mov    %ebp,%edi
call   1030 <msleep@plt>
xor    %eax,%eax
call   1040 <info_led_off@plt>
mov    %r14d,%edi
call   1030 <msleep@plt>
add    $0xffffffff,%ebx
jne    1140 <info_led_blink+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @info_led_blink(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
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = call i32 (...) @info_led_on()
%14 = load i32, i32* %5
%15 = call i32 @msleep(i32 %14)
%16 = call i32 (...) @info_led_off()
%17 = load i32, i32* %6
%18 = call i32 @msleep(i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @info_led_blink(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ 0, %3 ]
%8 = tail call i32 (...) @info_led_on()
%9 = tail call i32 @msleep(i32 %1)
%10 = tail call i32 (...) @info_led_off()
%11 = tail call i32 @msleep(i32 %2)
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %5, label %6
}
int commlen(const char *a, const char *b) {
  int l = 0;
  while (*a && *a++ == *b++)
    l++;
  return (l);
}


x86 assembly (clang, -O0):
<commlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1154 <commlen+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1164 <commlen+0x64>
jmp    1172 <commlen+0x72>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <commlen+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<commlen>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <commlen+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1122 <commlen+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <commlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @commlen(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %16, %12 ], [ %3, %2 ]
%7 = phi i32 [ %15, %12 ], [ 0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %1, %2 ]
%9 = phi i8* [ %14, %12 ], [ %0, %2 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %6, %10
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = add nuw nsw i32 %7, 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %12, %2
%19 = phi i32 [ 0, %2 ], [ %15, %12 ], [ %7, %5 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ EMFILE;
int /*<<< orphan*/ errno;
int open(const char *path, int flags, ...) {
  errno = EMFILE;
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EMFILE
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMFILE = global i32 0
@errno = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @EMFILE
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
void rm_lex_item(regex_t *preg) {
  if (preg != NULL) {
    regfree(preg);
    free(preg);
  }
}


x86 assembly (clang, -O0):
<rm_lex_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <rm_lex_item+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <regfree@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_lex_item>:
test   %rdi,%rdi
je     1137 <rm_lex_item+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <regfree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @rm_lex_item(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @regfree(i32* %0)
%5 = tail call i32 @free(i32* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
double _tgamma(double);
double tgamma(double x) { return _tgamma(x); }


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

x86 assembly (clang, -O2):
<tgamma>:
jmp    1030 <_tgamma@plt>

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

LLVM IR (-O2):
define double @tgamma(double %0) {
%2 = tail call double @_tgamma(double %0)
ret double %2
}
long int bar(long int s, long int i) { return i * 2; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    (%rsi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @bar(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 2
ret i64 %6
}

LLVM IR (-O2):
define i64 @bar(i64 %0, i64 %1) {
%3 = shl nsw i64 %1, 1
ret i64 %3
}
int ft_any(char **tab, int (*f)(char *)) {
  while (*tab++) {
    if (f(*tab) == 1)
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
je     1150 <ft_any+0x50>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rdi
call   *%rax
cmp    $0x1,%eax
jne    114b <ft_any+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <ft_any+0x57>
jmp    1110 <ft_any+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x8,%rbx
xchg   %ax,%ax
cmpq   $0x0,-0x8(%rbx)
je     112d <ft_any+0x2d>
mov    (%rbx),%rdi
call   *%r14
add    $0x8,%rbx
cmp    $0x1,%eax
jne    1110 <ft_any+0x10>
mov    $0x1,%eax
jmp    112f <ft_any+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8** [ %0, %2 ], [ %5, %8 ]
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = tail call i32 %1(i8* %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %3
12: ; preds = %3, %8
%13 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %13
}
int getCloserInterval(int now, int interval) {
  int tmp;
  tmp = (now % interval);
  return (now - tmp);
}


x86 assembly (clang, -O0):
<getCloserInterval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCloserInterval>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getCloserInterval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getCloserInterval(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub nsw i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void th_fn() { printf("This is printed from th1\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"This is printed from th1\0A\00"
define void @th_fn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"This is printed from th1\00"
define void @th_fn() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}