xunge/DecIR huggingface dataset:
int fun1204() { return 1204; }


x86 assembly (clang, -O0):
<fun1204>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1204>:
mov    $0x4b4,%eax
ret

LLVM IR (-O0):
define i32 @fun1204() {
ret i32 1204
}

LLVM IR (-O2):
define i32 @fun1204() {
ret i32 1204
}
/* Variables and functions */
int /*<<< orphan*/ CPC_Reset();
void GenericInterface_DoReset(void) { CPC_Reset(); }


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

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

LLVM IR (-O0):
define void @GenericInterface_DoReset() {
%1 = call i32 (...) @CPC_Reset()
ret void
}

LLVM IR (-O2):
define void @GenericInterface_DoReset() {
%1 = tail call i32 (...) @CPC_Reset()
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t hex_value(char c) {
  if (c <= '9')
    return c - '0';
  else if (c <= 'F')
    return c - 'A' + 10;
  else
    return c - 'a' + 10;
}


x86 assembly (clang, -O0):
<hex_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <hex_value+0x26>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <hex_value+0x52>
movsbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     1145 <hex_value+0x45>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <hex_value+0x52>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_value>:
cmp    $0x47,%dil
setb   %al
shl    $0x5,%al
add    $0xa9,%al
cmp    $0x3a,%dil
movzbl %al,%ecx
mov    $0xd0,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hex_value(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 sle i32 %5, 57
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %28
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 70
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = add nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %28
22: ; preds = %12
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 97
%26 = add nsw i32 %25, 10
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
br label %28
28: ; preds = %22, %16, %7
%29 = load i8, i8* %2
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @hex_value(i8 signext %0) {
%2 = icmp slt i8 %0, 58
%3 = icmp ult i8 %0, 71
%4 = select i1 %3, i8 -55, i8 -87
%5 = select i1 %2, i8 -48, i8 %4
%6 = add i8 %5, %0
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ ConfigureDevice();
int /*<<< orphan*/ Updater();
void HandleUpdate() {
  ConfigureDevice();
  Updater();
}


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

x86 assembly (clang, -O2):
<HandleUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <ConfigureDevice@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Updater@plt>

LLVM IR (-O0):
define void @HandleUpdate() {
%1 = call i32 (...) @ConfigureDevice()
%2 = call i32 (...) @Updater()
ret void
}

LLVM IR (-O2):
define void @HandleUpdate() {
%1 = tail call i32 (...) @ConfigureDevice()
%2 = tail call i32 (...) @Updater()
ret void
}
int emac1_etherstatspkts64octets_set(
    unsigned int dev_id, union emac1_etherstatspkts64octets_u *value) {
  return 1;
}


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

x86 assembly (clang, -O2):
<emac1_etherstatspkts64octets_set>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
%union.emac1_etherstatspkts64octets_u = type opaque
define i32 @emac1_etherstatspkts64octets_set(i32 %0, %union.emac1_etherstatspkts64octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts64octets_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts64octets_u* %1, %union.emac1_etherstatspkts64octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts64octets_u = type opaque
define i32 @emac1_etherstatspkts64octets_set(i32 %0, %union.emac1_etherstatspkts64octets_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ divide(int, int, int);
int main(void) {
  divide(5, 3, 5);
  divide(5, 3, 2);
  divide(5, 3, 1);
  divide(5, 3, 0);
  divide(60, 7, 3);
  divide(60, 7, 5);
  divide(613, 9, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <divide@plt>
mov    $0x3c,%edi
mov    $0x7,%esi
mov    $0x3,%edx
call   1030 <divide@plt>
mov    $0x3c,%edi
mov    $0x7,%esi
mov    $0x5,%edx
call   1030 <divide@plt>
mov    $0x265,%edi
mov    $0x9,%esi
mov    $0x8,%edx
call   1030 <divide@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x5,%edx
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <divide@plt>
mov    $0x5,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <divide@plt>
mov    $0x3c,%edi
mov    $0x7,%esi
mov    $0x3,%edx
call   1030 <divide@plt>
mov    $0x3c,%edi
mov    $0x7,%esi
mov    $0x5,%edx
call   1030 <divide@plt>
mov    $0x265,%edi
mov    $0x9,%esi
mov    $0x8,%edx
call   1030 <divide@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @divide(i32 5, i32 3, i32 5)
%3 = call i32 @divide(i32 5, i32 3, i32 2)
%4 = call i32 @divide(i32 5, i32 3, i32 1)
%5 = call i32 @divide(i32 5, i32 3, i32 0)
%6 = call i32 @divide(i32 60, i32 7, i32 3)
%7 = call i32 @divide(i32 60, i32 7, i32 5)
%8 = call i32 @divide(i32 613, i32 9, i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @divide(i32 5, i32 3, i32 5)
%2 = tail call i32 @divide(i32 5, i32 3, i32 2)
%3 = tail call i32 @divide(i32 5, i32 3, i32 1)
%4 = tail call i32 @divide(i32 5, i32 3, i32 0)
%5 = tail call i32 @divide(i32 60, i32 7, i32 3)
%6 = tail call i32 @divide(i32 60, i32 7, i32 5)
%7 = tail call i32 @divide(i32 613, i32 9, i32 8)
ret i32 0
}
void g_get_home_dir() {}


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

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

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

LLVM IR (-O2):
define void @g_get_home_dir() {
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int swe_day_of_week(double jd) {
  return (((int)floor(jd - 2433282 - 1.5) % 7) + 7) % 7;
}


x86 assembly (clang, -O0):
<swe_day_of_week>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x7,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_day_of_week>:
push   %rax
addsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
add    $0x7,%cl
movzbl %cl,%eax
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%ecx
shr    $0x8,%ecx
mov    %eax,%edx
sub    %cl,%dl
shr    %dl
add    %cl,%dl
shr    $0x2,%dl
movzbl %dl,%ecx
lea    0x0(,%rcx,8),%edx
sub    %ecx,%edx
sub    %dl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @swe_day_of_week(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x4142908100000000
%5 = fsub double %4, 1.500000e+00
%6 = call i64 @floor(double %5)
%7 = trunc i64 %6 to i32
%8 = srem i32 %7, 7
%9 = add nsw i32 %8, 7
%10 = srem i32 %9, 7
ret i32 %10
}

LLVM IR (-O2):
define i32 @swe_day_of_week(double %0) {
%2 = fadd double %0, 0xC142908100000000
%3 = fadd double %2, -1.500000e+00
%4 = tail call i64 @floor(double %3)
%5 = trunc i64 %4 to i32
%6 = srem i32 %5, 7
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 7
%9 = urem i8 %8, 7
%10 = zext i8 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int *);
int f(int *arr, int x) {
  g(arr, &x);
  return x;
}


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

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <g@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f(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 = call i32 @g(i32* %5, i32* %4)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @g(i32* %0, i32* %3)
%5 = load i32, i32* %3
ret i32 %5
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
long const LONG_MAX;
long const LONG_MIN;
long strtol(char const *, int /*<<< orphan*/ *, int);
int str_to_int(const char str[]) {
  const long number = strtol(str, NULL, 10);
  return (number == LONG_MAX) ? INT_MAX
                              : ((number == LONG_MIN) ? INT_MIN : number);
}


x86 assembly (clang, -O0):
<str_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <str_to_int+0x49>
mov    0x2e9b(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1190 <str_to_int+0x80>
mov    -0x10(%rbp),%rax
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
jne    1180 <str_to_int+0x70>
mov    0x2e64(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1188 <str_to_int+0x78>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_int>:
push   %rax
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
test   %rax,%rax
jne    112b <str_to_int+0x1b>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@LONG_MAX = constant i64 0
@INT_MAX = global i32 0
@LONG_MIN = constant i64 0
@INT_MIN = global i32 0
define i32 @str_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* @LONG_MAX
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @INT_MAX
%11 = sext i32 %10 to i64
br label %23
12: ; preds = %1
%13 = load i64, i64* %3
%14 = load i64, i64* @LONG_MIN
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* @INT_MIN
%18 = sext i32 %17 to i64
br label %21
19: ; preds = %12
%20 = load i64, i64* %3
br label %21
21: ; preds = %19, %16
%22 = phi i64 [ %18, %16 ], [ %20, %19 ]
br label %23
23: ; preds = %21, %9
%24 = phi i64 [ %11, %9 ], [ %22, %21 ]
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
@LONG_MAX = constant i64 0
@INT_MAX = global i32 0
@LONG_MIN = constant i64 0
@INT_MIN = global i32 0
define i32 @str_to_int(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @INT_MAX
%5 = zext i32 %4 to i64
%6 = select i1 %3, i64 %5, i64 %2
%7 = trunc i64 %6 to i32
ret i32 %7
}
int max(int a, int b) {
  if (a > b)
    return a;
  else if (a < b)
    return b;
  else if (a == b)
    return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <max+0x59>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <max+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <max+0x59>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114f <max+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <max+0x59>
jmp    1154 <max+0x54>
jmp    1159 <max+0x59>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Type definitions */
struct net_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ net_interface_object(struct net_interface *);
int obus_object_destroy(int /*<<< orphan*/);
int net_interface_destroy(struct net_interface *object) {
  return obus_object_destroy(net_interface_object(object));
}


x86 assembly (clang, -O0):
<net_interface_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <net_interface_object@plt>
mov    %eax,%edi
call   1040 <obus_object_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_interface_destroy>:
push   %rax
call   1030 <net_interface_object@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <obus_object_destroy@plt>

LLVM IR (-O0):
%struct.net_interface = type { i32 }
define i32 @net_interface_destroy(%struct.net_interface* %0) {
%2 = alloca %struct.net_interface*
store %struct.net_interface* %0, %struct.net_interface** %2
%3 = load %struct.net_interface*, %struct.net_interface** %2
%4 = call i32 @net_interface_object(%struct.net_interface* %3)
%5 = call i32 @obus_object_destroy(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.net_interface = type { i32 }
define i32 @net_interface_destroy(%struct.net_interface* %0) {
%2 = tail call i32 @net_interface_object(%struct.net_interface* %0)
%3 = tail call i32 @obus_object_destroy(i32 %2)
ret i32 %3
}
int material_lookup(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @material_lookup(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *copy_string(char *s, int l) {
  char *result = (char *)malloc(l + 1);
  strncpy(result, s, l);
  result[l] = 0;
  return result;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @copy_string(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
int answer2(int n) {
  int i;
  int answer2 = 0;
  for (i = 1; i <= n; i++)
    answer2 += i * i * i;
  return answer2;
}


x86 assembly (clang, -O0):
<answer2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1140 <answer2+0x40>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <answer2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer2>:
test   %edi,%edi
jle    113e <answer2+0x3e>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
lea    -0x3(%rdi),%eax
imul   %rcx,%rax
shr    %rcx
lea    (%rcx,%rcx,8),%edx
lea    (%rcx,%rdx,2),%ecx
lea    (%rcx,%rdi,8),%ecx
add    $0xfffffffc,%edi
imul   %rax,%rdi
shr    %rax
lea    (%rax,%rax,2),%eax
lea    (%rcx,%rax,2),%eax
shr    $0x2,%rdi
and    $0xfffffffe,%edi
add    %edi,%eax
add    $0xfffffff9,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @answer2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %34, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = mul i32 %10, 19
%12 = shl i32 %0, 3
%13 = add i32 %11, %12
%14 = add nsw i32 %0, -3
%15 = zext i32 %14 to i33
%16 = mul i33 %8, %15
%17 = lshr i33 %16, 1
%18 = trunc i33 %17 to i32
%19 = mul i32 %18, 6
%20 = add i32 %13, %19
%21 = zext i32 %4 to i35
%22 = zext i32 %6 to i35
%23 = mul i35 %21, %22
%24 = zext i32 %14 to i35
%25 = mul i35 %23, %24
%26 = add nsw i32 %0, -4
%27 = zext i32 %26 to i35
%28 = mul i35 %25, %27
%29 = lshr i35 %28, 2
%30 = trunc i35 %29 to i32
%31 = and i32 %30, -2
%32 = add i32 %20, %31
%33 = add i32 %32, -7
br label %34
34: ; preds = %3, %1
%35 = phi i32 [ 0, %1 ], [ %33, %3 ]
ret i32 %35
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint8_t readb(uint32_t addr) { return *(volatile uint8_t *)addr; }


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

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

LLVM IR (-O0):
define i32 @readb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @readb(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outAlloc(int, int **);
void outAllocWrapper(int **arr) { outAlloc(5, arr); }


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

x86 assembly (clang, -O2):
<outAllocWrapper>:
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <outAlloc@plt>

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

LLVM IR (-O2):
define void @outAllocWrapper(i32** %0) {
%2 = tail call i32 @outAlloc(i32 5, i32** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int square_unsigned(int);
int main(void) {
  unsigned int ret = square_unsigned(2);
  if (ret != 4) {
    printf("Got %u instead of 4\n", ret);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <square_unsigned@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1161 <main+0x41>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <square_unsigned@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
je     1145 <main+0x25>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Got %u instead of 4\0A\00"
define i32 @main() {
%1 = tail call i32 @square_unsigned(i32 2)
%2 = icmp eq i32 %1, 4
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(size_t *, int /*<<< orphan*/, size_t);
void bit_array_reset(void *array) {
  if (array) {
    size_t *size = (size_t *)array;
    size_t bsize = (*size + 7) >> 3;
    memset(size + 1, 0, bsize);
  }
}


x86 assembly (clang, -O0):
<bit_array_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <bit_array_reset+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x7,%rax
shr    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_array_reset>:
test   %rdi,%rdi
je     112b <bit_array_reset+0x1b>
mov    (%rdi),%rdx
add    $0x7,%rdx
shr    $0x3,%rdx
add    $0x8,%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

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

LLVM IR (-O2):
define void @bit_array_reset(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = add i64 %5, 7
%7 = lshr i64 %6, 3
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i64*
%10 = tail call i32 @memset(i64* %9, i32 0, i64 %7)
br label %11
11: ; preds = %3, %1
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_open_system_remote(void **ret, const char *host) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_open_system_remote>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_open_system_remote(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_open_system_remote(i8** nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _mm_monitorx(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mwaitx(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void foo1(char *p) {
  _mm_monitorx(p, 0, 0);
  _mm_mwaitx(0, 0, 0);
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <_mm_monitorx@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <_mm_mwaitx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <_mm_monitorx@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <_mm_mwaitx@plt>

LLVM IR (-O0):
define void @foo1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_mm_monitorx(i8* %3, i32 0, i32 0)
%5 = call i32 @_mm_mwaitx(i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @foo1(i8* %0) {
%2 = tail call i32 @_mm_monitorx(i8* %0, i32 0, i32 0)
%3 = tail call i32 @_mm_mwaitx(i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void CRCDataWrite(uint32_t ui32Base, uint32_t ui32Data) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000414))) = ui32Data;
}


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

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

LLVM IR (-O0):
define void @CRCDataWrite(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 1044
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @CRCDataWrite(i64 %0, i64 %1) {
%3 = add i64 %0, 1044
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void server_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @server_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ islower(unsigned char);
int all_lower(char *str) {
  while (*str) {
    if (!islower((unsigned char)*str))
      return 0;
    ++str;
  }
  return 1;
}


x86 assembly (clang, -O0):
<all_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <all_lower+0x4b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
jne    114a <all_lower+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <all_lower+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_lower+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_lower>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <all_lower+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1149 <all_lower+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_lower+0x20>
jmp    114b <all_lower+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @islower(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void free_imatrix(int **Matrix, int NumRows) {
  int i;
  for (i = 0; i < NumRows; i++) {
    free(Matrix[i]);
  }
  free(Matrix);
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_imatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_imatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_imatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_imatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glFinish(int /*<<< orphan*/ *);
void gles_glFinish() {
  { mock_push(pack_glFinish(NULL)); };
}


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

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

LLVM IR (-O0):
define void @gles_glFinish() {
%1 = call i32 @pack_glFinish(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @gles_glFinish() {
%1 = tail call i32 @pack_glFinish(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
float foo2(void) {}


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

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

LLVM IR (-O0):
define float @foo2() {
%1 = alloca float
%2 = load float, float* %1
ret float %2
}

LLVM IR (-O2):
define float @foo2() {
ret float undef
}
const char *Ipolmode2str(int mode) {
  switch (mode) {
  case 1:
    return ("normal");
  case 2:
    return ("antialiased");
  default:
    return ("undefined");
  }
}


x86 assembly (clang, -O0):
<Ipolmode2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <Ipolmode2str+0x2c>
jmp    111b <Ipolmode2str+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <Ipolmode2str+0x3c>
jmp    114c <Ipolmode2str+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <Ipolmode2str+0x57>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <Ipolmode2str+0x57>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ipolmode2str>:
cmp    $0x2,%edi
lea    0xefd(%rip),%rax
lea    0xf02(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"normal\00"
@.str.1 = [12 x i8] c"antialiased\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @Ipolmode2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"normal\00"
@.str.1 = [12 x i8] c"antialiased\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @Ipolmode2str(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex16array_(void *x, unsigned int *n) {
  popNarray((char *)x, (*n * 16));
}


x86 assembly (clang, -O0):
<popcomplex16array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x4,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @popNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popcomplex16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
BOOST_AUTO_TEST_CASE(leq) {
  TESTCASE2(leq, 0, 0, 1);
  TESTCASE2(leq, 0, 1, 1);
  TESTCASE2(leq, 1, 0, 0);
  TESTCASE2(leq, 1, 1, 1);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0, i32 1)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %6, i32 0, i32 1, i32 1)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %8, i32 1, i32 0, i32 0)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 1, i32 1, i32 1)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0, i32 1)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1, i32 1)
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0, i32 0)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 1, i32 1)
ret i32 undef
}
/* Type definitions */
struct cluster_cmdline_parser_params {
  int dummy;
};
struct cluster_args_info {
  int dummy;
};

/* Variables and functions */
int cluster_cmdline_parser_internal(int, char **, struct cluster_args_info *,
                                    struct cluster_cmdline_parser_params *,
                                    int /*<<< orphan*/);
int cluster_cmdline_parser_ext(int argc, char **argv,
                               struct cluster_args_info *args_info,
                               struct cluster_cmdline_parser_params *params) {
  int result;
  result = cluster_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<cluster_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <cluster_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cluster_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <cluster_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.cluster_args_info = type { i32 }
%struct.cluster_cmdline_parser_params = type { i32 }
define i32 @cluster_cmdline_parser_ext(i32 %0, i8** %1, %struct.cluster_args_info* %2, %struct.cluster_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.cluster_args_info*
%8 = alloca %struct.cluster_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.cluster_args_info* %2, %struct.cluster_args_info** %7
store %struct.cluster_cmdline_parser_params* %3, %struct.cluster_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.cluster_args_info*, %struct.cluster_args_info** %7
%13 = load %struct.cluster_cmdline_parser_params*, %struct.cluster_cmdline_parser_params** %8
%14 = call i32 @cluster_cmdline_parser_internal(i32 %10, i8** %11, %struct.cluster_args_info* %12, %struct.cluster_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.cluster_args_info = type { i32 }
%struct.cluster_cmdline_parser_params = type { i32 }
define i32 @cluster_cmdline_parser_ext(i32 %0, i8** %1, %struct.cluster_args_info* %2, %struct.cluster_cmdline_parser_params* %3) {
%5 = tail call i32 @cluster_cmdline_parser_internal(i32 %0, i8** %1, %struct.cluster_args_info* %2, %struct.cluster_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
int semi() {}


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

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

LLVM IR (-O0):
define i32 @semi() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @semi() {
ret i32 undef
}
__attribute__((noipa)) int f2(int x) { return x % 16 == -13; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xfffffff3,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0xfffffff3,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 16
%5 = icmp eq i32 %4, -13
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = srem i32 %0, 16
%3 = icmp eq i32 %2, -13
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTFileOpenF(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_copy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake256_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_blake256(unsigned char *out, FILE *fp) {
  return blake256_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_blake256>:
jmp    1030 <blake256_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake256(i8* %0, i32* %1) {
%3 = tail call i8* @blake256_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
unsigned char *OPENSSL_malloc(int);
long hex2bin(char const *, unsigned char *);
int strlen(char const *);
unsigned char *hex2bin_m(const char *in, long *plen) {
  unsigned char *p;
  p = OPENSSL_malloc((strlen(in) + 1) / 2);
  *plen = hex2bin(in, p);
  return p;
}


x86 assembly (clang, -O0):
<hex2bin_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <OPENSSL_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hex2bin@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2bin_m>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
sar    %edi
call   1050 <OPENSSL_malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <hex2bin@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @hex2bin_m(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i8* @OPENSSL_malloc(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = call i64 @hex2bin(i8* %11, i8* %12)
%14 = load i64*, i64** %4
store i64 %13, i64* %14
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @hex2bin_m(i8* %0, i64* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, 2
%6 = tail call i8* @OPENSSL_malloc(i32 %5)
%7 = tail call i64 @hex2bin(i8* %0, i8* %6)
store i64 %7, i64* %1
ret i8* %6
}