xunge/DecIR huggingface dataset:
unsigned xrop3_194_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_194_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_194_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xffffff00,%edx
or     %edi,%eax
or     %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_194_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_194_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = or i32 %4, %3
%9 = or i32 %8, %7
%10 = or i32 %9, %6
%11 = xor i32 %10, -1
%12 = or i32 %11, %3
ret i32 %12
}
int equal_int(void *ip, void *jp) { return *(int *)ip == *(int *)jp ? 1 : 0; }


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
float getfloat(int num) {
  static char buff[12];
  printf("Enter %s number: ", (num == 1) ? "first " : "second");
  fgets(buff, 12, stdin);
  return atof(buff);
}


x86 assembly (clang, -O0):
<getfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xed4(%rip),%rsi
lea    0xec6(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
lea    0x2ecd(%rip),%rdi
mov    $0xc,%esi
call   1050 <fgets@plt>
lea    0x2ebc(%rip),%rdi
call   1030 <atof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfloat>:
push   %rbx
cmp    $0x1,%edi
lea    0xed7(%rip),%rax
lea    0xed7(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
lea    0x2eda(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <atof@plt>

LLVM IR (-O0):
@getfloat.buff = internal global [12 x i8] zeroinitializer
@.str = [18 x i8] c"Enter %s number: \00"
@.str.1 = [7 x i8] c"first \00"
@.str.2 = [7 x i8] c"second\00"
@stdin = global i32 0
define float @getfloat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @getfloat.buff, i64 0, i64 0), i32 12, i32 %8)
%10 = call float @atof(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @getfloat.buff, i64 0, i64 0))
ret float %10
}

LLVM IR (-O2):
@getfloat.buff = internal global [12 x i8] zeroinitializer
@.str = [18 x i8] c"Enter %s number: \00"
@.str.1 = [7 x i8] c"first \00"
@.str.2 = [7 x i8] c"second\00"
@stdin = global i32 0
define float @getfloat(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fgets(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @getfloat.buff, i64 0, i64 0), i32 12, i32 %5)
%7 = tail call float @atof(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @getfloat.buff, i64 0, i64 0))
ret float %7
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int bjnp_get_address_for_named_printer(char const *, struct sockaddr_in *);
int bjnp_get_printer_id(struct sockaddr_in *, char *);
int bjnp_get_id_from_named_printer(const int port, const char *device_uri,
                                   char *device_id) {
  struct sockaddr_in addr;
  int retval;
  if ((retval = bjnp_get_address_for_named_printer(device_uri, &addr)) != 0)
    return retval;
  return bjnp_get_printer_id(&addr, device_id);
}


x86 assembly (clang, -O0):
<bjnp_get_id_from_named_printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <bjnp_get_address_for_named_printer@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1157 <bjnp_get_id_from_named_printer+0x37>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <bjnp_get_id_from_named_printer+0x47>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1040 <bjnp_get_printer_id@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bjnp_get_id_from_named_printer>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdi
lea    0x8(%rsp),%rsi
call   1030 <bjnp_get_address_for_named_printer@plt>
test   %eax,%eax
jne    1146 <bjnp_get_id_from_named_printer+0x26>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <bjnp_get_printer_id@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i32 @bjnp_get_id_from_named_printer(i32 %0, i8* %1, i8* %2) {
%4 = alloca %struct.sockaddr_in
%5 = bitcast %struct.sockaddr_in* %4 to i8*
%6 = call i32 @bjnp_get_address_for_named_printer(i8* %1, %struct.sockaddr_in* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 @bjnp_get_printer_id(%struct.sockaddr_in* %4, i8* %2)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ %6, %3 ]
ret i32 %11
}
__attribute__((always_)) void free_desc_masks(struct irq_desc *old_desc,
                                              struct irq_desc *new_desc) {}


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

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

LLVM IR (-O0):
%struct.irq_desc = type opaque
define void @free_desc_masks(%struct.irq_desc* %0, %struct.irq_desc* %1) {
%3 = alloca %struct.irq_desc*
%4 = alloca %struct.irq_desc*
store %struct.irq_desc* %0, %struct.irq_desc** %3
store %struct.irq_desc* %1, %struct.irq_desc** %4
ret void
}

LLVM IR (-O2):
%struct.irq_desc = type opaque
define void @free_desc_masks(%struct.irq_desc* nocapture %0, %struct.irq_desc* nocapture %1) {
ret void
}
void drawer_clear_screen() {}


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

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

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

LLVM IR (-O2):
define void @drawer_clear_screen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resetRIOT(int);
void resetRIOTs() {
  for (int i = 0; i < 3; i++)
    resetRIOT(i);
}


