xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Com_Parse(char const **);
int Com_CountTokensInBuffer(const char *buffer) {
  const char *text = buffer;
  int n = 0;
  for (;;) {
    Com_Parse(&text);
    if (!text)
      break;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<Com_CountTokensInBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <Com_Parse@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1144 <Com_CountTokensInBuffer+0x34>
jmp    1152 <Com_CountTokensInBuffer+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <Com_CountTokensInBuffer+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_CountTokensInBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    $0xffffffff,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <Com_Parse@plt>
add    $0x1,%ebx
cmpq   $0x0,(%rsp)
jne    1120 <Com_CountTokensInBuffer+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @Com_CountTokensInBuffer(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %9, %4 ]
%6 = call i32 @Com_Parse(i8** %2)
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, null
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
signed char string_is_integer(char *str) {
  for (; *str; str++) {
    int c = str[0];
    if (!isdigit(c)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<string_is_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <string_is_integer+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114d <string_is_integer+0x3d>
movb   $0x0,-0x1(%rbp)
jmp    1167 <string_is_integer+0x57>
jmp    1152 <string_is_integer+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <string_is_integer+0xc>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_integer>:
mov    (%rdi),%cl
mov    $0x1,%al
test   %cl,%cl
je     1126 <string_is_integer+0x26>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jae    1127 <string_is_integer+0x27>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_is_integer+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @string_is_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %4, label %14
14: ; preds = %4, %7, %1
%15 = phi i8 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ program_TIC(long);
void set_TIC(long TIC_in) {
  long TIC_cntr = TIC_in;
  program_TIC(TIC_cntr);
}


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

x86 assembly (clang, -O2):
<set_TIC>:
jmp    1030 <program_TIC@plt>

LLVM IR (-O0):
define void @set_TIC(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = call i32 @program_TIC(i64 %5)
ret void
}

LLVM IR (-O2):
define void @set_TIC(i64 %0) {
%2 = tail call i32 @program_TIC(i64 %0)
ret void
}
int espacioBlanco(char car) { return car <= 32; }


x86 assembly (clang, -O0):
<espacioBlanco>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<espacioBlanco>:
xor    %eax,%eax
cmp    $0x21,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @espacioBlanco(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @espacioBlanco(i8 signext %0) {
%2 = icmp slt i8 %0, 33
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcharacterarray(char *x, int n) {
  lookNarray((char *)x, (unsigned int)n);
}


x86 assembly (clang, -O0):
<lookcharacterarray>:
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 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcharacterarray>:
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcharacterarray(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 i32 @lookNarray(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @lookcharacterarray(i8* %0, i32 %1) {
%3 = tail call i32 @lookNarray(i8* %0, i32 %1)
ret void
}
void gtk_notebook_prev_page() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_prev_page() {
ret void
}
int net_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @net_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  reverse("12345");
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <reverse@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
define i32 @main() {
%1 = tail call i32 @reverse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int safe_strcmp(const char *a, const char *b) {
  if (a == NULL && b == NULL)
    return 0;
  if (a == NULL || b == NULL)
    return 1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<safe_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <safe_strcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <safe_strcmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1174 <safe_strcmp+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1158 <safe_strcmp+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <safe_strcmp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1174 <safe_strcmp+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strcmp>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <safe_strcmp+0x1e>
mov    $0x1,%eax
test   %rdi,%rdi
je     112e <safe_strcmp+0x1e>
test   %rsi,%rsi
je     112e <safe_strcmp+0x1e>
jmp    1030 <strcmp@plt>
ret

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

LLVM IR (-O2):
define i32 @safe_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = or i1 %3, %4
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ 1, %6 ]
ret i32 %11
}
/* Type definitions */
struct Socket {
  int dummy;
};

/* Variables and functions */
struct Socket *new_socket_iface(int, char const *, char *);
struct Socket *new_socket(int port, const char *addr) {
  return new_socket_iface(port, addr, "");
}


x86 assembly (clang, -O0):
<new_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
call   1030 <new_socket_iface@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_socket>:
lea    0xee9(%rip),%rdx
jmp    1030 <new_socket_iface@plt>

LLVM IR (-O0):
%struct.Socket = type { i32 }
@.str = [1 x i8] zeroinitializer
define %struct.Socket* @new_socket(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call %struct.Socket* @new_socket_iface(i32 %5, i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret %struct.Socket* %7
}

LLVM IR (-O2):
%struct.Socket = type { i32 }
@.str = [1 x i8] zeroinitializer
define %struct.Socket* @new_socket(i32 %0, i8* %1) {
%3 = tail call %struct.Socket* @new_socket_iface(i32 %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret %struct.Socket* %3
}
int function(void) {
  static int i;
  static int state = 0;
  switch (state) {
  case 0:;
    for (i = 0; i < 10; i++)
      do {
        state = 11;
        return i;
      case 11:;
      } while (0);
  };
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function+0x2b>
jmp    111a <function+0x1a>
mov    -0x8(%rbp),%eax
sub    $0xb,%eax
je     115f <function+0x5f>
jmp    1182 <function+0x82>
movl   $0x0,0x2eef(%rip)
cmpl   $0xa,0x2ee8(%rip)
jge    117d <function+0x7d>
jmp    1147 <function+0x47>
movl   $0xb,0x2ed7(%rip)
mov    0x2ecd(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <function+0x82>
jmp    1164 <function+0x64>
jmp    1169 <function+0x69>
mov    0x2eb5(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eac(%rip)
jmp    1135 <function+0x35>
jmp    1182 <function+0x82>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    0x2f1e(%rip),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmpb   $0x0,0x2f16(%rip)
cmovne %ecx,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x9,%eax
jg     1127 <function+0x27>
movb   $0x1,0x2f01(%rip)
ret

LLVM IR (-O0):
@function.i = internal global i32 0
@function.state = internal global i32 0
define i32 @function() {
%1 = alloca i32
%2 = load i32, i32* @function.state
switch i32 %2, label %16 [
i32 0, label %3
i32 11, label %10
]
3: ; preds = %0
store i32 0, i32* @function.i
br label %4
4: ; preds = %12, %3
%5 = load i32, i32* @function.i
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
br label %8
8: ; preds = %7
store i32 11, i32* @function.state
%9 = load i32, i32* @function.i
store i32 %9, i32* %1
br label %16
10: ; preds = %0
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = load i32, i32* @function.i
%14 = add nsw i32 %13, 1
store i32 %14, i32* @function.i
br label %4
15: ; preds = %4
br label %16
16: ; preds = %8, %15, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@function.i = internal unnamed_addr global i32 0
@function.state = internal unnamed_addr global i1 false
define i32 @function() {
%1 = load i1, i1* @function.state
%2 = load i32, i32* @function.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function.state
br label %7
7: ; preds = %0, %6
ret i32 %4
}
int asn1_check_eoc(const unsigned char **in, long len) {
  const unsigned char *p;
  if (len < 2)
    return 0;
  p = *in;
  if (!p[0] && !p[1]) {
    *in += 2;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<asn1_check_eoc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jge    1123 <asn1_check_eoc+0x23>
movl   $0x0,-0x4(%rbp)
jmp    116a <asn1_check_eoc+0x6a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1163 <asn1_check_eoc+0x63>
mov    -0x20(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    1163 <asn1_check_eoc+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116a <asn1_check_eoc+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_check_eoc>:
xor    %eax,%eax
cmp    $0x2,%rsi
jl     1110 <asn1_check_eoc+0x10>
mov    (%rdi),%rcx
cmpb   $0x0,(%rcx)
je     1111 <asn1_check_eoc+0x11>
ret
cmpb   $0x0,0x1(%rcx)
jne    1110 <asn1_check_eoc+0x10>
add    $0x2,%rcx
mov    %rcx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @asn1_check_eoc(i8** nocapture %0, i64 %1) {
%3 = icmp slt i64 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %13, i8** %0
br label %14
14: ; preds = %4, %8, %2, %12
%15 = phi i32 [ 1, %12 ], [ 0, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %15
}
int fun595() { return 595; }


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

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

LLVM IR (-O0):
define i32 @fun595() {
ret i32 595
}

LLVM IR (-O2):
define i32 @fun595() {
ret i32 595
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_copy(struct genlist *);
struct datafile_list *datafile_list_copy(const struct datafile_list *plist) {
  return ((struct datafile_list *)(genlist_copy(((struct genlist *)(plist)))));
}


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

x86 assembly (clang, -O2):
<datafile_list_copy>:
jmp    1030 <genlist_copy@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.datafile_list* @datafile_list_copy(%struct.datafile_list* %0) {
%2 = alloca %struct.datafile_list*
store %struct.datafile_list* %0, %struct.datafile_list** %2
%3 = load %struct.datafile_list*, %struct.datafile_list** %2
%4 = bitcast %struct.datafile_list* %3 to %struct.genlist*
%5 = call i64 @genlist_copy(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.datafile_list*
ret %struct.datafile_list* %6
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.datafile_list* @datafile_list_copy(%struct.datafile_list* %0) {
%2 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_copy(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.datafile_list*
ret %struct.datafile_list* %4
}
volatile int *test_02(volatile int *x) {
  int xx = *x++;
  return x;
}


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

x86 assembly (clang, -O2):
<test_02>:
mov    (%rdi),%eax
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @test_02(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load volatile i32, i32* %0
ret i32* %2
}
/* Variables and functions */
void Change(unsigned short *pValue) {
  unsigned char c = 0, *pByte = (unsigned short *)pValue;
  c = pByte[0];
  pByte[0] = pByte[1];
  pByte[1] = c;
}


x86 assembly (clang, -O0):
<Change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Change>:
rolw   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @Change(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_add_time(void *e, void **s, clockid_t clock, uint64_t usec,
                  uint64_t accuracy, void *callback, void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_add_time>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
xor    %eax,%eax
mov    0x2eb9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_add_time>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_add_time(i8* %0, i8** %1, i32 %2, i32 %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %8
store i8** %1, i8*** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i32, i32* @EINVAL
%16 = sub nsw i32 0, %15
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_add_time(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2, i32 %3, i32 %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
%8 = load i32, i32* @EINVAL
%9 = sub nsw i32 0, %8
ret i32 %9
}
unsigned int count32bits(unsigned long int v) {
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}


x86 assembly (clang, -O0):
<count32bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
and    $0x55555555,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x33333333,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
and    $0x33333333,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
and    $0xf0f0f0f,%rax
imul   $0x1010101,%rax,%rax
shr    $0x18,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count32bits>:
mov    %rdi,%rax
shr    %rax
and    $0x55555555,%eax
sub    %rax,%rdi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%rax,%rax
shr    $0x18,%rax
ret

LLVM IR (-O0):
define i32 @count32bits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 1
%6 = and i64 %5, 1431655765
%7 = sub i64 %3, %6
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = and i64 %8, 858993459
%10 = load i64, i64* %2
%11 = lshr i64 %10, 2
%12 = and i64 %11, 858993459
%13 = add i64 %9, %12
store i64 %13, i64* %2
%14 = load i64, i64* %2
%15 = load i64, i64* %2
%16 = lshr i64 %15, 4
%17 = add i64 %14, %16
%18 = and i64 %17, 252645135
%19 = mul i64 %18, 16843009
%20 = lshr i64 %19, 24
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @count32bits(i64 %0) {
%2 = lshr i64 %0, 1
%3 = and i64 %2, 1431655765
%4 = sub i64 %0, %3
%5 = and i64 %4, 858993459
%6 = lshr i64 %4, 2
%7 = and i64 %6, 858993459
%8 = add nuw nsw i64 %7, %5
%9 = lshr i64 %8, 4
%10 = add nuw nsw i64 %9, %8
%11 = and i64 %10, 252645135
%12 = mul nuw nsw i64 %11, 16843009
%13 = lshr i64 %12, 24
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ PN5180_transceiveCommand(int *, int, int /*<<< orphan*/,
                                            int /*<<< orphan*/);
bool PN5180A_loadRFConfig(uint8_t txConf, uint8_t rxConf) {
  uint8_t cmd[3];
  cmd[0] = (0x11);
  cmd[1] = txConf;
  cmd[2] = rxConf;
  PN5180_transceiveCommand(cmd, 3, 0, 0);
  return true;
}


x86 assembly (clang, -O0):
<PN5180A_loadRFConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x11,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <PN5180_transceiveCommand@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PN5180A_loadRFConfig>:
sub    $0x18,%rsp
movl   $0x11,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <PN5180_transceiveCommand@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @PN5180A_loadRFConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 17, i32* %6
%7 = load i32, i32* %3
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %9, i32* %10
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%12 = call i32 @PN5180_transceiveCommand(i32* %11, i32 3, i32 0, i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @PN5180A_loadRFConfig(i32 %0, i32 %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 17, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 %1, i32* %7
%8 = call i32 @PN5180_transceiveCommand(i32* %5, i32 3, i32 0, i32 0)
ret i32 1
}
void format_synerr(msg, arg) char msg[], arg[];
{
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  synerr(errmsg);
}


x86 assembly (clang, -O0):
<format_synerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <synerr@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_synerr>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <synerr@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @format_synerr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_synerr(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int stat(char *, struct stat *);
int get_file_size(char *filename) {
  int size = -1;
  struct stat st;
  int result = stat(filename, &st);
  if (result == 0)
    size = st.st_size;
  return size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1143 <get_file_size+0x33>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %eax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
void splitfloat(unsigned int *wordlow, unsigned int *wordhigh, float value) {
  *wordlow = ((int *)&value)[0];
  *wordhigh = ((int *)&value)[1];
}


x86 assembly (clang, -O0):
<splitfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitfloat>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @splitfloat(i32* nocapture writeonly %0, i32* nocapture readnone %1, float %2) {
%4 = bitcast i32* %0 to float*
store float %2, float* %4
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_x(void *_p, int _v) {
  ((XEvent *)_p)->xreparent.x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xreparent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xreparent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xreparent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void foo491() {}


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

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

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

LLVM IR (-O2):
define void @foo491() {
ret void
}
void yy_z_foo__E() {}


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

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

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

LLVM IR (-O2):
define void @yy_z_foo__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_add2() { CALC_appendString("2"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
define void @CALC_add2() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emsLevel(int *const);
void ems_level_(int *const level) {

  emsLevel(level);
  return;
}


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

x86 assembly (clang, -O2):
<ems_level_>:
jmp    1030 <emsLevel@plt>

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

LLVM IR (-O2):
define void @ems_level_(i32* %0) {
%2 = tail call i32 @emsLevel(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int, int, int /*<<< orphan*/ *);
int a3dsReadChar(FILE *f, char *c) { return fread(c, 1, 1, f) == 1; }


x86 assembly (clang, -O0):
<a3dsReadChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a3dsReadChar>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @a3dsReadChar(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fread(i8* %1, i32 1, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double __ocml_asin_f64(double);
double asin(double x) { return __ocml_asin_f64(x); }


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

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <__ocml_asin_f64@plt>

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

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @__ocml_asin_f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
bool isCommand(const char *command, char *str) {
  return strcmp(command, str) == 0;
}


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

x86 assembly (clang, -O2):
<isCommand>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isCommand(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int R(int /*<<< orphan*/);
int /*<<< orphan*/ cudaGetSymbolAddress(void **, void const *);
int GetSymbolAddress(void **devPtr, const void *symbol) {
  return R(cudaGetSymbolAddress(devPtr, symbol));
}


x86 assembly (clang, -O0):
<GetSymbolAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cudaGetSymbolAddress@plt>
mov    %eax,%edi
call   1030 <R@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSymbolAddress>:
push   %rax
call   1040 <cudaGetSymbolAddress@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <R@plt>

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

LLVM IR (-O2):
define i32 @GetSymbolAddress(i8** %0, i8* %1) {
%3 = tail call i32 @cudaGetSymbolAddress(i8** %0, i8* %1)
%4 = tail call i32 @R(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ attr_char(unsigned char const);
int /*<<< orphan*/ *strchr(char *, unsigned char const);
bool token_char(unsigned char const c) {
  assert('\0' != c);
  return attr_char(c) || NULL != strchr("*'%", c);
}


x86 assembly (clang, -O0):
<token_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movzbl -0x1(%rbp),%edi
call   1040 <attr_char@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    118c <token_char+0x5c>
lea    0xe8b(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_char>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <attr_char@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1156 <token_char+0x26>
pop    %rbx
ret
movzbl %bl,%esi
lea    0xea0(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"*'%\00"
define i32 @token_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ne i32 0, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8, i8* %2
%9 = call i64 @attr_char(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %2
%13 = call i32* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %12)
%14 = icmp ne i32* null, %13
br label %15
15: ; preds = %11, %1
%16 = phi i1 [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"*'%\00"
define i32 @token_char(i8 zeroext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @attr_char(i8 zeroext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = tail call i32* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
int bgbrasw_exp2f12(int val) {
  int i, j, k;
  i = 4096 | (val & 4095);
  j = (val >> 12);
  while (j--)
    i = i << 1;
  k = (i >> 12);
  return (k);
}


x86 assembly (clang, -O0):
<bgbrasw_exp2f12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff,%eax
or     $0x1000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1142 <bgbrasw_exp2f12+0x42>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <bgbrasw_exp2f12+0x20>
mov    -0x8(%rbp),%eax
sar    $0xc,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgbrasw_exp2f12>:
mov    %edi,%eax
and    $0xfff,%eax
or     $0x1000,%eax
cmp    $0x1000,%edi
jb     1148 <bgbrasw_exp2f12+0x48>
sar    $0xc,%edi
lea    -0x1(%rdi),%ecx
mov    %edi,%edx
and    $0x7,%edx
je     113b <bgbrasw_exp2f12+0x3b>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %eax,%eax
add    $0x1,%esi
cmp    %esi,%edx
jne    1130 <bgbrasw_exp2f12+0x30>
sub    %esi,%edi
cmp    $0x7,%ecx
jb     1148 <bgbrasw_exp2f12+0x48>
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1140 <bgbrasw_exp2f12+0x40>
sar    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @bgbrasw_exp2f12(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 4095
%8 = or i32 4096, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 12
store i32 %10, i32* %4
br label %11
11: ; preds = %15, %1
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = shl i32 %16, 1
store i32 %17, i32* %3
br label %11
18: ; preds = %11
%19 = load i32, i32* %3
%20 = ashr i32 %19, 12
store i32 %20, i32* %5
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @bgbrasw_exp2f12(i32 %0) {
%2 = and i32 %0, 4095
%3 = or i32 %2, 4096
%4 = icmp ult i32 %0, 4096
br i1 %4, label %29, label %5
5: ; preds = %1
%6 = ashr i32 %0, 12
%7 = add nsw i32 %6, -1
%8 = and i32 %6, 7
%9 = icmp eq i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %5, %10
%11 = phi i32 [ %15, %10 ], [ %3, %5 ]
%12 = phi i32 [ %14, %10 ], [ %6, %5 ]
%13 = phi i32 [ %16, %10 ], [ 0, %5 ]
%14 = add nsw i32 %12, -1
%15 = shl i32 %11, 1
%16 = add i32 %13, 1
%17 = icmp eq i32 %16, %8
br i1 %17, label %18, label %10
18: ; preds = %10, %5
%19 = phi i32 [ undef, %5 ], [ %15, %10 ]
%20 = phi i32 [ %3, %5 ], [ %15, %10 ]
%21 = phi i32 [ %6, %5 ], [ %14, %10 ]
%22 = icmp ult i32 %7, 7
br i1 %22, label %29, label %23
23: ; preds = %18, %23
%24 = phi i32 [ %26, %23 ], [ %20, %18 ]
%25 = phi i32 [ %27, %23 ], [ %21, %18 ]
%26 = shl i32 %24, 8
%27 = add nsw i32 %25, -8
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %23
29: ; preds = %18, %23, %1
%30 = phi i32 [ %3, %1 ], [ %19, %18 ], [ %26, %23 ]
%31 = ashr i32 %30, 12
ret i32 %31
}
int ADD_ASSIGN(int x, int y) { return x += y; }


x86 assembly (clang, -O0):
<ADD_ASSIGN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADD_ASSIGN>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @ADD_ASSIGN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, %5
store i32 %7, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @ADD_ASSIGN(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double c(double, double, double);
double no(double x, double y) { return c(x * 1.2 + 0.97, y + 0.25, 0.2); }


x86 assembly (clang, -O0):
<no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeac(%rip),%xmm2
call   1030 <c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no>:
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
jmp    1030 <c@plt>

LLVM IR (-O0):
define double @no(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @llvm.fmuladd.f64(double %5, double 1.200000e+00, double 0x3FEF0A3D70A3D70A)
%7 = load double, double* %4
%8 = fadd double %7, 2.500000e-01
%9 = call double @c(double %6, double %8, double 2.000000e-01)
ret double %9
}

LLVM IR (-O2):
define double @no(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 1.200000e+00, double 0x3FEF0A3D70A3D70A)
%4 = fadd double %1, 2.500000e-01
%5 = tail call double @c(double %3, double %4, double 2.000000e-01)
ret double %5
}