xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t ml_min(uint16_t a, uint16_t b) {
  if (a > b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<ml_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <ml_min+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ml_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @ml_min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void av_get_profile_name() {}


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

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

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

LLVM IR (-O2):
define void @av_get_profile_name() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int DirExists(char *pathname) {
  struct stat buf;
  if (stat(pathname, &buf) < 0)
    return (0);
  return (S_ISDIR(buf.st_mode));
}


x86 assembly (clang, -O0):
<DirExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <DirExists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <DirExists+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DirExists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <DirExists+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @DirExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fbi_swap_uint64_t(int /*<<< orphan*/);
uint64_t fbi_htonll(uint64_t u64) {
  int _one = 1;
  char *_p = (char *)&_one;
  int swapped = *_p;
  if (swapped) {
    return fbi_swap_uint64_t(u64);
  }
  return u64;
}


x86 assembly (clang, -O0):
<fbi_htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114e <fbi_htonll+0x3e>
mov    -0x8(%rbp),%edi
call   1030 <fbi_swap_uint64_t@plt>
mov    %eax,-0x4(%rbp)
jmp    1154 <fbi_htonll+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbi_htonll>:
jmp    1030 <fbi_swap_uint64_t@plt>

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

LLVM IR (-O2):
define i32 @fbi_htonll(i32 %0) {
%2 = tail call i32 @fbi_swap_uint64_t(i32 %0)
ret i32 %2
}
int fc8300_cs_tuner_deinit(void *handle, unsigned short devid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fc8300_cs_tuner_deinit(i8* nocapture readnone %0, i16 zeroext %1) {
ret i32 0
}
unsigned long xnarch_set_irq_affinity(unsigned irq, unsigned long affinity) {
  return 0;
}


x86 assembly (clang, -O0):
<xnarch_set_irq_affinity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @xnarch_set_irq_affinity(i32 %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
void *mips(void *args) {
  unsigned long long *mips = (unsigned long long *)args;
  while (1) {
    *mips += 1;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<mips>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rcx,(%rax)
jmp    1110 <mips+0x10>

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

LLVM IR (-O0):
define i8* @mips(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
br label %6
6: ; preds = %1, %6
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = add i64 %8, 1
store i64 %9, i64* %7
br label %6
}

LLVM IR (-O2):
define noalias i8* @mips(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void bork() {
  char *volatile p;
  volatile int cc;
  p += cc;
}


x86 assembly (clang, -O0):
<bork>:
push   %rbp
mov    %rsp,%rbp
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bork>:
movslq -0xc(%rsp),%rax
add    %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @bork() {
%1 = alloca i8*
%2 = alloca i32
%3 = load volatile i32, i32* %2
%4 = load volatile i8*, i8** %1
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store volatile i8* %6, i8** %1
ret void
}

LLVM IR (-O2):
define void @bork() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load volatile i32, i32* %2
%6 = load volatile i8*, i8** %1
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store volatile i8* %8, i8** %1
ret void
}
void p_upd(char c, int *line, int *col) {
  if (c == '\n')
    *col = 1, (*line)++;
  else
    (*col)++;
}


x86 assembly (clang, -O0):
<p_upd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1139 <p_upd+0x39>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1144 <p_upd+0x44>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_upd>:
cmp    $0xa,%dil
jne    1110 <p_upd+0x10>
movl   $0x1,(%rdx)
addl   $0x1,(%rsi)
ret
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @p_upd(i8 signext %0, i32* nocapture %1, i32* nocapture %2) {
%4 = icmp eq i8 %0, 10
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 1, i32* %2
br label %6
6: ; preds = %3, %5
%7 = phi i32* [ %1, %5 ], [ %2, %3 ]
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void usage(const char *name, int value) { error("Specify -forth or -lisp"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Specify -forth or -lisp\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Specify -forth or -lisp\00"
define void @usage(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sys_openat(int, char const *, int, int);
int sys_open(const char *pathname, int flags, int mode) {
  return sys_openat((-100), pathname, flags, mode);
}


x86 assembly (clang, -O0):
<sys_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xffffff9c,%edi
call   1030 <sys_openat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffff9c,%edi
jmp    1030 <sys_openat@plt>

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

LLVM IR (-O2):
define i32 @sys_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @sys_openat(i32 -100, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(void) {
  char buffer[256];
  printf("Enter your name and press <Enter>:\n");
  gets(buffer);
  printf("\nYour name has %d characters and spaces!", strlen(buffer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Enter your name and press <Enter>:\0A\00"
@.str.1 = [41 x i8] c"\0AYour name has %d characters and spaces!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"\0AYour name has %d characters and spaces!\00"
@str = [35 x i8] c"Enter your name and press <Enter>:\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
char *access_stack_mem() {
  char str[5];
  memset(str, 0x00, sizeof(str));
  memcpy(str, "TEST", 4);
  printf("\nstack_mem_str : %s", str);
  return (str);
}


x86 assembly (clang, -O0):
<access_stack_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    -0x5(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
lea    -0x5(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x5(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access_stack_mem>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TEST\00"
@.str.1 = [20 x i8] c"\0Astack_mem_str : %s\00"
define i8* @access_stack_mem() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 5)
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"TEST\00"
@.str.1 = [20 x i8] c"\0Astack_mem_str : %s\00"
define i8* @access_stack_mem() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 5)
%4 = call i32 @memcpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGCONT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  kill(getpid(), SIGCONT);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGCONT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGCONT
%4 = call i32 @kill(i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@SIGCONT = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGCONT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Type definitions */
struct userinfo {
  int dummy;
};
struct instance_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IRC_SendMessage(struct instance_data *, char *, char *);
void CMD_ping(struct instance_data *pID, struct userinfo *pUI, char *szChannel,
              unsigned int iArgc, char **ppArgs, char *szArgsRaw) {
  IRC_SendMessage(pID, szChannel, "Pong!");
}


x86 assembly (clang, -O0):
<CMD_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdx
call   1030 <IRC_SendMessage@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMD_ping>:
lea    0xee9(%rip),%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <IRC_SendMessage@plt>

LLVM IR (-O0):
%struct.instance_data = type { i32 }
%struct.userinfo = type { i32 }
@.str = [6 x i8] c"Pong!\00"
define void @CMD_ping(%struct.instance_data* %0, %struct.userinfo* %1, i8* %2, i32 %3, i8** %4, i8* %5) {
%7 = alloca %struct.instance_data*
%8 = alloca %struct.userinfo*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i8*
store %struct.instance_data* %0, %struct.instance_data** %7
store %struct.userinfo* %1, %struct.userinfo** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i8* %5, i8** %12
%13 = load %struct.instance_data*, %struct.instance_data** %7
%14 = load i8*, i8** %9
%15 = call i32 @IRC_SendMessage(%struct.instance_data* %13, i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.instance_data = type { i32 }
%struct.userinfo = type { i32 }
@.str = [6 x i8] c"Pong!\00"
define void @CMD_ping(%struct.instance_data* %0, %struct.userinfo* nocapture readnone %1, i8* %2, i32 %3, i8** nocapture readnone %4, i8* nocapture readnone %5) {
%7 = tail call i32 @IRC_SendMessage(%struct.instance_data* %0, i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int);
void decera(int top, int left, int bottom, int right) {
  do_csi("%d;%d;%d;%d$z", top, left, bottom, right);
}


x86 assembly (clang, -O0):
<decera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decera>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d;%d;%d;%d$z\00"
define void @decera(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d;%d;%d;%d$z\00"
define void @decera(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
int ns_function() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ns_function() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atan(double);
float atanf(float s) { return (float)atan((double)s); }


x86 assembly (clang, -O0):
<atanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <atan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @atan(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @atanf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @atan(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void printd(char *s) {
  while (*s)
    write(1, s++, 1);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <printd+0x39>
mov    -0x8(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    111c <printd+0xc>
mov    $0x1,%edx
lea    0xeab(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113f <printd+0x2f>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1120 <printd+0x10>
lea    0xeba(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = call i32 @write(i32 1, i8* %8, i32 1)
br label %3
11: ; preds = %3
%12 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @printd(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 @write(i32 1, i8* %5, i32 1)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
unsigned long long bar(unsigned long long y) { return 30 / y; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1e,%eax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x1e,%rdi
ja     1110 <bar+0x10>
mov    $0x1e,%eax
xor    %edx,%edx
div    %edi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @bar(i64 %0) {
%2 = udiv i64 30, %0
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ border_width;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_border_width(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->border_width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCreateWindowEvent_border_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCreateWindowEvent_border_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int open(char const *, int /*<<< orphan*/);
int open_pipe(const char *name) {
  int pd;
  pd = open(name, O_WRONLY);
  return pd;
}


x86 assembly (clang, -O0):
<open_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pipe>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @open_pipe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @open_pipe(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
int getNthNumber(int n) {
  if (n == 1 || n == 2)
    return 1;
  int sum;
  sum = getNthNumber(n - 1) + getNthNumber(n - 2);
  return sum;
}


x86 assembly (clang, -O0):
<getNthNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <getNthNumber+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <getNthNumber+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1164 <getNthNumber+0x54>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <getNthNumber@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <getNthNumber@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNthNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <getNthNumber+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <getNthNumber@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <getNthNumber+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getNthNumber(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @getNthNumber(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f() {
  int a[][2] = {1, 2, 3, 4};
  if (!(a[0][0] == 1))
    abort();
  if (!(a[0][1] == 2))
    abort();
  if (!(a[1][0] == 3))
    abort();
  if (!(a[1][1] == 4))
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
je     113f <f+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0x1c(%rbp)
je     1150 <f+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x18(%rbp)
je     1161 <f+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x4,-0x14(%rbp)
je     1172 <f+0x62>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.f.a = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
define i32 @f() {
%1 = alloca i32
%2 = alloca [2 x [2 x i32]]
%3 = bitcast [2 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 2
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %10
%18 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 0
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 3
br i1 %21, label %24, label %22
22: ; preds = %17
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %17
%25 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %25, i64 0, i64 1
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 4
br i1 %28, label %31, label %29
29: ; preds = %24
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %24
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
int get_char_enum(const char *str) { return (int)str[0]; }


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

x86 assembly (clang, -O2):
<get_char_enum>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_char_enum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_char_enum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
int iscdigit(const char c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<iscdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <iscdigit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @iscdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @iscdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int createQueryURL(char const *, int, char const *, char *, int, char const **,
                   char const **, char **);
int createUrlForNnAPPEND(const char *host, int nnPort, const char *path,
                         const char *user, char **url) {
  const char *userPara = "user.name";
  return createQueryURL(host, nnPort, path, "APPEND", 1, &userPara, &user, url);
}


x86 assembly (clang, -O0):
<createUrlForNnAPPEND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
lea    0xebe(%rip),%rcx
mov    $0x1,%r8d
lea    -0x30(%rbp),%r9
lea    -0x20(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <createQueryURL@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createUrlForNnAPPEND>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rcx,0x10(%rsp)
lea    0xedd(%rip),%rcx
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%r10
lea    0xed6(%rip),%rcx
lea    0x8(%rsp),%r9
mov    $0x1,%r8d
push   %rax
push   %r10
call   1030 <createQueryURL@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [7 x i8] c"APPEND\00"
define i32 @createUrlForNnAPPEND(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8**, i8*** %10
%16 = call i32 @createQueryURL(i8* %12, i32 %13, i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %11, i8** %9, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [7 x i8] c"APPEND\00"
define i32 @createUrlForNnAPPEND(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i8*
store i8* %3, i8** %6
%8 = bitcast i8** %7 to i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @createQueryURL(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %7, i8** %6, i8** %4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  ((void)argc);
  ((void)argv);
  printf(
      "POLARSSL_ERROR_C and/or POLARSSL_ERROR_STRERROR_DUMMY not defined.\n");
  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)
lea    0xed3(%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 = [68 x i8] c"POLARSSL_ERROR_C and/or POLARSSL_ERROR_STRERROR_DUMMY not defined.\0A\00"
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [67 x i8] c"POLARSSL_ERROR_C and/or POLARSSL_ERROR_STRERROR_DUMMY not defined.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mce_amd_feature_init(struct cpuinfo_x86 *c) {}


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

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

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

LLVM IR (-O2):
%struct.cpuinfo_x86 = type opaque
define void @mce_amd_feature_init(%struct.cpuinfo_x86* nocapture %0) {
ret void
}
int register_shrinker(struct shrinker *shrinker) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.shrinker = type opaque
define i32 @register_shrinker(%struct.shrinker* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int64_t;

/* Variables and functions */
int64_t complementBit_fun_int64_t(int64_t x, uint32_t i) { return x ^ 1 << i; }


x86 assembly (clang, -O0):
<complementBit_fun_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_int64_t>:
mov    %edi,%eax
btc    %esi,%eax
ret

LLVM IR (-O0):
define i32 @complementBit_fun_int64_t(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @complementBit_fun_int64_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
int test_imm_06uint32_reg(unsigned int val) {
  return ((val) & (0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_06uint32_reg(i32 %0) {
%2 = and i32 %0, 6
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int sigbench_profile_calibrate(void *args) {
  (void)args;
  volatile int i = 1;
  while (i > 0)
    i--;
  return 0;
}


x86 assembly (clang, -O0):
<sigbench_profile_calibrate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1129 <sigbench_profile_calibrate+0x29>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sigbench_profile_calibrate+0xf>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigbench_profile_calibrate>:
movl   $0x1,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jle    111c <sigbench_profile_calibrate+0x1c>
nop
addl   $0xffffffff,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jg     1110 <sigbench_profile_calibrate+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sigbench_profile_calibrate(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, -1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret i32 0
}
void CSAMR3IsEnabled(void) {}


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

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

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

LLVM IR (-O2):
define void @CSAMR3IsEnabled() {
ret void
}
void __attribute__((unused)) ffi_cparser_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ffi_cparser_init() {
ret void
}
int bm_colcmp(unsigned int c1, unsigned int c2) {
  return (c1 & 0xFFFFFF) == (c2 & 0xFFFFFF);
}


x86 assembly (clang, -O0):
<bm_colcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    -0x8(%rbp),%ecx
and    $0xffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_colcmp>:
xor    %esi,%edi
xor    %eax,%eax
test   $0xffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bm_colcmp(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 = and i32 %5, 16777215
%7 = load i32, i32* %4
%8 = and i32 %7, 16777215
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bm_colcmp(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %3, 16777215
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_UNLCK;
int /*<<< orphan*/ set_flock(int, int /*<<< orphan*/, int /*<<< orphan*/);
void unlock_shm_doublebuffer(int index) {
  (set_flock(index, F_UNLCK, F_SETLKW));
}


x86 assembly (clang, -O0):
<unlock_shm_doublebuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
call   1030 <set_flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_shm_doublebuffer>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <set_flock@plt>

LLVM IR (-O0):
@F_UNLCK = global i32 0
@F_SETLKW = global i32 0
define void @unlock_shm_doublebuffer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_UNLCK
%5 = load i32, i32* @F_SETLKW
%6 = call i32 @set_flock(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@F_UNLCK = global i32 0
@F_SETLKW = global i32 0
define void @unlock_shm_doublebuffer(i32 %0) {
%2 = load i32, i32* @F_UNLCK
%3 = load i32, i32* @F_SETLKW
%4 = tail call i32 @set_flock(i32 %0, i32 %2, i32 %3)
ret void
}
void pthread_rwlock_wrlock() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlock_wrlock() {
ret void
}
int test_imm_DFuint16_reg(unsigned short val) {
  return ((val) & (-0xDF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DFuint16_reg>:
test   $0xff21,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DFuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -223
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int rand();
int level_gen(int level) {
  int levels = -1;
  int random = 0;
  do {
    levels++;
    random = rand() % 3;
  } while (random && levels <= level);
  return levels;
}


x86 assembly (clang, -O0):
<level_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     115f <level_gen+0x4f>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1129 <level_gen+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level_gen>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
lea    0x1(%rbx),%ebp
xor    %eax,%eax
call   1030 <rand@plt>
imul   $0xaaaaaaab,%eax,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
jb     1143 <level_gen+0x33>
cmp    %r14d,%ebx
mov    %ebp,%ebx
jl     1120 <level_gen+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @level_gen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 3
store i32 %9, i32* %4
br label %10
10: ; preds = %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br label %17
17: ; preds = %13, %10
%18 = phi i1 [ false, %10 ], [ %16, %13 ]
br i1 %18, label %5, label %19
19: ; preds = %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @level_gen(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ -1, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 3
%7 = icmp ne i32 %6, 0
%8 = icmp slt i32 %3, %0
%9 = select i1 %7, i1 %8, i1 false
br i1 %9, label %2, label %10
10: ; preds = %2
ret i32 %4
}
int g(_Bool b2) { return b2 > 3; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x3,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
%7 = icmp sgt i32 %6, 3
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g(i1 zeroext %0) {
ret i32 0
}