x86 assembly (clang, -O0):
<resetRIOTs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    113f <resetRIOTs+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <resetRIOT@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <resetRIOTs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetRIOTs>:
push   %rax
xor    %edi,%edi
call   1030 <resetRIOT@plt>
mov    $0x1,%edi
call   1030 <resetRIOT@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <resetRIOT@plt>

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

LLVM IR (-O2):
define void @resetRIOTs() {
%1 = tail call i32 @resetRIOT(i32 0)
%2 = tail call i32 @resetRIOT(i32 1)
%3 = tail call i32 @resetRIOT(i32 2)
ret void
}
/* Variables and functions */
int globMatch(char const *, char const *, char, char);
int wildMatch(const char *wildCard, const char *string) {
  return globMatch(wildCard, string, '?', '*');
}


x86 assembly (clang, -O0):
<wildMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3f,%edx
mov    $0x2a,%ecx
call   1030 <globMatch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wildMatch>:
mov    $0x3f,%edx
mov    $0x2a,%ecx
jmp    1030 <globMatch@plt>

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

LLVM IR (-O2):
define i32 @wildMatch(i8* %0, i8* %1) {
%3 = tail call i32 @globMatch(i8* %0, i8* %1, i8 signext 63, i8 signext 42)
ret i32 %3
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ zero_user(struct page *, unsigned int, unsigned int);
__attribute__((always_)) void __attribute__((deprecated))
memclear_highpage_flush(struct page *page, unsigned int offset,
                        unsigned int size) {
  zero_user(page, offset, size);
}


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

x86 assembly (clang, -O2):
<memclear_highpage_flush>:
jmp    1030 <zero_user@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @memclear_highpage_flush(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.page*, %struct.page** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @zero_user(%struct.page* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @memclear_highpage_flush(%struct.page* %0, i32 %1, i32 %2) {
%4 = tail call i32 @zero_user(%struct.page* %0, i32 %1, i32 %2)
ret void
}
void glmGenerateConjugateQuaternionf(float result[4], const float q[4]) {
  result[0] = q[0];
  result[1] = -q[1];
  result[2] = -q[2];
  result[3] = -q[3];
}


x86 assembly (clang, -O0):
<glmGenerateConjugateQuaternionf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateConjugateQuaternionf>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movaps 0xeec(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateConjugateQuaternionf(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fneg float %12
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fneg float %18
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 2
store float %19, float* %21
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 3
%24 = load float, float* %23
%25 = fneg float %24
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @glmGenerateConjugateQuaternionf(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = fneg float %5
%7 = getelementptr inbounds float, float* %0, i64 1
store float %6, float* %7
%8 = getelementptr inbounds float, float* %1, i64 2
%9 = load float, float* %8
%10 = fneg float %9
%11 = getelementptr inbounds float, float* %0, i64 2
store float %10, float* %11
%12 = getelementptr inbounds float, float* %1, i64 3
%13 = load float, float* %12
%14 = fneg float %13
%15 = getelementptr inbounds float, float* %0, i64 3
store float %14, float* %15
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void EPIDividerSet(uint32_t ui32Base, uint32_t ui32Divider) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = ui32Divider;
}


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

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

LLVM IR (-O0):
define void @EPIDividerSet(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, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIDividerSet(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
float wscos(float *x) { float wscos_(float *x); }


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

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

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

LLVM IR (-O2):
define float @wscos(float* nocapture readnone %0) {
ret float undef
}
/* Variables and functions */
int strlen(char const *);
char *strstr(char const *, char const *);
const char *strstrnull(const char *s, const char *c) {
  const char *result = strstr(s, c);
  if (!result) {
    result = s + strlen(s);
  }
  return result;
}


x86 assembly (clang, -O0):
<strstrnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strstrnull+0x4d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrnull>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     1130 <strstrnull+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strstrnull(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %3, %2 ], [ %8, %5 ]
ret i8* %10
}
int mkfifo(char *filename, int mode) {}


x86 assembly (clang, -O0):
<mkfifo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mkfifo(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
int param_set_byte(const char *val, struct kernel_param *kp) { return 0; }


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define i32 @param_set_byte(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_set_byte(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ polyglot_array_typeid(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void *polyglot_as_typed(void *, int /*<<< orphan*/);
int /*<<< orphan*/ polyglot_double_typeid();
__attribute__((always_)) double *polyglot_as_double_array(void *p) {
  void *ret =
      polyglot_as_typed(p, polyglot_array_typeid(polyglot_double_typeid(), 0));
  return (double *)ret;
}


x86 assembly (clang, -O0):
<polyglot_as_double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <polyglot_double_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <polyglot_as_typed@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyglot_as_double_array>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <polyglot_double_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <polyglot_as_typed@plt>

LLVM IR (-O0):
define double* @polyglot_as_double_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @polyglot_double_typeid()
%6 = call i32 @polyglot_array_typeid(i32 %5, i32 0)
%7 = call i8* @polyglot_as_typed(i8* %4, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
ret double* %9
}

LLVM IR (-O2):
define double* @polyglot_as_double_array(i8* %0) {
%2 = tail call i32 (...) @polyglot_double_typeid()
%3 = tail call i32 @polyglot_array_typeid(i32 %2, i32 0)
%4 = tail call i8* @polyglot_as_typed(i8* %0, i32 %3)
%5 = bitcast i8* %4 to double*
ret double* %5
}
void WAIT1_Wait10Cycles(void) {
  asm("nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t"
      "nop \n\t");
}


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

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

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

LLVM IR (-O2):
define void @WAIT1_Wait10Cycles() {
tail call void asm sideeffect "nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09nop \0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int firstNumber, secondNumber, result;
  printf("Enter two number:\n");
  scanf("%d %d", &firstNumber, &secondNumber);
  result = firstNumber + secondNumber;
  printf("%d + %d = %d\n", firstNumber, secondNumber, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter two number:\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
@str = [18 x i8] c"Enter two number:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct string *);
void del_string(struct string *p_string) {
  if (!p_string) {
    return;
  }
  free(p_string);
}


x86 assembly (clang, -O0):
<del_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <del_string+0x1c>
jmp    1135 <del_string+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_string>:
test   %rdi,%rdi
je     111a <del_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.string = type { i32 }
define void @del_string(%struct.string* %0) {
%2 = alloca %struct.string*
store %struct.string* %0, %struct.string** %2
%3 = load %struct.string*, %struct.string** %2
%4 = icmp ne %struct.string* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.string*, %struct.string** %2
%8 = call i32 @free(%struct.string* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.string = type { i32 }
define void @del_string(%struct.string* %0) {
%2 = icmp eq %struct.string* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.string* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ llabs(long long);
unsigned long HashInteger(long long number, unsigned long range) {
  unsigned long tally;
  tally = (((unsigned)llabs(number)) % range);
  if (range == 0) {
    return tally;
  }
  return (tally);
}


x86 assembly (clang, -O0):
<HashInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <llabs@plt>
mov    %eax,%eax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114f <HashInteger+0x3f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <HashInteger+0x47>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashInteger>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
mov    %eax,%eax
cmp    %rsi,%rax
jb     1117 <HashInteger+0x17>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @HashInteger(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%4 = and i64 %3, 4294967295
%5 = urem i64 %4, %1
ret i64 %5
}
unsigned primary(unsigned u) { return u & ((1 << 17) - 1); }


x86 assembly (clang, -O0):
<primary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<primary>:
mov    %edi,%eax
and    $0x1ffff,%eax
ret

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

LLVM IR (-O2):
define i32 @primary(i32 %0) {
%2 = and i32 %0, 131071
ret i32 %2
}
extern void outw(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int gd5426_available(void) {
  return rom_present(
      L"roms/video/cirruslogic/Diamond SpeedStar PRO VLB v3.04.bin");
}


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

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

LLVM IR (-O0):
@.str = [59 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 68, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 32, i32 83, i32 112, i32 101, i32 101, i32 100, i32 83, i32 116, i32 97, i32 114, i32 32, i32 80, i32 82, i32 79, i32 32, i32 86, i32 76, i32 66, i32 32, i32 118, i32 51, i32 46, i32 48, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @gd5426_available() {
%1 = call i32 @rom_present(i8* bitcast ([59 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [59 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 68, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 32, i32 83, i32 112, i32 101, i32 101, i32 100, i32 83, i32 116, i32 97, i32 114, i32 32, i32 80, i32 82, i32 79, i32 32, i32 86, i32 76, i32 66, i32 32, i32 118, i32 51, i32 46, i32 48, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @gd5426_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([59 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  int i = 0;
  printf("%s: %d\n", basename(argv[0]), i);
  return 0;
}


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,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
mov    -0x14(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @basename(i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i32 0)
ret i32 0
}
/* Variables and functions */
int xbp_mkdir(char const *);
int __wrap_mkdir(const char *dirname) { return xbp_mkdir(dirname); }


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

x86 assembly (clang, -O2):
<__wrap_mkdir>:
jmp    1030 <xbp_mkdir@plt>

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

LLVM IR (-O2):
define i32 @__wrap_mkdir(i8* %0) {
%2 = tail call i32 @xbp_mkdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
char **argvarg(char const *const *, char const *);
int argvpos(char const *const *argv, char const *arg) {
  char **a = argvarg(argv, arg);
  if (a)
    return a - (char **)argv;
  else
    return -1;
}


x86 assembly (clang, -O0):
<argvpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <argvarg@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <argvpos+0x43>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    %eax,-0x4(%rbp)
jmp    115a <argvpos+0x4a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argvpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <argvarg@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
shr    $0x3,%rcx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @argvpos(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8**
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %5
%9 = call i8** @argvarg(i8** %7, i8* %8)
store i8** %9, i8*** %6
%10 = load i8**, i8*** %6
%11 = icmp ne i8** %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i8**, i8*** %6
%14 = load i8**, i8*** %4
%15 = ptrtoint i8** %13 to i64
%16 = ptrtoint i8** %14 to i64
%17 = sub i64 %15, %16
%18 = sdiv exact i64 %17, 8
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %21
20: ; preds = %2
store i32 -1, i32* %3
br label %21
21: ; preds = %20, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @argvpos(i8** %0, i8* %1) {
%3 = tail call i8** @argvarg(i8** %0, i8* %1)
%4 = icmp eq i8** %3, null
%5 = ptrtoint i8** %3 to i64
%6 = ptrtoint i8** %0 to i64
%7 = sub i64 %5, %6
%8 = lshr exact i64 %7, 3
%9 = trunc i64 %8 to i32
%10 = select i1 %4, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ end_screen();
void finalize() { end_screen(); }


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

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

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

LLVM IR (-O2):
define void @finalize() {
%1 = tail call i32 (...) @end_screen()
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getfloat(float *);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float f;
  while (getfloat(&f) != EOF) {
    printf("%f\n", f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getfloat@plt>
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
je     115e <main+0x3e>
movss  -0x8(%rbp),%xmm0
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <getfloat@plt>
mov    0x2eae(%rip),%r15
cmp    (%r15),%rax
je     116b <main+0x4b>
lea    0xeba(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
cmp    (%r15),%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @getfloat(float* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = load float, float* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %7)
%9 = call i64 @getfloat(float* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
char *strtrim_left(char *, char);
char *skips(char *p) { return strtrim_left(p, ' '); }


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

x86 assembly (clang, -O2):
<skips>:
mov    $0x20,%esi
jmp    1030 <strtrim_left@plt>

LLVM IR (-O0):
define i8* @skips(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strtrim_left(i8* %3, i8 signext 32)
ret i8* %4
}

LLVM IR (-O2):
define i8* @skips(i8* %0) {
%2 = tail call i8* @strtrim_left(i8* %0, i8 signext 32)
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevLPMDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000362))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<USBDevLPMDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x362(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0x362(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevLPMDisable>:
andl   $0xfffffffe,0x362(%rdi)
ret

LLVM IR (-O0):
define void @USBDevLPMDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 866
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBDevLPMDisable(i64 %0) {
%2 = add nsw i64 %0, 866
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -2
store volatile i32 %5, i32* %3
ret void
}
/* Type definitions */
typedef size_t uint;

/* Variables and functions */
uint st_find_next_word(char *text) {
  uint i;
  for (i = 1; text[i] > 32; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<st_find_next_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jle    113b <st_find_next_word+0x3b>
jmp    112a <st_find_next_word+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <st_find_next_word+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_find_next_word>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x20,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jg     1110 <st_find_next_word+0x10>
ret

LLVM IR (-O0):
define i64 @st_find_next_word(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 1, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 32
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i64, i64* %3
%14 = add i64 %13, 1
store i64 %14, i64* %3
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @st_find_next_word(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, 32
%7 = add i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i64 %3
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int32_t SASL_L(int32_t x, int16_t by) {
  if (x >= 0)
    return x << by;
  return -((-x) << by);
}


x86 assembly (clang, -O0):
<SASL_L>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <SASL_L+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <SASL_L+0x37>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SASL_L(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 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = shl i32 %9, %10
store i32 %11, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = load i32, i32* %5
%16 = shl i32 %14, %15
%17 = sub nsw i32 0, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @SASL_L(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
int cmp_ulong(const void *aa, const void *bb) {
  const unsigned long *a = aa, *b = bb;
  return (*a < *b) ? -1 : (*a > *b);
}


x86 assembly (clang, -O0):
<cmp_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jae    113d <cmp_ulong+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <cmp_ulong+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ulong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_ulong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp ult i64 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %24
17: ; preds = %2
%18 = load i64*, i64** %5
%19 = load i64, i64* %18
%20 = load i64*, i64** %6
%21 = load i64, i64* %20
%22 = icmp ugt i64 %19, %21
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %17, %16
%25 = phi i32 [ -1, %16 ], [ %23, %17 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_ulong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = icmp ugt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}