xunge/DecIR huggingface dataset:
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
scalar_t__ statfs(char *, struct statfs *);
int check_proc() {
  struct statfs mnt;
  if (statfs("/proc", &mnt) < 0)
    return 0;
  if (mnt.f_type != 0x9fa0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <statfs@plt>
cmp    $0x0,%rax
jge    113e <check_proc+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115e <check_proc+0x4e>
cmpl   $0x9fa0,-0x8(%rbp)
je     1157 <check_proc+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115e <check_proc+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_proc>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
test   %rax,%rax
setns  %al
cmpl   $0x9fa0,(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [6 x i8] c"/proc\00"
define i32 @check_proc() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i64 @statfs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = icmp sgt i64 %3, -1
%5 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 40864
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
void foo124() {}


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

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

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

LLVM IR (-O2):
define void @foo124() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int bytes_ready(int fd) {
  int n;
  (void)ioctl(fd, FIONREAD, &n);
  return n;
}


x86 assembly (clang, -O0):
<bytes_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_ready>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @bytes_ready(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ irc_islower(int);
scalar_t__ irc_isupper(int);
int irc_isalpha(int c) { return irc_islower(c) || irc_isupper(c); }


x86 assembly (clang, -O0):
<irc_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <irc_islower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <irc_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <irc_isupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <irc_islower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <irc_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <irc_isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @irc_isalpha(i32 %0) {
%2 = tail call i64 @irc_islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @irc_isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int close(int);
int MAXDisconnect(int connectionId) { return close(connectionId); }


x86 assembly (clang, -O0):
<MAXDisconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAXDisconnect>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @MAXDisconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *thread_proc(void *arg) {
  abort();
  return arg;
}


x86 assembly (clang, -O0):
<thread_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<thread_proc>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @thread_proc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i8* @thread_proc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ EvenlyDivisibleBy(int, long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  int max = 0;
  long int value = 1;
  while (true) {
    if (EvenlyDivisibleBy(20, value)) {
      printf("%ld is evenly divisible by 20\n", value);
      return EXIT_SUCCESS;
    } else {
      value++;
    }
  }
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x14,%edi
call   1040 <EvenlyDivisibleBy@plt>
cmp    $0x0,%rax
je     1175 <main+0x55>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <main+0x1e>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
mov    $0x14,%edi
mov    %rbx,%rsi
call   1040 <EvenlyDivisibleBy@plt>
test   %rax,%rax
je     1130 <main+0x10>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%ld is evenly divisible by 20\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 1, i64* %3
br label %4
4: ; preds = %0, %15
%5 = load i64, i64* %3
%6 = call i64 @EvenlyDivisibleBy(i32 20, i64 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
12: ; preds = %4
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12
br label %4
}

LLVM IR (-O2):
@.str = [31 x i8] c"%ld is evenly divisible by 20\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i64 @EvenlyDivisibleBy(i32 20, i64 %2)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i64 %2, 1
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %2)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
int /*<<< orphan*/ error(char *, int);
void version(void) {
  char *versionstr;
  asprintf(&versionstr, "spicctrld %s", "0.2, Nov 3, 2002");
  error(versionstr, 1);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
lea    0xed3(%rip),%rdx
call   1030 <asprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xede(%rip),%rdx
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
call   1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"spicctrld %s\00"
@.str.1 = [17 x i8] c"0.2, Nov 3, 2002\00"
define void @version() {
%1 = alloca i8*
%2 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 @error(i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"spicctrld %s\00"
@.str.1 = [17 x i8] c"0.2, Nov 3, 2002\00"
define void @version() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @error(i8* %4, i32 1)
ret void
}
/* Variables and functions */
char *ppmM_alloc(size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *ppmM_strdup(const char *string) {
  char *copy;
  size_t len = strlen(string);
  copy = ppmM_alloc(len + 1);
  strncpy(copy, string, len);
  copy[len] = '\0';
  return copy;
}


x86 assembly (clang, -O0):
<ppmM_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <ppmM_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppmM_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <ppmM_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ppmM_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @ppmM_alloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @ppmM_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @ppmM_alloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int chdir(char const *);
__attribute__((__weak__, __always___)) int
softboundmpx_chdir(const char *path) {
  return chdir(path);
}


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

x86 assembly (clang, -O2):
<softboundmpx_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
unsigned short m64p_swap16(unsigned short x) {
  return ((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<m64p_swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m64p_swap16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @m64p_swap16(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, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @m64p_swap16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, GitHub!");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, GitHub!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int factorial(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", factorial(9, 1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
mov    $0x1,%esi
call   1030 <factorial@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 9, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void IRC_OnChannelOp(const struct instance_data *pID,
                     const struct userinfo *pUI, const char *szChannel,
                     const char *szTargetNick) {}


x86 assembly (clang, -O0):
<IRC_OnChannelOp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelOp(%struct.instance_data* %0, %struct.userinfo* %1, i8* %2, i8* %3) {
%5 = alloca %struct.instance_data*
%6 = alloca %struct.userinfo*
%7 = alloca i8*
%8 = alloca i8*
store %struct.instance_data* %0, %struct.instance_data** %5
store %struct.userinfo* %1, %struct.userinfo** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelOp(%struct.instance_data* nocapture %0, %struct.userinfo* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int netUrlOpenSockets(char *, int /*<<< orphan*/ *);
int netUrlOpen(char *url) { return netUrlOpenSockets(url, NULL); }


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

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

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

LLVM IR (-O2):
define i32 @netUrlOpen(i8* %0) {
%2 = tail call i32 @netUrlOpenSockets(i8* %0, i32* null)
ret i32 %2
}
int get_alphabet_index_single(char *alphabet, char letter, int a_size) {
  int a_index;
  for (a_index = 0; a_index < a_size; a_index++) {
    if (letter == *alphabet) {
      return a_index;
    }
    alphabet++;
    alphabet++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_alphabet_index_single>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1168 <get_alphabet_index_single+0x68>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1142 <get_alphabet_index_single+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <get_alphabet_index_single+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <get_alphabet_index_single+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_alphabet_index_single>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <get_alphabet_index_single+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,(%rdi,%rcx,2)
je     111f <get_alphabet_index_single+0x1f>
add    $0x1,%rcx
cmp    %ecx,%edx
jne    1110 <get_alphabet_index_single+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_alphabet_index_single(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %12, %10 ], [ 0, %3 ]
%7 = phi i8* [ %11, %10 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 2
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %3
%15 = phi i32 [ -1, %3 ], [ -1, %10 ], [ %6, %5 ]
ret i32 %15
}
/* Variables and functions */
int random();
int /*<<< orphan*/ srandom(int);
int time(int /*<<< orphan*/ *);
int getDuration() {
  srandom(time(NULL) * random());
  return random() % (5 + 1 - 1) + 1;
}


x86 assembly (clang, -O0):
<getDuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x4(%rbp),%edi
imul   %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDuration>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <random@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getDuration() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @random()
%3 = mul nsw i32 %1, %2
%4 = call i32 @srandom(i32 %3)
%5 = call i32 (...) @random()
%6 = srem i32 %5, 5
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @getDuration() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @random()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @srandom(i32 %3)
%5 = tail call i32 (...) @random()
%6 = srem i32 %5, 5
%7 = add nsw i32 %6, 1
ret i32 %7
}
void fc109(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    goto a;
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


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

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

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

LLVM IR (-O2):
define void @fc109(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRSETBKCOLOR_swap(char *record, int torev) {
  core5_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSETBKCOLOR_swap>:
jmp    1030 <core5_swap@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @test2_bar() {
ret void
}
void outer_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_restart() {
ret void
}
/* Variables and functions */
int fsync(int);
int fdatasync(int fd) { return fsync(fd); }


x86 assembly (clang, -O0):
<fdatasync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fsync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdatasync>:
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define i32 @fdatasync(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int minuscci(unsigned int a, unsigned int b) {
  unsigned int difference = a - b;
  if (difference > a)
    abort();
  return difference;
}


x86 assembly (clang, -O0):
<minuscci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    113a <minuscci+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscci>:
sub    %esi,%edi
jb     1117 <minuscci+0x7>
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @minuscci(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp ugt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @minuscci(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = sub i32 %0, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int called;
int /*<<< orphan*/ printf(char *);
f() {
  static called;
  if (!called) {
    called = 1;
    printf("f()\n");
    return 5;
  }
  abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    114e <f+0x2e>
movl   $0x1,0x2ef9(%rip)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%eax
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    1144 <f+0x24>
movb   $0x1,0x2f03(%rip)
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x5,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@f.called = internal global i32 0
@.str = [5 x i8] c"f()\0A\00"
@called = global i32 0
define i32 @f() {
%1 = load i32, i32* @f.called
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
store i32 1, i32* @f.called
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@f.called = internal unnamed_addr global i1 false
@called = global i32 0
@str = [4 x i8] c"f()\00"
define i32 @f() {
%1 = load i1, i1* @f.called
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @f.called
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 5
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ isspace(char);
unsigned int strlen(char *);
void trim_right(char *szString) {
  unsigned int i = strlen(szString);
  while (isspace(szString[--i]))
    ;
  szString[i + 1] = 0;
}


x86 assembly (clang, -O0):
<trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     115f <trim_right+0x3f>
jmp    1138 <trim_right+0x18>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_right>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <isspace@plt>
add    $0xffffffff,%ebx
test   %rax,%rax
jne    1140 <trim_right+0x20>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @trim_right(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %2, %1 ], [ %5, %3 ]
%5 = add i32 %4, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = zext i32 %4 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cleanup_ipmidetect();
int /*<<< orphan*/ _cmdline_parse(int, char **);
int /*<<< orphan*/ _init_ipmidetect();
int _output_data();
int /*<<< orphan*/ err_init(char *);
int /*<<< orphan*/ err_set_flags(int);
int /*<<< orphan*/ exit(int);
int main(int argc, char *argv[]) {
  int exit_val;
  err_init(argv[0]);
  err_set_flags(0x0002);
  _init_ipmidetect();
  _cmdline_parse(argc, argv);
  exit_val = _output_data();
  _cleanup_ipmidetect();
  exit(exit_val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <err_init@plt>
mov    $0x2,%edi
call   1070 <err_set_flags@plt>
mov    $0x0,%al
call   1030 <_init_ipmidetect@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <_cmdline_parse@plt>
mov    $0x0,%al
call   1090 <_output_data@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <_cleanup_ipmidetect@plt>
mov    -0x14(%rbp),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1050 <err_init@plt>
mov    $0x2,%edi
call   1070 <err_set_flags@plt>
xor    %eax,%eax
call   1030 <_init_ipmidetect@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <_cmdline_parse@plt>
xor    %eax,%eax
call   1090 <_output_data@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <_cleanup_ipmidetect@plt>
mov    %ebx,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @err_init(i8* %9)
%11 = call i32 @err_set_flags(i32 2)
%12 = call i32 (...) @_init_ipmidetect()
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @_cmdline_parse(i32 %13, i8** %14)
%16 = call i32 (...) @_output_data()
store i32 %16, i32* %6
%17 = call i32 (...) @_cleanup_ipmidetect()
%18 = load i32, i32* %6
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @err_init(i8* %3)
%5 = tail call i32 @err_set_flags(i32 2)
%6 = tail call i32 (...) @_init_ipmidetect()
%7 = tail call i32 @_cmdline_parse(i32 %0, i8** %1)
%8 = tail call i32 (...) @_output_data()
%9 = tail call i32 (...) @_cleanup_ipmidetect()
%10 = tail call i32 @exit(i32 %8)
unreachable
}
void rwsem_set_reader_owned(struct rw_semaphore *sem) {}


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

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

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

LLVM IR (-O2):
%struct.rw_semaphore = type opaque
define void @rwsem_set_reader_owned(%struct.rw_semaphore* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gc_free_page_memory(void *ptr, int size) { free(ptr); }


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

x86 assembly (clang, -O2):
<gc_free_page_memory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gc_free_page_memory(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spin();
unsigned long inc_addr(unsigned long val) {
  spin();
  return val + sizeof(unsigned long);
}


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

x86 assembly (clang, -O2):
<inc_addr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <spin@plt>
add    $0x8,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @inc_addr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @spin()
%4 = load i64, i64* %2
%5 = add i64 %4, 8
ret i64 %5
}

LLVM IR (-O2):
define i64 @inc_addr(i64 %0) {
%2 = tail call i32 (...) @spin()
%3 = add i64 %0, 8
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void initRandom() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<initRandom>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRandom>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @initRandom() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initRandom() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
int is_power_of_2_i(int n) { return (n & (n - 1)) == 0; }


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

x86 assembly (clang, -O2):
<is_power_of_2_i>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_2_i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_power_of_2_i(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void enable_servo_interrupt(void) {
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x010))) = 0x20;
}


x86 assembly (clang, -O0):
<enable_servo_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff010,%eax
movq   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_servo_interrupt>:
mov    $0xfffff010,%eax
movq   $0x20,(%rax)
ret

LLVM IR (-O0):
define void @enable_servo_interrupt() {
store volatile i64 32, i64* inttoptr (i64 4294963216 to i64*)
ret void
}

LLVM IR (-O2):
define void @enable_servo_interrupt() {
store volatile i64 32, i64* inttoptr (i64 4294963216 to i64*)
ret void
}
/* Variables and functions */
int unlock_common(char const *, int);
int maillock_write_unlock(const char *filename, int fd) {
  return unlock_common(filename, fd);
}


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

x86 assembly (clang, -O2):
<maillock_write_unlock>:
jmp    1030 <unlock_common@plt>

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

LLVM IR (-O2):
define i32 @maillock_write_unlock(i8* %0, i32 %1) {
%3 = tail call i32 @unlock_common(i8* %0, i32 %1)
ret i32 %3
}
int oigit(int c) { return '0' <= c && c <= '7'; }


x86 assembly (clang, -O0):
<oigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <oigit+0x24>
cmpl   $0x37,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oigit>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @oigit(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int isdigit(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  else
    return 0;
}


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

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

LLVM IR (-O0):
define i32 @isdigit(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 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int DIV_ASSIGN(int x, int y) { return x /= y; }


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

x86 assembly (clang, -O2):
<DIV_ASSIGN>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @DIV_ASSIGN(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void null_progend(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @tag_unreg() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int tl1_execute_dump(int rows, char *fields[]) {
  while (rows) {
    printf("  %d: '%s'\n", rows, fields[rows - 1]);
    rows--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tl1_execute_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <tl1_execute_dump+0x47>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <tl1_execute_dump+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl1_execute_dump>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1146 <tl1_execute_dump+0x36>
mov    %edi,%ebp
movslq %edi,%rax
lea    (%rsi,%rax,8),%rbx
add    $0xfffffffffffffff8,%rbx
lea    0xed4(%rip),%r14
nopl   0x0(%rax)
mov    (%rbx),%rdx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xfffffffffffffff8,%rbx
add    $0xffffffff,%ebp
jne    1130 <tl1_execute_dump+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c" %d: '%s'\0A\00"
define i32 @tl1_execute_dump(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i8**, i8*** %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c" %d: '%s'\0A\00"
define i32 @tl1_execute_dump(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %7 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = trunc i64 %8 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ post(char);
int /*<<< orphan*/ puts(char *);
void live() {
  puts("\nYou win!");
  post('!');
  exit(0);
}


x86 assembly (clang, -O0):
<live>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x21,%edi
call   1040 <post@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<live>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x21,%edi
call   1040 <post@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0AYou win!\00"
define void @live() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @post(i8 signext 33)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AYou win!\00"
define void @live() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @post(i8 signext 33)
%3 = tail call i32 @exit(i32 0)
unreachable
}
float mod2(float a) { return a - (float)((int)(a / 2) * 2); }


x86 assembly (clang, -O0):
<mod2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xee5(%rip),%xmm2
divss  %xmm2,%xmm1
cvttss2si %xmm1,%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mod2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fdiv float %4, 2.000000e+00
%6 = fptosi float %5 to i32
%7 = mul nsw i32 %6, 2
%8 = sitofp i32 %7 to float
%9 = fsub float %3, %8
ret float %9
}

LLVM IR (-O2):
define float @mod2(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = fptosi float %2 to i32
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to float
%6 = fsub float %0, %5
ret float %6
}