xunge/DecIR huggingface dataset:
int getopt_long_only_l(argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{ return _getopt_internal(argc, argv, options, long_options, opt_index, 1); }


x86 assembly (clang, -O0):
<getopt_long_only_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
mov    $0x0,%al
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only_l>:
mov    $0x1,%r9d
xor    %eax,%eax
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @getopt_long_only_l(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @getopt_long_only_l(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_signed_char(signed char const k1,
                                          signed char const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_signed_char>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_signed_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_signed_char(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp) { return 0; }


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

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

LLVM IR (-O0):
%struct.ab8500_btemp = type opaque
define i32 @ab8500_btemp_get_batctrl_temp(%struct.ab8500_btemp* %0) {
%2 = alloca %struct.ab8500_btemp*
store %struct.ab8500_btemp* %0, %struct.ab8500_btemp** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ab8500_btemp = type opaque
define i32 @ab8500_btemp_get_batctrl_temp(%struct.ab8500_btemp* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  struct {
    signed int s : 3;
    unsigned int u : 3;
  } x = {-1, -1};
  if (x.s != -1)
    abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%al
shl    $0x5,%al
sar    $0x5,%al
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     113d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
@__const.main.x = %struct.anon { i8 63, [3 x i8] undef }
define i32 @main() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = bitcast %struct.anon* %1 to i8*
%4 = load i8, i8* %3
%5 = shl i8 %4, 5
%6 = ashr i8 %5, 5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
long strtol(char const *, char **, int);
int parseint(const char *string, long *result) {
  char *end;
  errno = 0;
  *result = strtol(string, &end, 10);
  return !(*end || errno);
}


x86 assembly (clang, -O0):
<parseint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    1170 <parseint+0x60>
mov    0x2e7a(%rip),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ec2(%rip),%r14
movq   $0x0,(%r14)
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,(%rbx)
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
sete   %al
cmpq   $0x0,(%r14)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @parseint(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
store i64 0, i64* @errno
%6 = load i8*, i8** %3
%7 = call i64 @strtol(i8* %6, i8** %5, i32 10)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = load i64, i64* @errno
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %13, %2
%17 = phi i1 [ true, %2 ], [ %15, %13 ]
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @parseint(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
store i64 %5, i64* %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = load i64, i64* @errno
%10 = icmp eq i64 %9, 0
%11 = select i1 %8, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
scalar_t__ string2long(char const *, char **, int, int);
long strtol(const char *s, char **endp, int base) {
  return ((signed long)string2long(s, endp, base, 1));
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <string2long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
mov    $0x1,%ecx
jmp    1030 <string2long@plt>

LLVM IR (-O0):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @string2long(i8* %7, i8** %8, i32 %9, i32 1)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @string2long(i8* %0, i8** %1, i32 %2, i32 1)
ret i64 %4
}
int checkLeapYear(int y) {
  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
}


x86 assembly (clang, -O0):
<checkLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <checkLeapYear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <checkLeapYear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkLeapYear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <checkLeapYear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <checkLeapYear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @checkLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @checkLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
int CDVDFS_write(int fd, char *buffer, int size) {
  if (size == 0)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<CDVDFS_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1124 <CDVDFS_write+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <CDVDFS_write+0x2b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDVDFS_write>:
neg    %edx
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @CDVDFS_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp ne i32 %2, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
void abort() {
  syscall(SYS_exit, -1);
  assert(0);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffff,%esi
call   1040 <syscall@plt>
xor    %edi,%edi
call   1030 <assert@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffff,%esi
call   1040 <syscall@plt>
xor    %edi,%edi
call   1030 <assert@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define void @abort() {
%1 = load i32, i32* @SYS_exit
%2 = call i32 @syscall(i32 %1, i32 -1)
%3 = call i32 @assert(i32 0)
unreachable
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define void @abort() {
%1 = load i32, i32* @SYS_exit
%2 = tail call i32 @syscall(i32 %1, i32 -1)
%3 = tail call i32 @assert(i32 0)
unreachable
}
int res_index(char *t, char c) {
  register int i;
  for (i = 0; t[i] && t[i] != c; i++)
    ;
  if (t[i])
    return (i);
  else
    return -1;
}


x86 assembly (clang, -O0):
<res_index>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1147 <res_index+0x47>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1157 <res_index+0x57>
jmp    116a <res_index+0x6a>
jmp    115c <res_index+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <res_index+0x15>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1187 <res_index+0x87>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118e <res_index+0x8e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_index>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
add    $0x1,%ecx
test   %al,%al
je     1123 <res_index+0x23>
add    $0x1,%rdi
cmp    %sil,%al
jne    1110 <res_index+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @res_index(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %28, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br label %25
25: ; preds = %15, %7
%26 = phi i1 [ false, %7 ], [ %24, %15 ]
br i1 %26, label %27, label %31
27: ; preds = %25
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %25
%32 = load i8*, i8** %4
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = icmp ne i8 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %31
%39 = load i32, i32* %6
store i32 %39, i32* %3
br label %41
40: ; preds = %31
store i32 -1, i32* %3
br label %41
41: ; preds = %40, %38
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @res_index(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
%13 = select i1 %7, i32 -1, i32 %12
ret i32 %13
}
/* Type definitions */
struct bnx2x {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bnx2x_stats_comp(struct bnx2x *);
int /*<<< orphan*/ bnx2x_stats_pmf_update(struct bnx2x *);
int /*<<< orphan*/ bnx2x_stats_start(struct bnx2x *);
void bnx2x_stats_pmf_start(struct bnx2x *bp) {
  bnx2x_stats_comp(bp);
  bnx2x_stats_pmf_update(bp);
  bnx2x_stats_start(bp);
}


x86 assembly (clang, -O0):
<bnx2x_stats_pmf_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <bnx2x_stats_comp@plt>
mov    -0x8(%rbp),%rdi
call   1030 <bnx2x_stats_pmf_update@plt>
mov    -0x8(%rbp),%rdi
call   1040 <bnx2x_stats_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnx2x_stats_pmf_start>:
push   %rbx
mov    %rdi,%rbx
call   1050 <bnx2x_stats_comp@plt>
mov    %rbx,%rdi
call   1030 <bnx2x_stats_pmf_update@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <bnx2x_stats_start@plt>

LLVM IR (-O0):
%struct.bnx2x = type { i32 }
define void @bnx2x_stats_pmf_start(%struct.bnx2x* %0) {
%2 = alloca %struct.bnx2x*
store %struct.bnx2x* %0, %struct.bnx2x** %2
%3 = load %struct.bnx2x*, %struct.bnx2x** %2
%4 = call i32 @bnx2x_stats_comp(%struct.bnx2x* %3)
%5 = load %struct.bnx2x*, %struct.bnx2x** %2
%6 = call i32 @bnx2x_stats_pmf_update(%struct.bnx2x* %5)
%7 = load %struct.bnx2x*, %struct.bnx2x** %2
%8 = call i32 @bnx2x_stats_start(%struct.bnx2x* %7)
ret void
}

LLVM IR (-O2):
%struct.bnx2x = type { i32 }
define void @bnx2x_stats_pmf_start(%struct.bnx2x* %0) {
%2 = tail call i32 @bnx2x_stats_comp(%struct.bnx2x* %0)
%3 = tail call i32 @bnx2x_stats_pmf_update(%struct.bnx2x* %0)
%4 = tail call i32 @bnx2x_stats_start(%struct.bnx2x* %0)
ret void
}
void g_param_spec_get_blurb() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_get_blurb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void main() {
  unsigned int a, b;
  a = 0xff;
  b = ~a;
  printf("%x\n", b);
  a = ~b;
  printf("%x\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffff00,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -256)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 255)
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int);
int /*<<< orphan*/ usage_error(char *, char const *);
int int_or_die(const char *str) {
  char *end;
  long answer = strtol(str, &end, 10);
  if (str == end) {
    usage_error("invalid integer: '%s'", str);
  }
  return answer;
}


x86 assembly (clang, -O0):
<int_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1160 <int_or_die+0x40>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <usage_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_or_die>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%r14
cmp    %rbx,(%rsp)
jne    114c <int_or_die+0x2c>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <usage_error@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"invalid integer: '%s'\00"
define i32 @int_or_die(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %3, i32 10)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @usage_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %1
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"invalid integer: '%s'\00"
define i32 @int_or_die(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @usage_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
%10 = trunc i64 %4 to i32
ret i32 %10
}
int DiagClose(int iHandle) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @DiagClose(i32 %0) {
ret i32 -1
}
/* Variables and functions */
float __infer_nondet_float();
float expm1f(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<expm1f>:
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):
<expm1f>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_float@plt>

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

LLVM IR (-O2):
define float @expm1f(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int Cnd_LtF(void) {
  int v = ArgNum();
  return (GetFlag(v) < GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Cnd_LtF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_LtF>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_LtF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i64 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = call i64 @GetFlag(i32 %5)
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @Cnd_LtF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = icmp slt i64 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void spamm_get_time(double *timer) {
  printf("no timer configured\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<spamm_get_time>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"no timer configured\0A\00"
define void @spamm_get_time(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"no timer configured\00"
define void @spamm_get_time(double* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ func(char *);
int main() {
  func("hello");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double __dnint(double);
double d_nint(double *x) { return (__dnint(*x)); }


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

x86 assembly (clang, -O2):
<d_nint>:
movsd  (%rdi),%xmm0
jmp    1030 <__dnint@plt>

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

LLVM IR (-O2):
define double @d_nint(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @__dnint(double %2)
ret double %3
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
unsigned char cpu_get_r8(struct cpu *, int /*<<< orphan*/);
unsigned char cpu_get_f(struct cpu *cpu) { return cpu_get_r8(cpu, (0)); }


x86 assembly (clang, -O0):
<cpu_get_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <cpu_get_r8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_get_f>:
xor    %esi,%esi
jmp    1030 <cpu_get_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_f(%struct.cpu* %0) {
%2 = alloca %struct.cpu*
store %struct.cpu* %0, %struct.cpu** %2
%3 = load %struct.cpu*, %struct.cpu** %2
%4 = call zeroext i8 @cpu_get_r8(%struct.cpu* %3, i32 0)
ret i8 %4
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_f(%struct.cpu* %0) {
%2 = tail call zeroext i8 @cpu_get_r8(%struct.cpu* %0, i32 0)
ret i8 %2
}
lazy_rec(dots, len) struct s_dot *dots[];
int len;
{
  int i;
  struct s_l_node *node;
  node = lazy_search(dots, len);
}


x86 assembly (clang, -O0):
<lazy_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <lazy_search@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s_dot = type opaque
%struct.s_l_node = type opaque
define i32 @lazy_rec(%struct.s_dot** %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.s_dot**
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.s_l_node*
store %struct.s_dot** %0, %struct.s_dot*** %4
store i32 %1, i32* %5
%8 = load %struct.s_dot**, %struct.s_dot*** %4
%9 = load i32, i32* %5
%10 = call i32 (%struct.s_dot**, i32, ...) bitcast (i32 (...)* @lazy_search to i32 (%struct.s_dot**, i32, ...)*)(%struct.s_dot** %8, i32 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to %struct.s_l_node*
store %struct.s_l_node* %12, %struct.s_l_node** %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.s_dot = type opaque
define i32 @lazy_rec(%struct.s_dot** %0, i32 %1) {
%3 = tail call i32 (%struct.s_dot**, i32, ...) bitcast (i32 (...)* @lazy_search to i32 (%struct.s_dot**, i32, ...)*)(%struct.s_dot** %0, i32 %1)
ret i32 undef
}
__attribute__((always_)) unsigned long native_read_cr8(void) {
  unsigned long cr8;
  asm volatile("movq %%cr8,%0" : "=r"(cr8));
  return cr8;
}


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

x86 assembly (clang, -O2):
<native_read_cr8>:
mov    %cr8,%rax
ret

LLVM IR (-O0):
define i64 @native_read_cr8() {
%1 = alloca i64
%2 = call i64 asm sideeffect "movq %cr8,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @native_read_cr8() {
%1 = tail call i64 asm sideeffect "movq %cr8,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void generate_pieces(int unused_pieces[(4 * 4 - 1)]) {
  int i;
  for (i = 1; i <= (4 * 4 - 1); i++) {
    unused_pieces[i - 1] = i;
  }
}


x86 assembly (clang, -O0):
<generate_pieces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jg     113a <generate_pieces+0x3a>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <generate_pieces+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_pieces>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movabs $0xe0000000d,%rax
mov    %rax,0x30(%rdi)
movl   $0xf,0x38(%rdi)
ret

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

LLVM IR (-O2):
define void @generate_pieces(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
store i32 13, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 13
store i32 14, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 14
store i32 15, i32* %9
ret void
}
int irq_canonicalize(int irq) { return ((irq == 2) ? 9 : irq); }


x86 assembly (clang, -O0):
<irq_canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    111e <irq_canonicalize+0x1e>
mov    $0x9,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <irq_canonicalize+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_canonicalize>:
cmp    $0x2,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @irq_canonicalize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 9, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @irq_canonicalize(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 9, i32 %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ is_expr_valid(char *, char *, char *);
int /*<<< orphan*/ my_putstr(char *);
int checks_before_epur(char *base, char *ops, char *expr) {
  if (!is_expr_valid(expr, base, ops)) {
    my_putstr("Invalid expression: unknown characters have been found\n");
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<checks_before_epur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <is_expr_valid@plt>
cmp    $0x0,%eax
jne    1166 <checks_before_epur+0x46>
lea    0xeab(%rip),%rdi
call   1040 <my_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    116d <checks_before_epur+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checks_before_epur>:
push   %rax
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
call   1030 <is_expr_valid@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     113f <checks_before_epur+0x1f>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <my_putstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Invalid expression: unknown characters have been found\0A\00"
define i32 @checks_before_epur(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @is_expr_valid(i8* %8, i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %3
%14 = call i32 @my_putstr(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %16
15: ; preds = %3
store i32 1, i32* %4
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@.str = [56 x i8] c"Invalid expression: unknown characters have been found\0A\00"
define i32 @checks_before_epur(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @is_expr_valid(i8* %2, i8* %0, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @my_putstr(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ imprimeascii();
void main() {
  imprimeascii();
  getch();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <imprimeascii@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getch@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @imprimeascii()
%2 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @imprimeascii()
%2 = tail call i32 (...) @getch()
ret void
}
void vscale(float v[3], float div) {
  v[0] *= div;
  v[1] *= div;
  v[2] *= div;
}


x86 assembly (clang, -O0):
<vscale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vscale(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fmul float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @vscale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
int test_imm_7Eint16_reg(short val) {
  return ((val) & (0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x7e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 126
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void return2Digits(char returnString[], char *buffer2, int digits) {
  if (digits < 10)
    sprintf(returnString, "0%i", digits);
  else
    sprintf(returnString, "%i", digits);
  strcpy(returnString, buffer2);
}


x86 assembly (clang, -O0):
<return2Digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1155 <return2Digits+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1168 <return2Digits+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return2Digits>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0xa,%edx
lea    0xecc(%rip),%rax
lea    0xec6(%rip),%rsi
cmovl  %rax,%rsi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"0%i\00"
@.str.1 = [3 x i8] c"%i\00"
define void @return2Digits(i8* %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %2, 10
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) %5, i32 %2)
%7 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fsend(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void file_write(const char *path, FILE *out) {
  FILE *fp;
  fp = fopen(path, "r");
  if (!fp)
    return;
  fsend(fp, out);
  fclose(fp);
}


x86 assembly (clang, -O0):
<file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <file_write+0x34>
jmp    117a <file_write+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fsend@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_write>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <file_write+0x35>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fsend@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @file_write(i8* nocapture %0, i32* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fsend(i32* %3, i32* %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
ret void
}
void test2(int (*p)[3]) {}


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

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

LLVM IR (-O0):
define void @test2([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @test2([3 x i32]* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _esp8266_putch(int /*<<< orphan*/);
void _esp8266_print(unsigned const char *ptr) {
  while (*ptr != 0) {
    _esp8266_putch(*ptr++);
  }
}


x86 assembly (clang, -O0):
<_esp8266_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <_esp8266_print+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <_esp8266_putch@plt>
jmp    111c <_esp8266_print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_esp8266_print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <_esp8266_print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <_esp8266_putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_esp8266_print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_esp8266_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @_esp8266_putch(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
float minimum(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <minimum+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <minimum+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @minimum(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ disp_color_str(char *, int);
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ get_ticks();
int /*<<< orphan*/ milli_delay(int);
void TestA() {
  int i = 0;
  while (1) {
    disp_color_str("A.", 0x08 | (0x0 | 0x4));
    disp_int(get_ticks());
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0xc,%esi
call   1030 <disp_color_str@plt>
mov    $0x0,%al
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    $0xc8,%edi
call   1050 <milli_delay@plt>
jmp    114f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %rbx
lea    0xeb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <disp_color_str@plt>
xor    %eax,%eax
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    $0xc8,%edi
call   1050 <milli_delay@plt>
jmp    1150 <TestA+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_color_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 (...) @get_ticks()
%5 = call i32 @disp_int(i32 %4)
%6 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_color_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 (...) @get_ticks()
%4 = tail call i32 @disp_int(i32 %3)
%5 = tail call i32 @milli_delay(i32 200)
br label %1
}