xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ my_fatal(char *, char *, int);
int /*<<< orphan*/ piece_is_ok(int);
int piece_colour(int piece) {
  {
    if (!(piece_is_ok(piece)))
      my_fatal("file \"%s\", line %d, assertion \""
               "piece_is_ok(piece)"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/piece.c",
               79);
  };
  return piece & 3;
}


x86 assembly (clang, -O0):
<piece_colour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <piece_is_ok@plt>
cmp    $0x0,%eax
jne    1154 <piece_colour+0x34>
lea    0xebd(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x4f,%edx
call   1040 <my_fatal@plt>
mov    -0x4(%rbp),%eax
and    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_colour>:
push   %rbx
mov    %edi,%ebx
call   1030 <piece_is_ok@plt>
test   %eax,%eax
jne    1144 <piece_colour+0x24>
lea    0xecd(%rip),%rdi
lea    0xf01(%rip),%rsi
mov    $0x4f,%edx
call   1040 <my_fatal@plt>
and    $0x3,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"file \22%s\22, line %d, assertion \22piece_is_ok(piece)\22 failed\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/piece.c\00"
define i32 @piece_colour(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @piece_is_ok(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @my_fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 79)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 3
ret i32 %10
}

LLVM IR (-O2):
@.str = [59 x i8] c"file \22%s\22, line %d, assertion \22piece_is_ok(piece)\22 failed\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/piece.c\00"
define i32 @piece_colour(i32 %0) {
%2 = tail call i32 @piece_is_ok(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @my_fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 79)
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 3
ret i32 %7
}
void foob() {}


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

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

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

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

/* Variables and functions */
int64_t __attribute__((const)) lw6sys_llmax(int64_t a, int64_t b) {
  return (a > b) ? a : b;
}


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

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

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

LLVM IR (-O2):
define i64 @lw6sys_llmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
long function(char test[]) { return (long)test; }


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

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

LLVM IR (-O0):
define i64 @function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @function(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
char *oauth_sign_hmac_sha1_raw(char const *, int /*<<< orphan*/, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *oauth_sign_hmac_sha1(const char *m, const char *k) {
  return oauth_sign_hmac_sha1_raw(m, strlen(m), k, strlen(k));
}


x86 assembly (clang, -O0):
<oauth_sign_hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
call   1040 <oauth_sign_hmac_sha1_raw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_sign_hmac_sha1>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <oauth_sign_hmac_sha1_raw@plt>

LLVM IR (-O0):
define i8* @oauth_sign_hmac_sha1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i8* @oauth_sign_hmac_sha1_raw(i8* %5, i32 %7, i8* %8, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @oauth_sign_hmac_sha1(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i8* @oauth_sign_hmac_sha1_raw(i8* %0, i32 %3, i8* %1, i32 %4)
ret i8* %5
}
void INT_Excep_ELC_ELSR19I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ELC_ELSR19I() {
ret void
}
void VC_Exit(void) {}


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

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

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

LLVM IR (-O2):
define void @VC_Exit() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int get_int32_le(const uint8_t *buffer) {
  uint32_t n;
  n = (buffer[3] << 24) | (buffer[2] << 16) | (buffer[1] << 8) | buffer[0];
  return n;
}


x86 assembly (clang, -O0):
<get_int32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int32_le>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_int32_le(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = or i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_int32_le(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %0
%14 = or i32 %12, %13
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void scc_get_compiled_version(uint32_t *const out_major,
                              uint32_t *const out_minor,
                              uint32_t *const out_patch) {
  if (out_major != NULL)
    *out_major = 0;
  if (out_minor != NULL)
    *out_minor = 1;
  if (out_patch != NULL)
    *out_patch = 1;
}


x86 assembly (clang, -O0):
<scc_get_compiled_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <scc_get_compiled_version+0x25>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113a <scc_get_compiled_version+0x3a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     114f <scc_get_compiled_version+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scc_get_compiled_version>:
test   %rdi,%rdi
je     110b <scc_get_compiled_version+0xb>
movl   $0x0,(%rdi)
test   %rsi,%rsi
je     1116 <scc_get_compiled_version+0x16>
movl   $0x1,(%rsi)
test   %rdx,%rdx
je     1121 <scc_get_compiled_version+0x21>
movl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @scc_get_compiled_version(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %6
store i32 1, i32* %1
br label %9
9: ; preds = %8, %6
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 1, i32* %2
br label %12
12: ; preds = %11, %9
ret void
}
int board_is_valid_size(const int board_size) {
  if (board_size == 3 || board_size == 6 || board_size == 9 ||
      board_size == 12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<board_is_valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     112f <board_is_valid_size+0x2f>
cmpl   $0x6,-0x8(%rbp)
je     112f <board_is_valid_size+0x2f>
cmpl   $0x9,-0x8(%rbp)
je     112f <board_is_valid_size+0x2f>
cmpl   $0xc,-0x8(%rbp)
jne    113b <board_is_valid_size+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <board_is_valid_size+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_is_valid_size>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     1117 <board_is_valid_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.board_is_valid_size = [10 x i32] [i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1]
define i32 @board_is_valid_size(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.board_is_valid_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/);
int /*<<< orphan*/ g(int /*<<< orphan*/);
void main(int i) {
  f(0);
  if (1) {
    g(0);
  }
  g(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <g@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32 0)
%4 = call i32 @g(i32 0)
%5 = call i32 @g(i32 0)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @f(i32 0)
%3 = tail call i32 @g(i32 0)
%4 = tail call i32 @g(i32 0)
ret void
}
void IRC_OnChannelUnban(const struct instance_data *pID,
                        const struct userinfo *pUI, const char *szChannel,
                        const char *szHostmask) {}


x86 assembly (clang, -O0):
<IRC_OnChannelUnban>:
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_OnChannelUnban>:
ret

LLVM IR (-O0):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelUnban(%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_OnChannelUnban(%struct.instance_data* nocapture %0, %struct.userinfo* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned short minusccs(unsigned short a, unsigned short b) {
  unsigned short difference = a - b;
  if (difference > a)
    abort();
  return difference;
}


x86 assembly (clang, -O0):
<minusccs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    114b <minusccs+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minusccs>:
cmp    %si,%di
jb     111a <minusccs+0xa>
sub    %esi,%edi
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define zeroext i16 @minusccs(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = icmp sgt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
%20 = load i16, i16* %5
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @minusccs(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ult i16 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = sub i16 %0, %1
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *argv[]) {
  fprintf(stderr,
          "%s: [-b blocksize] [-t max usec] [-w separate writer] -f file\n",
          argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"%s: [-b blocksize] [-t max usec] [-w separate writer] -f file\0A\00"
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"%s: [-b blocksize] [-t max usec] [-w separate writer] -f file\0A\00"
define i32 @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void check(bool ok) {
  if (ok)
    return;
  exit(1);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112b <check+0x1b>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1115 <check+0x5>
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
ret void
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  printf("!!! Shutting Down !!!\n");
  system("/sbin/shutdown -h now");
  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    0xec3(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"!!! Shutting Down !!!\0A\00"
@.str.1 = [22 x i8] c"/sbin/shutdown -h now\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 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"/sbin/shutdown -h now\00"
@str = [22 x i8] c"!!! Shutting Down !!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ system(char *);
char quitWithError() {
  system("clear");
  perror("\nUnexpected user input. Quitting . . . \n");
  return 'q';
}


x86 assembly (clang, -O0):
<quitWithError>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x71,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitWithError>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
lea    0xed2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x71,%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [41 x i8] c"\0AUnexpected user input. Quitting . . . \0A\00"
define signext i8 @quitWithError() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i8 113
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [41 x i8] c"\0AUnexpected user input. Quitting . . . \0A\00"
define signext i8 @quitWithError() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i8 113
}
int fastfloor(float x) {
  int ix = (int)x;
  return ix - (ix > x);
}


x86 assembly (clang, -O0):
<fastfloor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ssl -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastfloor>:
cvttss2si %xmm0,%eax
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fastfloor(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = load float, float* %2
%10 = fcmp ogt float %8, %9
%11 = zext i1 %10 to i32
%12 = sub nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fastfloor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp ogt float %3, %0
%5 = sext i1 %4 to i32
%6 = add i32 %5, %2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int start_command(char *, int /*<<< orphan*/ *, int, int, char *, char *,
                  char *);
int wait_command(int);
int run_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0,
                char *a1, char *a2) {
  int pid;
  if ((pid = start_command(cmd, mask, infd, outfd, a0, a1, a2)) < 0)
    return -1;
  return wait_command(pid);
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <start_command@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
jge    117d <run_command+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <run_command+0x68>
mov    -0x34(%rbp),%edi
call   1040 <wait_command@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rax
mov    0x10(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <start_command@plt>
test   %eax,%eax
js     113b <run_command+0x1b>
mov    %eax,%edi
pop    %rax
jmp    1040 <wait_command@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @run_command(i8* %0, i32* %1, i32 %2, i32 %3, i8* %4, i8* %5, i8* %6) {
%8 = tail call i32 @start_command(i8* %0, i32* %1, i32 %2, i32 %3, i8* %4, i8* %5, i8* %6)
%9 = icmp slt i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @wait_command(i32 %8)
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ -1, %7 ]
ret i32 %13
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *input = "LEETCODEISHIRING";
  int num = 3;
  char *ret = convert(input, num);
  printf("%s\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <convert@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1030 <convert@plt>
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"LEETCODEISHIRING\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 3, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i8* @convert(i8* %5, i32 %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"LEETCODEISHIRING\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @convert(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ *pw_name;
  int /*<<< orphan*/ *pw_passwd;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void freepw(struct passwd *pw) {
  if (pw->pw_passwd) {
    free(pw->pw_passwd);
    pw->pw_passwd = NULL;
  }
  free(pw->pw_name);
}


x86 assembly (clang, -O0):
<freepw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1144 <freepw+0x34>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freepw>:
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
je     112a <freepw+0x1a>
call   1030 <free@plt>
movq   $0x0,0x8(%rbx)
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.passwd = type { i32*, i32* }
define void @freepw(%struct.passwd* %0) {
%2 = alloca %struct.passwd*
store %struct.passwd* %0, %struct.passwd** %2
%3 = load %struct.passwd*, %struct.passwd** %2
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %3, i32 0, i32 1
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %8, i32 0, i32 1
%10 = load i32*, i32** %9
%11 = call i32 @free(i32* %10)
%12 = load %struct.passwd*, %struct.passwd** %2
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %12, i32 0, i32 1
store i32* null, i32** %13
br label %14
14: ; preds = %7, %1
%15 = load %struct.passwd*, %struct.passwd** %2
%16 = getelementptr inbounds %struct.passwd, %struct.passwd* %15, i32 0, i32 0
%17 = load i32*, i32** %16
%18 = call i32 @free(i32* %17)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32*, i32* }
define void @freepw(%struct.passwd* nocapture %0) {
%2 = getelementptr inbounds %struct.passwd, %struct.passwd* %0, i64 0, i32 1
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i32* %3)
store i32* null, i32** %2
br label %7
7: ; preds = %5, %1
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %0, i64 0, i32 0
%9 = load i32*, i32** %8
%10 = tail call i32 @free(i32* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
char *simplifyPath(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: ./test path\n");
    exit(-1);
  }
  printf("%s\n", simplifyPath(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <simplifyPath@plt>
mov    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1162 <main+0x22>
mov    0x8(%rsi),%rdi
call   1030 <simplifyPath@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: ./test path\0A\00"
@.str.1 = [4 x i8] c"%s\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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @simplifyPath(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: ./test path\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i8* @simplifyPath(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}
/* Variables and functions */
double exp(double);
double log(double);
double pow(double a, double x) { return exp(x * log(a)); }


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @log(double %6)
%8 = fmul double %5, %7
%9 = call double @exp(double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SINGLERESP;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SINGLERESP_it;
int i2d_OCSP_SINGLERESP(OCSP_SINGLERESP *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_SINGLERESP_it);
}


x86 assembly (clang, -O0):
<i2d_OCSP_SINGLERESP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_OCSP_SINGLERESP>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@OCSP_SINGLERESP_it = global i32 0
define i32 @i2d_OCSP_SINGLERESP(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_SINGLERESP_it)
ret i32 %3
}
/* Type definitions */
struct fio_ctx {
  int dummy;
};

/* Variables and functions */
struct fio_ctx *fio_ctx_new(size_t capacity __attribute__((unused))) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fio_ctx = type { i32 }
define %struct.fio_ctx* @fio_ctx_new(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret %struct.fio_ctx* null
}

LLVM IR (-O2):
%struct.fio_ctx = type { i32 }
define noalias %struct.fio_ctx* @fio_ctx_new(i64 %0) {
ret %struct.fio_ctx* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int _stdout_hook(int);
int /*<<< orphan*/ *stdout;
int fputc(int c, FILE *stream) {
  return (stdout == stream) ? _stdout_hook(c) : EOF;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1143 <fputc+0x33>
mov    -0x4(%rbp),%edi
call   1030 <_stdout_hook@plt>
mov    %eax,-0x14(%rbp)
jmp    114f <fputc+0x3f>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
mov    0x2ec1(%rip),%rax
cmp    %rsi,(%rax)
je     1126 <fputc+0x16>
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
ret
jmp    1030 <_stdout_hook@plt>

LLVM IR (-O0):
@stdout = global i32* null
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** %4
%7 = icmp eq i32* %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @_stdout_hook(i32 %9)
br label %13
11: ; preds = %2
%12 = load i32, i32* @EOF
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
@stdout = global i32* null
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* nocapture readnone %1) {
%3 = load i32*, i32** @stdout
%4 = icmp eq i32* %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @_stdout_hook(i32 %0)
br label %9
7: ; preds = %2
%8 = load i32, i32* @EOF
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
unsigned char xchg_8(void *ptr, unsigned char x) {
  asm volatile("xchgb %0,%1"
               : "=r"(x)
               : "m"(*(volatile unsigned char *)ptr), "0"(x)
               : "memory");
  return x;
}


x86 assembly (clang, -O0):
<xchg_8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x9(%rbp),%al
xchg   %al,(%rcx)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xchg_8>:
mov    %esi,%eax
xchg   %al,(%rdi)
ret

LLVM IR (-O0):
define zeroext i8 @xchg_8(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i8 asm sideeffect "xchgb $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %5, i8 %6)
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @xchg_8(i8* %0, i8 zeroext %1) {
%3 = tail call i8 asm sideeffect "xchgb $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8 %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_assignment() { write("msproject.xml", "<Assignment>\n", NULL); }


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

x86 assembly (clang, -O2):
<pre_assignment>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [14 x i8] c"<Assignment>\0A\00"
define void @pre_assignment() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [14 x i8] c"<Assignment>\0A\00"
define void @pre_assignment() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int func6b(int);
__attribute__((gnu_)) __attribute__((always_)) int func6a(int x) {
  return func6b(x * 17);
}


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

x86 assembly (clang, -O2):
<func6a>:
mov    %edi,%eax
shl    $0x4,%eax
add    %eax,%edi
jmp    1030 <func6b@plt>

LLVM IR (-O0):
define i32 @func6a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 17
%5 = call i32 @func6b(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func6a(i32 %0) {
%2 = mul nsw i32 %0, 17
%3 = tail call i32 @func6b(i32 %2)
ret i32 %3
}
void DPMSGetVersion() {}


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

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

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

LLVM IR (-O2):
define void @DPMSGetVersion() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int splitchr(char *str, char sep) {
  char *next;
  char *buf = str;
  int nbel = 0;
  while ((next = strchr(buf, sep)) != NULL) {
    nbel++;
    buf = next;
    buf[0] = '\0';
    buf++;
  }
  return nbel;
}


x86 assembly (clang, -O0):
<splitchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1175 <splitchr+0x65>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1131 <splitchr+0x21>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <splitchr+0x39>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <splitchr+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @splitchr(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
store i8 0, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
void wl_close(void) {}


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

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

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

LLVM IR (-O2):
define void @wl_close() {
ret void
}
/* Type definitions */
struct MqttBuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MqttBuffer_Reset(struct MqttBuffer *);
void MqttBuffer_Destroy(struct MqttBuffer *buf) { MqttBuffer_Reset(buf); }


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

x86 assembly (clang, -O2):
<MqttBuffer_Destroy>:
jmp    1030 <MqttBuffer_Reset@plt>

LLVM IR (-O0):
%struct.MqttBuffer = type { i32 }
define void @MqttBuffer_Destroy(%struct.MqttBuffer* %0) {
%2 = alloca %struct.MqttBuffer*
store %struct.MqttBuffer* %0, %struct.MqttBuffer** %2
%3 = load %struct.MqttBuffer*, %struct.MqttBuffer** %2
%4 = call i32 @MqttBuffer_Reset(%struct.MqttBuffer* %3)
ret void
}

LLVM IR (-O2):
%struct.MqttBuffer = type { i32 }
define void @MqttBuffer_Destroy(%struct.MqttBuffer* %0) {
%2 = tail call i32 @MqttBuffer_Reset(%struct.MqttBuffer* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ time(int /*<<< orphan*/ *);
void start_counting(FILE *fd) {
  time_t tnow = time(NULL);
  fseek(fd, 0, SEEK_END);
  fprintf(fd, "%i\n", (int)tnow);
}


x86 assembly (clang, -O0):
<start_counting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_counting>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%r14
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
@.str = [4 x i8] c"%i\0A\00"
define void @start_counting(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = call i64 @time(i32* null)
store i64 %4, i64* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* @SEEK_END
%7 = call i32 @fseek(i32* %5, i32 0, i32 %6)
%8 = load i32*, i32** %2
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
%11 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@.str = [4 x i8] c"%i\0A\00"
define void @start_counting(i32* nocapture %0) {
%2 = tail call i64 @time(i32* null)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = trunc i64 %2 to i32
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void FLASHSMI_IRQHandler(void) {}


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

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

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

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