xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double, double, double);
void printPoints(double x1, double y1, double x2, double y2) {
  printf("The points is (%lf,%lf),(%lf,%lf)\n", x1, y1, x2, y2);
  exit(0);
}


x86 assembly (clang, -O0):
<printPoints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [35 x i8] c"The points is (%lf,%lf),(%lf,%lf)\0A\00"
define void @printPoints(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %9, double %10, double %11, double %12)
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"The points is (%lf,%lf),(%lf,%lf)\0A\00"
define void @printPoints(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2, double %3)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void avpriv_copy_bits() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_copy_bits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy1(char *, char *);
int main() {
  char str1[] = "hello world";
  char str2[100];
  strcpy1(str1, str2);
  printf("%s\n", str2);
  printf("%s\n", str1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <strcpy1@plt>
lea    -0x80(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%r14
lea    0x10(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcpy1@plt>
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.str1 = [12 x i8] c"hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @strcpy1(i8* %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [12 x i8] c"hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy1(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_sleep(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 &= ~0x80;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116f <KIONIX_ACCEL_sleep+0x4f>
movsbl -0x1(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1176 <KIONIX_ACCEL_sleep+0x56>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_sleep>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_sleep+0x41>
movzbl 0xf(%rsp),%esi
and    $0x7f,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_sleep() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -129
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_sleep() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, 127
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int wrap_FileControl(sqlite3_file *pFile, int op, void *pArg) {
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<wrap_FileControl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_FileControl>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @wrap_FileControl(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @SQLITE_OK
ret i32 %7
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @wrap_FileControl(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @SQLITE_OK
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ msgSync(int *);
void msg_sync_(int *const STATUS) {
  int status;
  status = *STATUS;
  msgSync(&status);
  *STATUS = status;
}


x86 assembly (clang, -O0):
<msg_sync_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <msgSync@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_sync_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <msgSync@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @msg_sync_(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @msgSync(i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cp_quoted(char const **, char **, int);
int /*<<< orphan*/ cp_word(char const **, char **, int);
void cp_quoted_ifquoted(const char **pp, char **pq, int n, char qchar) {
  const char *p = *pp;
  if (*p == qchar)
    cp_quoted(pp, pq, n);
  else
    cp_word(pp, pq, n);
}


x86 assembly (clang, -O0):
<cp_quoted_ifquoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    116b <cp_quoted_ifquoted+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <cp_quoted@plt>
jmp    117b <cp_quoted_ifquoted+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cp_word@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_quoted_ifquoted>:
mov    (%rdi),%rax
cmp    %cl,(%rax)
jne    112c <cp_quoted_ifquoted+0xc>
jmp    1030 <cp_quoted@plt>
jmp    1040 <cp_word@plt>

LLVM IR (-O0):
define void @cp_quoted_ifquoted(i8** %0, i8** %1, i32 %2, i8 signext %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %23
18: ; preds = %4
%19 = load i8**, i8*** %5
%20 = load i8**, i8*** %6
%21 = load i32, i32* %7
%22 = call i32 @cp_quoted(i8** %19, i8** %20, i32 %21)
br label %28
23: ; preds = %4
%24 = load i8**, i8*** %5
%25 = load i8**, i8*** %6
%26 = load i32, i32* %7
%27 = call i32 @cp_word(i8** %24, i8** %25, i32 %26)
br label %28
28: ; preds = %23, %18
ret void
}

LLVM IR (-O2):
define void @cp_quoted_ifquoted(i8** %0, i8** %1, i32 %2, i8 signext %3) {
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %3
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @cp_quoted(i8** %0, i8** %1, i32 %2)
br label %12
10: ; preds = %4
%11 = tail call i32 @cp_word(i8** %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %8
ret void
}
int crc_init(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @crc_init() {
ret i32 0
}
char hextochar(char *hex) {
  int i, j;
  i = (int)hex[0];
  j = (int)hex[1];
  if (hex[0] >= 'A')
    i -= 55;
  else
    i -= 48;
  if (hex[1] >= 'A')
    j -= 55;
  else
    j -= 48;
  return (char)((16 * i) + j);
}


x86 assembly (clang, -O0):
<hextochar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     113b <hextochar+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <hextochar+0x44>
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x41,%eax
jl     1163 <hextochar+0x63>
mov    -0x10(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x10(%rbp)
jmp    116c <hextochar+0x6c>
mov    -0x10(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
add    -0x10(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextochar>:
mov    (%rdi),%cl
mov    0x1(%rdi),%dl
cmp    $0x41,%cl
mov    $0x9,%esi
mov    $0x40,%eax
cmovge %esi,%eax
add    %cl,%al
cmp    $0x41,%dl
mov    $0xc9,%ecx
mov    $0xd0,%esi
cmovge %ecx,%esi
add    %dl,%sil
shl    $0x4,%al
add    %sil,%al
ret

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

LLVM IR (-O2):
define signext i8 @hextochar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = icmp sgt i8 %2, 64
%6 = select i1 %5, i8 9, i8 64
%7 = add i8 %6, %2
%8 = icmp sgt i8 %4, 64
%9 = select i1 %8, i8 -55, i8 -48
%10 = add i8 %9, %4
%11 = shl i8 %7, 4
%12 = add i8 %10, %11
ret i8 %12
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int compare_uid(const void *a, const void *b) {
  return *(const uid_t *)a - *(const uid_t *)b;
}


x86 assembly (clang, -O0):
<compare_uid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_uid>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_uid(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_uid(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void free_cc2dfft() { return; }


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

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

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

LLVM IR (-O2):
define void @free_cc2dfft() {
ret void
}
/* Variables and functions */
int ArgNum();
int LevelOf(int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int RandPerc();
int Cnd_ChanceLev(void) { return (RandPerc() < (ArgNum() * LevelOf(Me()))); }


x86 assembly (clang, -O0):
<Cnd_ChanceLev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RandPerc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <Me@plt>
mov    %eax,%edi
call   1050 <LevelOf@plt>
mov    -0x8(%rbp),%ecx
mov    %eax,%edx
mov    -0x4(%rbp),%eax
imul   %edx,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_ChanceLev>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <RandPerc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <Me@plt>
mov    %eax,%edi
call   1050 <LevelOf@plt>
imul   %ebp,%eax
xor    %ecx,%ecx
cmp    %eax,%ebx
setl   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Cnd_ChanceLev() {
%1 = call i32 (...) @RandPerc()
%2 = call i32 (...) @ArgNum()
%3 = call i32 (...) @Me()
%4 = call i32 @LevelOf(i32 %3)
%5 = mul nsw i32 %2, %4
%6 = icmp slt i32 %1, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @Cnd_ChanceLev() {
%1 = tail call i32 (...) @RandPerc()
%2 = tail call i32 (...) @ArgNum()
%3 = tail call i32 (...) @Me()
%4 = tail call i32 @LevelOf(i32 %3)
%5 = mul nsw i32 %4, %2
%6 = icmp slt i32 %1, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_y(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->y = (int)_v;
}


x86 assembly (clang, -O0):
<set_XConfigureRequestEvent_y>:
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_XConfigureRequestEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureRequestEvent_y(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void version() {
  printf("%s %s\n\n%s\n", "png2bin", "1.0",
         "Copyright (C) 2015 - Jardel Weyrich <jweyrich@gmail.com>\n\n"
         "This is free software; see the source for copying conditions. There "
         "is NO\n"
         "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
         "PURPOSE.");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xee7(%rip),%rcx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xeee(%rip),%rdx
lea    0xeeb(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s %s\0A\0A%s\0A\00"
@.str.1 = [8 x i8] c"png2bin\00"
@.str.2 = [4 x i8] c"1.0\00"
@.str.3 = [208 x i8] c"Copyright (C) 2015 - Jardel Weyrich <jweyrich@gmail.com>\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s %s\0A\0A%s\0A\00"
@.str.1 = [8 x i8] c"png2bin\00"
@.str.2 = [4 x i8] c"1.0\00"
@.str.3 = [208 x i8] c"Copyright (C) 2015 - Jardel Weyrich <jweyrich@gmail.com>\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void partition(int *arr, int ind, int left) {
  int val;
  for (val = 1; val <= left; val++) {
    arr[ind] = val;
    partition(arr, ind + 1, left - val);
  }
}


x86 assembly (clang, -O0):
<partition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1166 <partition+0x56>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1030 <partition@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <partition+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partition>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    1149 <partition+0x39>
mov    %edx,%ebx
mov    %rdi,%r14
movslq %esi,%r15
lea    0x1(%r15),%r12d
add    $0xffffffff,%ebx
mov    $0x1,%ebp
mov    %ebp,(%r14,%r15,4)
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
call   1030 <partition@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jb     1130 <partition+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @partition(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = add nsw i32 %1, 1
br label %9
9: ; preds = %5, %9
%10 = phi i32 [ 1, %5 ], [ %12, %9 ]
store i32 %10, i32* %7
%11 = sub nsw i32 %2, %10
tail call void @partition(i32* %0, i32 %8, i32 %11)
%12 = add nuw i32 %10, 1
%13 = icmp eq i32 %10, %2
br i1 %13, label %14, label %9
14: ; preds = %9, %3
ret void
}
void ularith_add_ul_2ul(unsigned long *r1, unsigned long *r2,
                        const unsigned long a) {
  *r1 += a;
  if (*r1 < a)
    (*r2)++;
}


x86 assembly (clang, -O0):
<ularith_add_ul_2ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jae    113d <ularith_add_ul_2ul+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_add_ul_2ul>:
add    %rdx,(%rdi)
jae    1109 <ularith_add_ul_2ul+0x9>
addq   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @ularith_add_ul_2ul(i64* nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %0
%5 = add i64 %4, %2
store i64 %5, i64* %0
%6 = icmp ult i64 %5, %2
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i64, i64* %1
%9 = add i64 %8, 1
store i64 %9, i64* %1
br label %10
10: ; preds = %7, %3
ret void
}
void dlog(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @dlog(i8* nocapture %0, ...) {
ret void
}
void COMP_zlib_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @COMP_zlib_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int __opensock(void) {
  int fd;
  fd = socket(AF_INET, SOCK_DGRAM, 0);
  return (fd);
}


x86 assembly (clang, -O0):
<__opensock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__opensock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @__opensock() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_DGRAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @__opensock() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
void move(char *target, char *source, int length) {
  __builtin_memmove(target, source, length);
}


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

x86 assembly (clang, -O2):
<move>:
movslq %edx,%rdx
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @move(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret void
}
int blah2(int num) {
  int res = num % 17;
  res = res + 4;
  res = res * 3;
  res = res - 7;
  return res / 8;
}


x86 assembly (clang, -O0):
<blah2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x11,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah2>:
movslq %edi,%rax
imul   $0x78787879,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%edx
sub    %edx,%eax
lea    (%rax,%rax,2),%eax
add    $0x5,%al
mov    %eax,%ecx
sar    $0x7,%cl
shr    $0x5,%cl
add    %al,%cl
sar    $0x3,%cl
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @blah2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 17
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 4
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 3
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 7
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 8
ret i32 %13
}

LLVM IR (-O2):
define i32 @blah2(i32 %0) {
%2 = srem i32 %0, 17
%3 = trunc i32 %2 to i8
%4 = mul nsw i8 %3, 3
%5 = add nsw i8 %4, 5
%6 = sdiv i8 %5, 8
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ createKey();
int msgget(int /*<<< orphan*/, int);
int createMsg(int permission) {
  int result = -1;
  int msgid;
  key_t key = createKey();
  if (-1 != (msgid = msgget(key, permission | IPC_CREAT)))
    result = msgid;
  return result;
}


x86 assembly (clang, -O0):
<createMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1040 <createKey@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2e97(%rip),%rax
or     (%rax),%esi
call   1030 <msgget@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     1168 <createMsg+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createMsg>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <createKey@plt>
mov    0x2eaf(%rip),%rcx
or     (%rcx),%ebx
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <msgget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @createMsg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%6 = call i32 (...) @createKey()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = load i32, i32* @IPC_CREAT
%10 = or i32 %8, %9
%11 = call i32 @msgget(i32 %7, i32 %10)
store i32 %11, i32* %4
%12 = icmp ne i32 -1, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @createMsg(i32 %0) {
%2 = tail call i32 (...) @createKey()
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, %0
%5 = tail call i32 @msgget(i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int strspn(char const, char const);
int matches(char const *str, char const *group) {
  return (strspn(*str, *group));
}


x86 assembly (clang, -O0):
<matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1030 <strspn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches>:
movsbl (%rdi),%edi
movsbl (%rsi),%esi
jmp    1030 <strspn@plt>

LLVM IR (-O0):
define i32 @matches(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 @strspn(i8 signext %6, i8 signext %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @matches(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = tail call i32 @strspn(i8 signext %3, i8 signext %4)
ret i32 %5
}
int ObfuscateAtom(int at) {
  at = (3 * at) - 3;
  return at;
}


x86 assembly (clang, -O0):
<ObfuscateAtom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ObfuscateAtom>:
lea    (%rdi,%rdi,2),%eax
add    $0xfffffffd,%eax
ret

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

LLVM IR (-O2):
define i32 @ObfuscateAtom(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = add nsw i32 %2, -3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int B() {
  puts("-- B() return 10;");
  return 10;
}


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

x86 assembly (clang, -O2):
<B>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"-- B() return 10;\00"
define i32 @B() {
%1 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 10
}

LLVM IR (-O2):
@.str = [18 x i8] c"-- B() return 10;\00"
define i32 @B() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int button;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_button(void *_p, unsigned _v) {
  ((XEvent *)_p)->xbutton.button = (unsigned)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xbutton_button>:
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_xbutton_button>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xbutton_button(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_xbutton_button(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, world\n");

  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RTFileSetForceFlags(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileSetForceFlags() {
ret void
}
double __ddiv_rd(double x, double y) { return x / y; }


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

x86 assembly (clang, -O2):
<__ddiv_rd>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__ddiv_rd(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 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @__ddiv_rd(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
void tgl_fixme(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @tgl_fixme(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int ztimed_read_wait_millisecond(int, long);
int ztimed_read_wait(int fd, int read_wait_timeout) {
  return ztimed_read_wait_millisecond(fd, 1000L * read_wait_timeout);
}


x86 assembly (clang, -O0):
<ztimed_read_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movslq -0x8(%rbp),%rax
imul   $0x3e8,%rax,%rsi
call   1030 <ztimed_read_wait_millisecond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ztimed_read_wait>:
movslq %esi,%rax
imul   $0x3e8,%rax,%rsi
jmp    1030 <ztimed_read_wait_millisecond@plt>

LLVM IR (-O0):
define i32 @ztimed_read_wait(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 = mul nsw i64 1000, %7
%9 = call i32 @ztimed_read_wait_millisecond(i32 %5, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @ztimed_read_wait(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = mul nsw i64 %3, 1000
%5 = tail call i32 @ztimed_read_wait_millisecond(i32 %0, i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XAddConnectionWatch() {
  printf("XAddConnectionWatch called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"XAddConnectionWatch called\0A\00"
define i32 @XAddConnectionWatch() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"XAddConnectionWatch called\00"
define i32 @XAddConnectionWatch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int show_message(void) {
  setbuf(stdout, 0);
  printf("this is a test message\n");
  return 0;
}


x86 assembly (clang, -O0):
<show_message>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_message>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [24 x i8] c"this is a test message\0A\00"
define i32 @show_message() {
%1 = load i32, i32* @stdout
%2 = call i32 @setbuf(i32 %1, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [23 x i8] c"this is a test message\00"
define i32 @show_message() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
startad(pc) {
  newline(4, 0, 3);
  word(0);
  word(pc);
  endline();
}


x86 assembly (clang, -O0):
<startad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x4,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <newline@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <word@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <word@plt>
mov    $0x0,%al
call   1050 <endline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startad>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <newline@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <word@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <word@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <endline@plt>

LLVM IR (-O0):
define i32 @startad(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @newline to i32 (i32, i32, i32, ...)*)(i32 4, i32 0, i32 3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 %6)
%8 = call i32 (...) @endline()
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @startad(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @newline to i32 (i32, i32, i32, ...)*)(i32 4, i32 0, i32 3)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (...) @endline()
ret i32 undef
}
/* Variables and functions */
bool is_digit(int c) {
  if (c >= '0' && c <= '9') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <is_digit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <is_digit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_digit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void Atm128AlarmAsyncP$0$Counter$overflow(void) {
  CounterToLocalTimeC$0$Counter$overflow();
}


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

x86 assembly (clang, -O2):
<Atm128AlarmAsyncP$0$Counter$overflow>:
xor    %eax,%eax
jmp    1030 <CounterToLocalTimeC$0$Counter$overflow@plt>

LLVM IR (-O0):
define void @"Atm128AlarmAsyncP$0$Counter$overflow"() {
%1 = call i32 (...) @"CounterToLocalTimeC$0$Counter$overflow"()
ret void
}

LLVM IR (-O2):
define void @"Atm128AlarmAsyncP$0$Counter$overflow"() {
%1 = tail call i32 (...) @"CounterToLocalTimeC$0$Counter$overflow"()
ret void
}
void proc5(long p1, int p2, short p3, char p4, long *p5) {
  *p5 = p1 + p2 + p3 - p4;
}


x86 assembly (clang, -O0):
<proc5>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rax
add    %rax,%rcx
movswq -0xe(%rbp),%rax
add    %rax,%rcx
movsbq -0xf(%rbp),%rax
sub    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc5>:
movslq %esi,%rax
add    %rdi,%rax
movslq %edx,%rdx
add    %rax,%rdx
movslq %ecx,%rax
sub    %rax,%rdx
mov    %rdx,(%r8)
ret

LLVM IR (-O0):
define void @proc5(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i16
%9 = alloca i8
%10 = alloca i64*
store i64 %0, i64* %6
store i32 %1, i32* %7
store i16 %2, i16* %8
store i8 %3, i8* %9
store i64* %4, i64** %10
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = load i16, i16* %8
%16 = sext i16 %15 to i64
%17 = add nsw i64 %14, %16
%18 = load i8, i8* %9
%19 = sext i8 %18 to i64
%20 = sub nsw i64 %17, %19
%21 = load i64*, i64** %10
store i64 %20, i64* %21
ret void
}

LLVM IR (-O2):
define void @proc5(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* nocapture writeonly %4) {
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %0
%8 = sext i16 %2 to i64
%9 = add nsw i64 %7, %8
%10 = sext i8 %3 to i64
%11 = sub i64 %9, %10
store i64 %11, i64* %4
ret void
}
unsigned long long g(unsigned long long a) { return a & 0xfffffffffffeffffull; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffeffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
and    $0xfffffffffffeffff,%rax
ret

LLVM IR (-O0):
define i64 @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -65537
ret i64 %4
}

LLVM IR (-O2):
define i64 @g(i64 %0) {
%2 = and i64 %0, -65537
ret i64 %2
}
/* Variables and functions */
long long abs(long long);
long long internal_abs_l(long long value) { return abs(value); }


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

x86 assembly (clang, -O2):
<internal_abs_l>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @internal_abs_l(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}