xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t load64(const uint8_t *x) {
  uint64_t r = 0;
  for (size_t i = 0; i < 8; ++i) {
    r |= (uint64_t)x[i] << 8 * i;
  }
  return r;
}


x86 assembly (clang, -O0):
<load64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    114f <load64+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <load64+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @load64(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i64
store i64* %0, i64** %2
store i32 0, i32* %3
store i64 0, i64* %4
br label %5
5: ; preds = %20, %1
%6 = load i64, i64* %4
%7 = icmp ult i64 %6, 8
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i64*, i64** %2
%10 = load i64, i64* %4
%11 = getelementptr inbounds i64, i64* %9, i64 %10
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = load i64, i64* %4
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %13, %16
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %8
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %5
23: ; preds = %5
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @load64(i64* nocapture %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ print_c(char const);
void print_str_len(const char *str, size_t len) {
  unsigned i;
  print("\"");
  for (i = 0; i < len; i++)
    print_c(str[i]);
  print("\"");
}


x86 assembly (clang, -O0):
<print_str_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <print@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    116e <print_str_len+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <print_c@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <print_str_len+0x23>
lea    0xe8b(%rip),%rdi
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str_len>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xece(%rip),%rdi
call   1030 <print@plt>
test   %r15,%r15
je     1152 <print_str_len+0x32>
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%edi
call   1040 <print_c@plt>
add    $0x1,%ebx
cmp    %r15,%rbx
jb     1140 <print_str_len+0x20>
lea    0xea7(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\22\00"
define void @print_str_len(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @print_c(i8 signext %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
%23 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\22\00"
define void @print_str_len(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @print_c(i8 signext %8)
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %1
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_75_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_75_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_75_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_75_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
ret i32 %8
}
unsigned xrop3_7_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_7_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_7_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_7_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_7_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 1;; i++) {
    printf("hello %d !\n", i);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"hello %d !\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello %d !\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
char *ft_strccpy(char *, char const *, int);
int ft_strclen(char const *, int);
scalar_t__ malloc(int);
char *ft_strcdup(char const *s, int c) {
  char *dest;
  dest = NULL;
  if ((dest = (char *)malloc(sizeof(char) * (ft_strclen(s, c) + 1))) == NULL)
    return (NULL);
  return (ft_strccpy(dest, s, c));
}


x86 assembly (clang, -O0):
<ft_strcdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <ft_strclen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117e <ft_strcdup+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1192 <ft_strcdup+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ft_strccpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcdup>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <ft_strclen@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     115d <ft_strcdup+0x2d>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ft_strccpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ft_strcdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* null, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @ft_strclen(i8* %7, i32 %8)
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 1, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %2
store i8* null, i8** %3
br label %23
18: ; preds = %2
%19 = load i8*, i8** %6
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = call i8* @ft_strccpy(i8* %19, i8* %20, i32 %21)
store i8* %22, i8** %3
br label %23
23: ; preds = %18, %17
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @ft_strcdup(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strclen(i8* %0, i32 %1)
%4 = add nsw i32 %3, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = inttoptr i64 %5 to i8*
%9 = tail call i8* @ft_strccpy(i8* %8, i8* %0, i32 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %9, %7 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
bool isOperand(char ch) { return isalpha(ch) || isdigit(ch); }


x86 assembly (clang, -O0):
<isOperand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <isOperand+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%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):
<isOperand>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isOperand+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isOperand(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isdigit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isOperand(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *mystrdup(const char *s) {
  char *d = NULL;
  if (s) {
    int sl = strlen(s) + 1;
    d = (char *)malloc(sl);
    if (d)
      memcpy(d, s, sl);
  }
  return d;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118a <mystrdup+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1185 <mystrdup+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
jmp    118a <mystrdup+0x5a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1164 <mystrdup+0x34>
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1167 <mystrdup+0x37>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1167 <mystrdup+0x37>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %22
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %7
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = load i32, i32* %4
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
br label %21
21: ; preds = %16, %7
br label %22
22: ; preds = %21, %1
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %5)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int target;
  int a, b, c;
  target = 51235;
  a = target * 10;
  b = target / 10;
  c = target % 10;
  printf("%d %d %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc823,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 51235, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 10
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 512350, i32 5123, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nop();
void opcode_00() { nop(); }


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

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

LLVM IR (-O0):
define void @opcode_00() {
%1 = call i32 (...) @nop()
ret void
}

LLVM IR (-O2):
define void @opcode_00() {
%1 = tail call i32 (...) @nop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extendVertexSet(int /*<<< orphan*/, unsigned long long,
                                   int /*<<< orphan*/, unsigned long long,
                                   unsigned long long);
void handleMatching(unsigned long long int currentlyMatchedVertices,
                    unsigned long long int currentMatching) {
  extendVertexSet(0, 0ULL, 0, currentlyMatchedVertices, currentMatching);
}


x86 assembly (clang, -O0):
<handleMatching>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1030 <extendVertexSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleMatching>:
mov    %rsi,%r8
mov    %rdi,%rcx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <extendVertexSet@plt>

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

LLVM IR (-O2):
define void @handleMatching(i64 %0, i64 %1) {
%3 = tail call i32 @extendVertexSet(i32 0, i64 0, i32 0, i64 %0, i64 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *cmdf__strdup(const char *src) {
  char *dst = (char *)(malloc(sizeof(char) * (strlen(src) + 1)));
  if (!dst)
    return NULL;
  return strcpy(dst, src);
}


x86 assembly (clang, -O0):
<cmdf__strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <cmdf__strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1182 <cmdf__strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdf__strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1159 <cmdf__strdup+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115b <cmdf__strdup+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cmdf__strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %1
store i8* null, i8** %2
br label %20
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = call i8* @strcpy(i8* %17, i8* %18)
store i8* %19, i8** %2
br label %20
20: ; preds = %16, %15
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @cmdf__strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = tail call i8* @strcpy(i8* %7, i8* dereferenceable(1) %0)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %10
}
int mdp4_mddi_on(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_mddi_on(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int core8_safe(char const *);
int U_EMREXTTEXTOUTA_safe(const char *record) { return (core8_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMREXTTEXTOUTA_safe>:
jmp    1030 <core8_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMREXTTEXTOUTA_safe(i8* %0) {
%2 = tail call i32 @core8_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ g();
int /*<<< orphan*/ z();
f(int a) {
  if ((a & 64))
    z();
  if ((a & 128) == 0)
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1141 <f+0x21>
mov    $0x0,%al
call   1030 <z@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1159 <f+0x39>
mov    $0x0,%al
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
test   $0x40,%bl
jne    112f <f+0xf>
test   $0x80,%bl
je     113b <f+0x1b>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <z@plt>
test   $0x80,%bl
jne    112d <f+0xd>
xor    %eax,%eax
call   1040 <g@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 64
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @z()
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 128
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @g()
br label %11
11: ; preds = %9, %6
ret i32 undef
}
char *langRomTypeF4deviceNormal() { return "F4 Device Normal"; }


x86 assembly (clang, -O0):
<langRomTypeF4deviceNormal>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeF4deviceNormal>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"F4 Device Normal\00"
define i8* @langRomTypeF4deviceNormal() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"F4 Device Normal\00"
define i8* @langRomTypeF4deviceNormal() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ outputIO();
int /*<<< orphan*/ readIO();
void watchIO() {
  readIO();
  outputIO();
}


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

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

LLVM IR (-O0):
define void @watchIO() {
%1 = call i32 (...) @readIO()
%2 = call i32 (...) @outputIO()
ret void
}

LLVM IR (-O2):
define void @watchIO() {
%1 = tail call i32 (...) @readIO()
%2 = tail call i32 (...) @outputIO()
ret void
}
/* Variables and functions */
bool UART_BUSY(void *base_address) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @UART_BUSY(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun();
int main(int argc, char *argv[]) {
  fun();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fun()
ret i32 0
}
void foo_1_2_1_1_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_2_1_1_1_1() {
ret void
}
/* Type definitions */
typedef size_t int64_t;

/* Variables and functions */
int64_t contains0_rec(int64_t *arr, int64_t len, int64_t i) {
  if (i >= len) {
    return 0;
  } else if (arr[i] == 0) {
    return 1;
  } else {
    return contains0_rec(arr, len, i + 1);
  }
}


x86 assembly (clang, -O0):
<contains0_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     113f <contains0_rec+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1178 <contains0_rec+0x68>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    115f <contains0_rec+0x4f>
movq   $0x1,-0x8(%rbp)
jmp    1178 <contains0_rec+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1030 <contains0_rec@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains0_rec>:
xor    %eax,%eax
cmp    %rsi,%rdx
jae    1120 <contains0_rec+0x20>
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,(%rdi,%rdx,8)
je     1121 <contains0_rec+0x21>
add    $0x1,%rdx
cmp    %rdx,%rsi
jne    1110 <contains0_rec+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @contains0_rec(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %2, %1
br i1 %4, label %7, label %13
5: ; preds = %7
%6 = icmp eq i64 %12, %1
br i1 %6, label %13, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %12, %5 ], [ %2, %3 ]
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
%12 = add i64 %8, 1
br i1 %11, label %13, label %5
13: ; preds = %5, %7, %3
%14 = phi i64 [ 0, %3 ], [ 1, %7 ], [ 0, %5 ]
ret i64 %14
}
void directAddressDelete(int *T, int k) { T[k] = -65535; }


x86 assembly (clang, -O0):
<directAddressDelete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffff0001,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<directAddressDelete>:
movslq %esi,%rax
movl   $0xffff0001,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @directAddressDelete(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
store i32 -65535, i32* %8
ret void
}

LLVM IR (-O2):
define void @directAddressDelete(i32* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 -65535, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearbuff(char *);
int send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
void message(int player, char *msg) {
  char buff[256];
  clearbuff(buff);
  strcpy(buff, msg);
  int n = send(player, buff, 256, 0);
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
call   1050 <clearbuff@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0x114(%rbp)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1050 <clearbuff@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @message(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @clearbuff(i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i32, i32* %3
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = call i32 @send(i32 %12, i8* %13, i32 256, i32 0)
store i32 %14, i32* %6
ret void
}

LLVM IR (-O2):
define void @message(i32 %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @clearbuff(i8* %4)
%6 = call i32 @strcpy(i8* %4, i8* %1)
%7 = call i32 @send(i32 %0, i8* %4, i32 256, i32 0)
ret void
}
__typeof__(memset(1, 1, 1)) test_memset_125(void) { return memset(1, 1, 1); }


x86 assembly (clang, -O0):
<test_memset_125>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    $0x1,%esi
mov    %rdx,%rdi
call   1030 <memset@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_memset_125() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memset_125() {
store i8 1, i8* inttoptr (i64 1 to i8*)
ret i8* inttoptr (i64 1 to i8*)
}
void os_stop_sound(void) {}


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

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

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

LLVM IR (-O2):
define void @os_stop_sound() {
ret void
}
void BSP_TouchScreen_Init(void) {
  (*(volatile unsigned *)0x58000008) = 50000;
  (*(volatile unsigned *)0x58000000) = (1 << 14) + (9 << 6);
  (*(volatile unsigned *)0x58000004) = 0xd3;
}


x86 assembly (clang, -O0):
<BSP_TouchScreen_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58000008,%eax
movl   $0xc350,(%rax)
mov    $0x58000000,%eax
movl   $0x4240,(%rax)
mov    $0x58000004,%eax
movl   $0xd3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_TouchScreen_Init>:
movl   $0xc350,0x58000008
movl   $0x4240,0x58000000
movl   $0xd3,0x58000004
ret

LLVM IR (-O0):
define void @BSP_TouchScreen_Init() {
store volatile i32 50000, i32* inttoptr (i64 1476395016 to i32*)
store volatile i32 16960, i32* inttoptr (i64 1476395008 to i32*)
store volatile i32 211, i32* inttoptr (i64 1476395012 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_TouchScreen_Init() {
store volatile i32 50000, i32* inttoptr (i64 1476395016 to i32*)
store volatile i32 16960, i32* inttoptr (i64 1476395008 to i32*)
store volatile i32 211, i32* inttoptr (i64 1476395012 to i32*)
ret void
}
/* Variables and functions */
int myfunc(int, int);
int other(int x) { return 1 + myfunc(4, 5); }


x86 assembly (clang, -O0):
<other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <myfunc@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<other>:
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <myfunc@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @other(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @myfunc(i32 4, i32 5)
%4 = add nsw i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @other(i32 %0) {
%2 = tail call i32 @myfunc(i32 4, i32 5)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  unsigned long flags;
};
typedef TYPE_1__ BUF_MEM;

/* Variables and functions */
TYPE_1__ *BUF_MEM_new();
BUF_MEM *BUF_MEM_new_ex(unsigned long flags) {
  BUF_MEM *ret;
  ret = BUF_MEM_new();
  if (ret != NULL)
    ret->flags = flags;
  return (ret);
}


x86 assembly (clang, -O0):
<BUF_MEM_new_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <BUF_MEM_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <BUF_MEM_new_ex+0x2d>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BUF_MEM_new_ex>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <BUF_MEM_new@plt>
test   %rax,%rax
je     1123 <BUF_MEM_new_ex+0x13>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64 }
define %struct.TYPE_4__* @BUF_MEM_new_ex(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.TYPE_4__*
store i64 %0, i64* %2
%4 = call %struct.TYPE_4__* (...) @BUF_MEM_new()
store %struct.TYPE_4__* %4, %struct.TYPE_4__** %3
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%6 = icmp ne %struct.TYPE_4__* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 0
store i64 %8, i64* %10
br label %11
11: ; preds = %7, %1
%12 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
ret %struct.TYPE_4__* %12
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64 }
define %struct.TYPE_4__* @BUF_MEM_new_ex(i64 %0) {
%2 = tail call %struct.TYPE_4__* (...) @BUF_MEM_new()
%3 = icmp eq %struct.TYPE_4__* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 0
store i64 %0, i64* %5
br label %6
6: ; preds = %4, %1
ret %struct.TYPE_4__* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo2();
int foo1() { foo2(); }


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

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

LLVM IR (-O0):
define i32 @foo1() {
%1 = alloca i32
%2 = call i32 (...) @foo2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo1() {
%1 = tail call i32 (...) @foo2()
ret i32 undef
}
int test_imm_ADint16_mem(short *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADint16_mem>:
testb  $0xad,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ADint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 173
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((__no__)) load_gpr(double *a, double *b) {
  double c = *a;
  __asm__("# gpr, reg = %0" : "+b"(c));
  *b = c;
}


x86 assembly (clang, -O0):
<load_gpr>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rbx
movq   %rbx,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_gpr>:
push   %rbx
mov    (%rdi),%rbx
mov    %rbx,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @load_gpr(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double, double* %5
%9 = call double asm "# gpr, reg = $0", "={bx},0,~{dirflag},~{fpsr},~{flags}"(double %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = load double*, double** %4
store double %10, double* %11
ret void
}

LLVM IR (-O2):
define void @load_gpr(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call double asm "# gpr, reg = $0", "={bx},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %1
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
long long L_ceil(double v) { return (long long)ceil(v); }


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

x86 assembly (clang, -O2):
<L_ceil>:
jmp    1030 <ceil@plt>

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

LLVM IR (-O2):
define i64 @L_ceil(double %0) {
%2 = tail call i64 @ceil(double %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(short *, int, long long, int /*<<< orphan*/ *);
void wavfile_write(FILE *file, short data[], long long length) {
  fwrite(data, sizeof(short), length, file);
}


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

x86 assembly (clang, -O2):
<wavfile_write>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x2,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @wavfile_write(i32* nocapture %0, i16* nocapture %1, i64 %2) {
%4 = tail call i32 @fwrite(i16* %1, i32 2, i64 %2, i32* %0)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int qsort_strcmp(const char **a, const char **b) { return strcmp(*a, *b); }


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

x86 assembly (clang, -O2):
<qsort_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @qsort_strcmp(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @qsort_strcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
int test_imm_ACuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xAC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ACuint64_midword_mem>:
testb  $0xac,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11272192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void sa_inject_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @sa_inject_stats() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ revertLastSubdivision();
int /*<<< orphan*/ subdivideEdge(int /*<<< orphan*/, int);
int /*<<< orphan*/ subdivideK33impl(int);
void subdivideK33_first(int times) {
  subdivideEdge(0, 6);
  subdivideK33impl(times - 1);
  revertLastSubdivision();
  subdivideEdge(0, 4);
  subdivideK33impl(times - 1);
  revertLastSubdivision();
}


x86 assembly (clang, -O0):
<subdivideK33_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <subdivideEdge@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <subdivideK33impl@plt>
mov    $0x0,%al
call   1050 <revertLastSubdivision@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <subdivideEdge@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <subdivideK33impl@plt>
mov    $0x0,%al
call   1050 <revertLastSubdivision@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subdivideK33_first>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <subdivideEdge@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1030 <subdivideK33impl@plt>
xor    %eax,%eax
call   1050 <revertLastSubdivision@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <subdivideEdge@plt>
mov    %ebx,%edi
call   1030 <subdivideK33impl@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <revertLastSubdivision@plt>

LLVM IR (-O0):
define void @subdivideK33_first(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @subdivideEdge(i32 0, i32 6)
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = call i32 @subdivideK33impl(i32 %5)
%7 = call i32 (...) @revertLastSubdivision()
%8 = call i32 @subdivideEdge(i32 0, i32 4)
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call i32 @subdivideK33impl(i32 %10)
%12 = call i32 (...) @revertLastSubdivision()
ret void
}

LLVM IR (-O2):
define void @subdivideK33_first(i32 %0) {
%2 = tail call i32 @subdivideEdge(i32 0, i32 6)
%3 = add nsw i32 %0, -1
%4 = tail call i32 @subdivideK33impl(i32 %3)
%5 = tail call i32 (...) @revertLastSubdivision()
%6 = tail call i32 @subdivideEdge(i32 0, i32 4)
%7 = tail call i32 @subdivideK33impl(i32 %3)
%8 = tail call i32 (...) @revertLastSubdivision()
ret void
}