xunge/DecIR huggingface dataset:
int frames(s)
int s;
{
  if (s - 1 + 5 > 20) {
    error(3);
  } else {
    return (s - 1 + 5);
  }
}


x86 assembly (clang, -O0):
<frames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    $0x5,%eax
cmp    $0x14,%eax
jle    113e <frames+0x2e>
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <error@plt>
jmp    114a <frames+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frames>:
cmp    $0x11,%edi
jl     1127 <frames+0x17>
push   %rax
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <error@plt>
add    $0x8,%rsp
ret
mov    %edi,%eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @frames(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sub nsw i32 %4, 1
%6 = add nsw i32 %5, 5
%7 = icmp sgt i32 %6, 20
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 3)
br label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = add nsw i32 %12, 5
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @frames(i32 %0) {
%2 = icmp sgt i32 %0, 16
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 3)
br label %7
5: ; preds = %1
%6 = add nsw i32 %0, 4
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ undef, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ emit_string(char *);
void event_rep2() { emit_string(" [2"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c" [2\00"
define void @event_rep2() {
%1 = call i32 @emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" [2\00"
define void @event_rep2() {
%1 = tail call i32 @emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simple_check(int);
void failure_on_both_branches(int x) {
  if (x > 3) {
    simple_check(x);
  } else {
    simple_check(42);
  }
}


x86 assembly (clang, -O0):
<failure_on_both_branches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    1132 <failure_on_both_branches+0x22>
mov    -0x4(%rbp),%edi
call   1030 <simple_check@plt>
jmp    113c <failure_on_both_branches+0x2c>
mov    $0x2a,%edi
call   1030 <simple_check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failure_on_both_branches>:
cmp    $0x4,%edi
mov    $0x2a,%eax
cmovl  %eax,%edi
jmp    1030 <simple_check@plt>

LLVM IR (-O0):
define void @failure_on_both_branches(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @simple_check(i32 %6)
br label %10
8: ; preds = %1
%9 = call i32 @simple_check(i32 42)
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @failure_on_both_branches(i32 %0) {
%2 = icmp sgt i32 %0, 3
%3 = select i1 %2, i32 %0, i32 42
%4 = tail call i32 @simple_check(i32 %3)
ret void
}
char bitNot(char A) {
  if (A == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<bitNot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1120 <bitNot+0x20>
movb   $0x1,-0x1(%rbp)
jmp    1124 <bitNot+0x24>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitNot>:
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define signext i8 @bitNot(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @bitNot(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i8
ret i8 %3
}
const char *db_create_current_trial_balance_view_sql(void) {
  static const char *query = "CREATE VIEW current_trial_balance AS"
                             "  SELECT"
                             "    j.entity AS 'Entity',"
                             "    a.num AS 'A/C No.',"
                             "    a.description AS 'Description',"
                             "    sum(l.amount) AS 'Balance'"
                             "    FROM nomaccts AS a"
                             "    LEFT OUTER JOIN jelines AS l"
                             "      ON a.num = l.account"
                             "    INNER JOIN jes AS j"
                             "      ON l.je = j.id"
                             "    GROUP BY j.entity, a.num"
                             "    ORDER BY j.entity ASC, l.account ASC";
  return query;
}


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

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

LLVM IR (-O0):
@db_create_current_trial_balance_view_sql.query = internal global i8* getelementptr inbounds ([349 x i8], [349 x i8]* @.str, i32 0, i32 0)
@.str = [349 x i8] c"CREATE VIEW current_trial_balance AS SELECT j.entity AS 'Entity', a.num AS 'A/C No.', a.description AS 'Description', sum(l.amount) AS 'Balance' FROM nomaccts AS a LEFT OUTER JOIN jelines AS l ON a.num = l.account INNER JOIN jes AS j ON l.je = j.id GROUP BY j.entity, a.num ORDER BY j.entity ASC, l.account ASC\00"
define i8* @db_create_current_trial_balance_view_sql() {
%1 = load i8*, i8** @db_create_current_trial_balance_view_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [349 x i8] c"CREATE VIEW current_trial_balance AS SELECT j.entity AS 'Entity', a.num AS 'A/C No.', a.description AS 'Description', sum(l.amount) AS 'Balance' FROM nomaccts AS a LEFT OUTER JOIN jelines AS l ON a.num = l.account INNER JOIN jes AS j ON l.je = j.id GROUP BY j.entity, a.num ORDER BY j.entity ASC, l.account ASC\00"
define i8* @db_create_current_trial_balance_view_sql() {
ret i8* getelementptr inbounds ([349 x i8], [349 x i8]* @.str, i64 0, i64 0)
}
void describe_com_model(struct com_model *m) {}


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

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

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

LLVM IR (-O2):
%struct.com_model = type opaque
define void @describe_com_model(%struct.com_model* nocapture %0) {
ret void
}
void SSMR3PutS16(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutS16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void fn_vv(void) { abort(); }


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

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

LLVM IR (-O0):
define void @fn_vv() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fn_vv() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage() {
  fputs("usage: chflags [-Rf] flags file ...\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"usage: chflags [-Rf] flags file ...\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"usage: chflags [-Rf] flags file ...\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ is_CL_both_case(unsigned int);
unsigned int to_lower(unsigned int);
unsigned int CL_to_lower(unsigned int ch) {
  return (is_CL_both_case(ch) ? to_lower(ch) : ch);
}


x86 assembly (clang, -O0):
<CL_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_CL_both_case@plt>
cmp    $0x0,%rax
je     114d <CL_to_lower+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <to_lower@plt>
mov    %eax,-0x8(%rbp)
jmp    1153 <CL_to_lower+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_to_lower>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_CL_both_case@plt>
test   %rax,%rax
je     1135 <CL_to_lower+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <to_lower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CL_to_lower(i32 %0) {
%2 = tail call i64 @is_CL_both_case(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @to_lower(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ xmalloc(size_t);
void *xcalloc(size_t size) { return memset(xmalloc(size), 0, size); }


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

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <xmalloc@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @xmalloc(i64 %3)
%5 = load i64, i64* %2
%6 = call i8* @memset(i32 %4, i32 0, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0) {
%2 = tail call i32 @xmalloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *);
int /*<<< orphan*/ esc(char *);
void tek_enable(int flag) {
  if (flag)
    do_csi("?38h");
  else
    esc("\003");
}


x86 assembly (clang, -O0):
<tek_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <tek_enable+0x26>
lea    0xec4(%rip),%rdi
call   1030 <do_csi@plt>
jmp    1152 <tek_enable+0x32>
lea    0xeb8(%rip),%rdi
call   1040 <esc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tek_enable>:
test   %edi,%edi
je     1130 <tek_enable+0x10>
lea    0xed5(%rip),%rdi
jmp    1030 <do_csi@plt>
lea    0xece(%rip),%rdi
jmp    1040 <esc@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"?38h\00"
@.str.1 = [2 x i8] c"\03\00"
define void @tek_enable(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 %7
5: ; preds = %1
%6 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?38h\00"
@.str.1 = [2 x i8] c"\03\00"
define void @tek_enable(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
void __attribute__((visibility("protected"))) main_protected(void) {}


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

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

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

LLVM IR (-O2):
define protected void @main_protected() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XKeyPressedEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XKeyPressedEvent_display(void *_p, void *_v) {
  ((XKeyPressedEvent *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XKeyPressedEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
int max4(int a, int b, int c, int d) {
  int ab = ((a) > (b) ? (a) : (b));
  int cd = ((c) > (d) ? (c) : (d));
  return ((ab) > (cd) ? (ab) : (cd));
}


x86 assembly (clang, -O0):
<max4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1127 <max4+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <max4+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <max4+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <max4+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    116d <max4+0x6d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1173 <max4+0x73>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max4>:
cmp    %esi,%edi
cmovg  %edi,%esi
mov    %ecx,%eax
cmp    %ecx,%edx
cmovg  %edx,%eax
cmp    %eax,%esi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i32, i32* %5
br label %18
16: ; preds = %4
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %9
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %7
br label %27
25: ; preds = %18
%26 = load i32, i32* %8
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = load i32, i32* %9
br label %36
34: ; preds = %27
%35 = load i32, i32* %10
br label %36
36: ; preds = %34, %32
%37 = phi i32 [ %33, %32 ], [ %35, %34 ]
ret i32 %37
}

LLVM IR (-O2):
define i32 @max4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 %1
%7 = icmp sgt i32 %2, %3
%8 = select i1 %7, i32 %2, i32 %3
%9 = icmp sgt i32 %6, %8
%10 = select i1 %9, i32 %6, i32 %8
ret i32 %10
}
/* Variables and functions */
int ebbrt_gthread_yield();
int __gthread_yield(void) { return ebbrt_gthread_yield(); }


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

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

LLVM IR (-O0):
define i32 @__gthread_yield() {
%1 = call i32 (...) @ebbrt_gthread_yield()
ret i32 %1
}

LLVM IR (-O2):
define i32 @__gthread_yield() {
%1 = tail call i32 (...) @ebbrt_gthread_yield()
ret i32 %1
}
void makeSS(short s, char *a, char *b) {
  *b = (char)a;
  *a = (char)(s / 256);
}


x86 assembly (clang, -O0):
<makeSS>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movswl -0x2(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeSS>:
mov    %sil,(%rdx)
lea    0xff(%rdi),%eax
test   %di,%di
cmovns %edi,%eax
mov    %ah,(%rsi)
ret

LLVM IR (-O0):
define void @makeSS(i16 signext %0, i8* %1, i8* %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i8*
store i16 %0, i16* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = ptrtoint i8* %7 to i8
%9 = load i8*, i8** %6
store i8 %8, i8* %9
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = sdiv i32 %11, 256
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @makeSS(i16 signext %0, i8* %1, i8* nocapture writeonly %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i8
store i8 %5, i8* %2
%6 = sdiv i16 %0, 256
%7 = trunc i16 %6 to i8
store i8 %7, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int);
int main() {
  printf("%d\n", reverse(123));
  printf("%d\n", reverse(-123));
  printf("%d\n", reverse(1534236469));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7b,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffff85,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5b729735,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7b,%edi
call   1030 <reverse@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xffffff85,%edi
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5b729735,%edi
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @reverse(i32 123)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @reverse(i32 -123)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @reverse(i32 1534236469)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int __builtin_spe_mfspefscr();
int /*<<< orphan*/ __builtin_spe_mtspefscr(int);
void __ev_clr_spefscr_field(int mask) {
  int i;
  i = __builtin_spe_mfspefscr();
  i &= ~mask;
  __builtin_spe_mtspefscr(i);
}


x86 assembly (clang, -O0):
<__ev_clr_spefscr_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__builtin_spe_mfspefscr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__builtin_spe_mtspefscr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ev_clr_spefscr_field>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__builtin_spe_mfspefscr@plt>
not    %ebx
and    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <__builtin_spe_mtspefscr@plt>

LLVM IR (-O0):
define void @__ev_clr_spefscr_field(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @__builtin_spe_mfspefscr()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = load i32, i32* %3
%8 = and i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @__builtin_spe_mtspefscr(i32 %9)
ret void
}

LLVM IR (-O2):
define void @__ev_clr_spefscr_field(i32 %0) {
%2 = tail call i32 (...) @__builtin_spe_mfspefscr()
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
%5 = tail call i32 @__builtin_spe_mtspefscr(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
const char *epoch_to_string(time_t in_time) {
  char *result = (char *)malloc(sizeof(char) * 100);
  struct tm ts;
  ts = *localtime(&in_time);
  strftime(result, sizeof(char) * 100, "%a %Y-%m-%d %H:%M:%S %Z", &ts);
  return result;
}


x86 assembly (clang, -O0):
<epoch_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
lea    0xe99(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoch_to_string>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0xea3(%rip),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [24 x i8] c"%a %Y-%m-%d %H:%M:%S %Z\00"
define i8* @epoch_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.tm
store i32 %0, i32* %2
%5 = call i64 @malloc(i32 100)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = call %struct.tm* @localtime(i32* %2)
%8 = bitcast %struct.tm* %4 to i8*
%9 = bitcast %struct.tm* %7 to i8*
%10 = load i8*, i8** %3
%11 = call i32 @strftime(i8* %10, i32 100, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [24 x i8] c"%a %Y-%m-%d %H:%M:%S %Z\00"
define i8* @epoch_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = tail call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
%6 = bitcast %struct.tm* %3 to i8*
%7 = call %struct.tm* @localtime(i32* %2)
%8 = getelementptr %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = call i32 @strftime(i8* %5, i32 100, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ randomSample2();
int main() { randomSample2(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @randomSample2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @randomSample2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
int tcdrain(int);
int tio_drain_output(int fd) {
  if (tcdrain(fd) == -1) {
    lprintf(1, "tio_drain: tcdrain");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tio_drain_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <tcdrain@plt>
cmp    $0xffffffff,%eax
jne    1159 <tio_drain_output+0x39>
mov    $0x1,%edi
lea    0xeb8(%rip),%rsi
call   1040 <lprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <tio_drain_output+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_drain_output>:
push   %rax
call   1030 <tcdrain@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <tio_drain_output+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1040 <lprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"tio_drain: tcdrain\00"
define i32 @tio_drain_output(i32 %0) {
%2 = tail call i32 @tcdrain(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lprintf(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
char *pluginsRevisionAsString() { return "?"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define i8* @pluginsRevisionAsString() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @pluginsRevisionAsString() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
extern int deg_range(int val) {
  while (val < 0) {
    val += 360;
  }
  while (val > 360) {
    val -= 360;
  }
  return val;
}


x86 assembly (clang, -O0):
<deg_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1121 <deg_range+0x21>
mov    -0x4(%rbp),%eax
add    $0x168,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <deg_range+0x7>
jmp    1126 <deg_range+0x26>
cmpl   $0x168,-0x4(%rbp)
jle    1143 <deg_range+0x43>
mov    -0x4(%rbp),%eax
sub    $0x168,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <deg_range+0x26>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_range>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
xor    %ecx,%ecx
sub    %edi,%eax
setne  %cl
sub    %ecx,%eax
shr    $0x3,%eax
imul   $0x16c16c17,%rax,%rax
shr    $0x22,%rax
add    %ecx,%eax
imul   $0x168,%eax,%ecx
add    %edi,%ecx
cmp    $0x168,%ecx
mov    $0x168,%eax
cmovl  %ecx,%eax
mov    %ecx,%edx
sub    %eax,%edx
add    $0x167,%edx
mov    %edx,%eax
shr    $0x3,%eax
imul   $0x16c16c17,%rax,%rax
shr    $0x22,%rax
imul   $0x168,%eax,%esi
mov    %edx,%eax
sub    %esi,%eax
sub    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @deg_range(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
%3 = sub i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = sub i32 %3, %5
%7 = udiv i32 %6, 360
%8 = add nuw nsw i32 %7, %5
%9 = mul i32 %8, 360
%10 = add i32 %9, %0
%11 = add i32 %10, 359
%12 = call i32 @llvm.smin.i32(i32 %10, i32 360)
%13 = sub i32 %11, %12
%14 = urem i32 %13, 360
%15 = sub i32 %14, %13
%16 = add i32 %15, %10
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ss(float *);
__m128 test_mm_load_ss(float *y) { return _mm_load_ss(y); }


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

x86 assembly (clang, -O2):
<test_mm_load_ss>:
jmp    1030 <_mm_load_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_load_ss(float* %0) {
%2 = tail call i32 @_mm_load_ss(float* %0)
ret i32 %2
}
unsigned int hta_string_hash(void *data) {
  char *theString = *(char **)data;
  unsigned int hash = 0;
  while (theString && *theString != '\0') {
    hash = (hash << 5) - hash + *theString;
    theString++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hta_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     113a <hta_string_hash+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114a <hta_string_hash+0x4a>
jmp    1170 <hta_string_hash+0x70>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
sub    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111a <hta_string_hash+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hta_string_hash>:
mov    (%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1137 <hta_string_hash+0x37>
mov    (%rcx),%dl
test   %dl,%dl
je     1137 <hta_string_hash+0x37>
add    $0x1,%rcx
xor    %esi,%esi
mov    %esi,%eax
nopl   0x0(%rax,%rax,1)
movsbl %dl,%edx
shl    $0x5,%eax
sub    %esi,%eax
add    %edx,%eax
movzbl (%rcx),%edx
add    $0x1,%rcx
mov    %eax,%esi
test   %dl,%dl
jne    1120 <hta_string_hash+0x20>
ret

LLVM IR (-O0):
define i32 @hta_string_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
store i8* %7, i8** %3
store i32 0, i32* %4
br label %8
8: ; preds = %18, %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %8
%17 = phi i1 [ false, %8 ], [ %15, %11 ]
br i1 %17, label %18, label %29
18: ; preds = %16
%19 = load i32, i32* %4
%20 = shl i32 %19, 5
%21 = load i32, i32* %4
%22 = sub i32 %20, %21
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add i32 %22, %25
store i32 %26, i32* %4
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %8
29: ; preds = %16
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @hta_string_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %18, label %5
5: ; preds = %1
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5, %8
%9 = phi i8 [ %16, %8 ], [ %6, %5 ]
%10 = phi i8* [ %15, %8 ], [ %3, %5 ]
%11 = phi i32 [ %14, %8 ], [ 0, %5 ]
%12 = sext i8 %9 to i32
%13 = mul i32 %11, 31
%14 = add i32 %13, %12
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %5, %1
%19 = phi i32 [ 0, %1 ], [ 0, %5 ], [ %14, %8 ]
ret i32 %19
}
/* Variables and functions */
char ow_reset();
char ds_present(void) { return ow_reset(); }


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

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

LLVM IR (-O0):
define signext i8 @ds_present() {
%1 = call signext i8 (...) @ow_reset()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @ds_present() {
%1 = tail call signext i8 (...) @ow_reset()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ lineprint2(char *, long, unsigned char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, unsigned char);
void ind_zpind(char *outf, long ctr, unsigned char *op, char *str) {
  char buf[256];
  sprintf(buf, "%-4s ($%02X)", str, *(op + 1));
  lineprint2(outf, ctr, op, buf);
}


x86 assembly (clang, -O0):
<ind_zpind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
lea    0xeaf(%rip),%rsi
movzbl 0x1(%rax),%ecx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x120(%rbp),%rcx
call   1030 <lineprint2@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind_zpind>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movzbl 0x1(%rdx),%eax
lea    0xebe(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rcx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <lineprint2@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%-4s ($%02X)\00"
define void @ind_zpind(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11, i8 zeroext %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = call i32 @lineprint2(i8* %16, i64 %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%-4s ($%02X)\00"
define void @ind_zpind(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = load i8, i8* %7
%9 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3, i8 zeroext %8)
%10 = call i32 @lineprint2(i8* %0, i64 %1, i8* %2, i8* %6)
ret void
}
/* Variables and functions */
int is_sublist(int *, int *, size_t, size_t);
bool is_superlist(int *list_to_compare, int *base_list,
                  size_t list_to_compare_element_count,
                  size_t base_list_element_count) {
  return is_sublist(base_list, list_to_compare, base_list_element_count,
                    list_to_compare_element_count);
}


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

x86 assembly (clang, -O2):
<is_superlist>:
mov    %rdx,%rax
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
jmp    1030 <is_sublist@plt>

LLVM IR (-O0):
define i32 @is_superlist(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = load i64, i64* %8
%12 = load i64, i64* %7
%13 = call i32 @is_sublist(i32* %9, i32* %10, i64 %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_superlist(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = tail call i32 @is_sublist(i32* %1, i32* %0, i64 %3, i64 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mian() {
  printf("hello my github!!!\n");
  printf("git add . test!\n");
}


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

x86 assembly (clang, -O2):
<mian>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"hello my github!!!\0A\00"
@.str.1 = [17 x i8] c"git add . test!\0A\00"
define void @mian() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"hello my github!!!\00"
@str.2 = [16 x i8] c"git add . test!\00"
define void @mian() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ebcdic_to_ascii(char *, char *, int);
int /*<<< orphan*/ sclp_print(char *);
void print_volser(const void *volser) {
  char ascii[8];
  ebcdic_to_ascii((char *)volser, ascii, 6);
  ascii[6] = '\0';
  sclp_print("VOLSER=[");
  sclp_print(ascii);
  sclp_print("]\n");
}


x86 assembly (clang, -O0):
<print_volser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x6,%edx
call   1030 <ebcdic_to_ascii@plt>
movb   $0x0,-0xa(%rbp)
lea    0xeb7(%rip),%rdi
call   1040 <sclp_print@plt>
lea    -0x10(%rbp),%rdi
call   1040 <sclp_print@plt>
lea    0xeab(%rip),%rdi
call   1040 <sclp_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_volser>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <ebcdic_to_ascii@plt>
movb   $0x0,0xe(%rsp)
lea    0xebd(%rip),%rdi
call   1040 <sclp_print@plt>
mov    %rbx,%rdi
call   1040 <sclp_print@plt>
lea    0xeb2(%rip),%rdi
call   1040 <sclp_print@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"VOLSER=[\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @print_volser(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = call i32 @ebcdic_to_ascii(i8* %4, i8* %5, i32 6)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 6
store i8 0, i8* %7
%8 = call i32 @sclp_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%10 = call i32 @sclp_print(i8* %9)
%11 = call i32 @sclp_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"VOLSER=[\00"
@.str.1 = [3 x i8] c"]\0A\00"
define void @print_volser(i8* %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @ebcdic_to_ascii(i8* %0, i8* %3, i32 6)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 6
store i8 0, i8* %5
%6 = call i32 @sclp_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sclp_print(i8* %3)
%8 = call i32 @sclp_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int f41(unsigned int x, int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f41>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0x1f,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f41>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f41(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = sext i32 %10 to i64
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = shl i32 %8, %13
%15 = or i32 %7, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f41(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
scalar_t__ GC_calloc(unsigned int, unsigned int);
int /*<<< orphan*/ _throw_badalloc();
void *_cyccalloc(unsigned n, unsigned s) {
  void *ans = (void *)GC_calloc(n, s);
  if (!ans)
    _throw_badalloc();
  return ans;
}


x86 assembly (clang, -O0):
<_cyccalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <GC_calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <_cyccalloc+0x2f>
mov    $0x0,%al
call   1040 <_throw_badalloc@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cyccalloc>:
push   %rbx
call   1030 <GC_calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <_cyccalloc+0x15>
xor    %eax,%eax
call   1040 <_throw_badalloc@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_cyccalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @GC_calloc(i32 %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (...) @_throw_badalloc()
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @_cyccalloc(i32 %0, i32 %1) {
%3 = tail call i64 @GC_calloc(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @_throw_badalloc()
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to i8*
ret i8* %8
}
/* Variables and functions */
char *md5_digest(int, char const *);
char *md5(const char *string) { return md5_digest(1, string); }


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

x86 assembly (clang, -O2):
<md5>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <md5_digest@plt>

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

LLVM IR (-O2):
define i8* @md5(i8* %0) {
%2 = tail call i8* @md5_digest(i32 1, i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd;
  int i = 0;
  fd = open("/tmp/foo", O_RDONLY);
  if (fd < 0)
    i = 5;
  else
    i = 2;
  return i;
}


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)
movl   $0x0,-0x18(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115b <main+0x4b>
movl   $0x5,-0x18(%rbp)
jmp    1162 <main+0x52>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
shr    $0x1f,%eax
lea    (%rax,%rax,2),%eax
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/foo\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* @O_RDONLY
%9 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 5, i32* %7
br label %14
13: ; preds = %2
store i32 2, i32* %7
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/foo\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 5, i32 2
ret i32 %6
}