xunge/DecIR huggingface dataset:
/* Variables and functions */
int openInputEventDeviceExt(char const *, int /*<<< orphan*/ *);
int openInputEventDevice(const char *inputName) {
  return openInputEventDeviceExt(inputName, NULL);
}


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

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

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

LLVM IR (-O2):
define i32 @openInputEventDevice(i8* %0) {
%2 = tail call i32 @openInputEventDeviceExt(i8* %0, i32* null)
ret i32 %2
}
char *opname(int op) {
  if (op < 0)
    return "LT";
  if (op > 0)
    return "GT";
  return "EQ";
}


x86 assembly (clang, -O0):
<opname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1121 <opname+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <opname+0x46>
cmpl   $0x0,-0xc(%rbp)
jle    113b <opname+0x3b>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <opname+0x46>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opname>:
test   %edi,%edi
lea    0xefd(%rip),%rax
lea    0xef3(%rip),%rcx
cmove  %rax,%rcx
lea    0xee5(%rip),%rax
cmovns %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"LT\00"
@.str.1 = [3 x i8] c"GT\00"
@.str.2 = [3 x i8] c"EQ\00"
define i8* @opname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"LT\00"
@.str.1 = [3 x i8] c"GT\00"
@.str.2 = [3 x i8] c"EQ\00"
define i8* @opname(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void byteorder_htolebufs(uint8_t *buf, uint16_t val) {
  buf[0] = (uint8_t)(val >> 8);
  buf[1] = (uint8_t)(val & 0xff);
}


x86 assembly (clang, -O0):
<byteorder_htolebufs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder_htolebufs>:
movzbl %sil,%eax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,(%rdi)
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @byteorder_htolebufs(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
ret void
}

LLVM IR (-O2):
define void @byteorder_htolebufs(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = and i32 %1, 255
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage : servecho numero_port_serveur\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"usage : servecho numero_port_serveur\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"usage : servecho numero_port_serveur\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
struct sk_buff *alloc_skb(unsigned int, int);
int /*<<< orphan*/ skb_reserve(struct sk_buff *, int);
struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask) {
  struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
  if (skb)
    skb_reserve(skb, 16);
  return skb;
}


x86 assembly (clang, -O0):
<__dev_alloc_skb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1040 <alloc_skb@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <__dev_alloc_skb+0x39>
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1030 <skb_reserve@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dev_alloc_skb>:
push   %rbx
add    $0x10,%edi
call   1040 <alloc_skb@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <__dev_alloc_skb+0x1e>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <skb_reserve@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
define %struct.sk_buff* @__dev_alloc_skb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sk_buff*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 16
%8 = load i32, i32* %4
%9 = call %struct.sk_buff* @alloc_skb(i32 %7, i32 %8)
store %struct.sk_buff* %9, %struct.sk_buff** %5
%10 = load %struct.sk_buff*, %struct.sk_buff** %5
%11 = icmp ne %struct.sk_buff* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load %struct.sk_buff*, %struct.sk_buff** %5
%14 = call i32 @skb_reserve(%struct.sk_buff* %13, i32 16)
br label %15
15: ; preds = %12, %2
%16 = load %struct.sk_buff*, %struct.sk_buff** %5
ret %struct.sk_buff* %16
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define %struct.sk_buff* @__dev_alloc_skb(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = tail call %struct.sk_buff* @alloc_skb(i32 %3, i32 %1)
%5 = icmp eq %struct.sk_buff* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @skb_reserve(%struct.sk_buff* %4, i32 16)
br label %8
8: ; preds = %6, %2
ret %struct.sk_buff* %4
}
/* Variables and functions */
char toupper(char);
char *strup(char *string) {
  char *s;
  if (string) {
    for (s = string; *s; ++s)
      *s = toupper(*s);
  }
  return string;
}


x86 assembly (clang, -O0):
<strup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <strup+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <strup+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <strup+0x1f>
jmp    1166 <strup+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strup+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strup+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strup+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strup(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
scalar_t__ __renum_ex_enum_from_str(char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void renum_show(void) {
  printf("ex_enum value: %u\n", (unsigned int)__renum_ex_enum_from_str("ENT3"));
}


x86 assembly (clang, -O0):
<renum_show>:
push   %rbp
mov    %rsp,%rbp
lea    0xee8(%rip),%rdi
call   1040 <__renum_ex_enum_from_str@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<renum_show>:
push   %rax
lea    0xeeb(%rip),%rdi
call   1040 <__renum_ex_enum_from_str@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"ex_enum value: %u\0A\00"
@.str.1 = [5 x i8] c"ENT3\00"
define void @renum_show() {
%1 = call i64 @__renum_ex_enum_from_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = trunc i64 %1 to i32
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"ex_enum value: %u\0A\00"
@.str.1 = [5 x i8] c"ENT3\00"
define void @renum_show() {
%1 = tail call i64 @__renum_ex_enum_from_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int rpathx_value();
int rpathy_value();
int rpathz_value() { return 1000 * rpathx_value() + 3 * rpathy_value(); }


x86 assembly (clang, -O0):
<rpathz_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rpathx_value@plt>
imul   $0x3e8,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rpathy_value@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpathz_value>:
push   %rbx
xor    %eax,%eax
call   1030 <rpathx_value@plt>
imul   $0x3e8,%eax,%ebx
xor    %eax,%eax
call   1040 <rpathy_value@plt>
lea    (%rax,%rax,2),%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rpathz_value() {
%1 = call i32 (...) @rpathx_value()
%2 = mul nsw i32 1000, %1
%3 = call i32 (...) @rpathy_value()
%4 = mul nsw i32 3, %3
%5 = add nsw i32 %2, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rpathz_value() {
%1 = tail call i32 (...) @rpathx_value()
%2 = mul nsw i32 %1, 1000
%3 = tail call i32 (...) @rpathy_value()
%4 = mul nsw i32 %3, 3
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hola GitHub");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hola GitHub\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hola GitHub\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
long long empiricalSolution(int);
int /*<<< orphan*/ printf(char *, long long);
int readArgs();
int main(int argc, char *argv[]) {
  int n;
  long long result;
  n = readArgs();
  result = empiricalSolution(n);
  printf("%lld\n", result);
  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)
mov    $0x0,%al
call   1050 <readArgs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <empiricalSolution@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @readArgs()
%4 = tail call i64 @empiricalSolution(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
strlen(s) register char *s;
{
  register n;
  n = 0;
  while (*s++)
    n++;
  return (n);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
float hpa2inhg(float hpa) { return hpa / 33.8639; }


x86 assembly (clang, -O0):
<hpa2inhg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpa2inhg>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @hpa2inhg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 3.386390e+01
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @hpa2inhg(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 3.386390e+01
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
char EOF;
char getchar();
void leeren() {
  char c;
  do {
    c = getchar();
  } while (c != '\n' && c != EOF && c != 0);
}


x86 assembly (clang, -O0):
<leeren>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     115c <leeren+0x4c>
movsbl -0x1(%rbp),%ecx
mov    0x2ea9(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     115c <leeren+0x4c>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1118 <leeren+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leeren>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1133 <leeren+0x23>
test   %al,%al
je     1133 <leeren+0x23>
cmp    (%rbx),%al
jne    1120 <leeren+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @leeren() {
%1 = alloca i8
br label %2
2: ; preds = %18, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %14, %8, %4
%19 = phi i1 [ false, %8 ], [ false, %4 ], [ %17, %14 ]
br i1 %19, label %2, label %20
20: ; preds = %18
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @leeren() {
br label %1
1: ; preds = %4, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* @EOF
%6 = icmp ne i8 %2, %5
%7 = icmp ne i8 %2, 0
%8 = and i1 %7, %6
br i1 %8, label %1, label %9
9: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Platform_Halt(int);
scalar_t__ close(long long);
int errno;
int Platform_Close(long long h) {
  int _o_result;
  if (close(h) < 0) {
    _o_result = errno;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Platform_Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1146 <Platform_Close+0x36>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <Platform_Close+0x43>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Close>:
push   %rax
call   1030 <close@plt>
mov    0x2ec3(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @Platform_Close(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i64 @close(i64 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @errno
store i32 %9, i32* %4
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
store i32 0, i32* %4
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %15
13: ; No predecessors!
%14 = call i32 @Platform_Halt(i32 -3)
store i32 0, i32* %2
br label %15
15: ; preds = %13, %11, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Platform_Close(i64 %0) {
%2 = tail call i64 @close(i64 %0)
%3 = icmp slt i64 %2, 0
%4 = load i32, i32* @errno
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
size_t roundUp(int group_size, int global_size) {
  int r = global_size % group_size;
  if (r == 0) {
    return global_size;
  } else {
    return global_size + group_size - r;
  }
}


x86 assembly (clang, -O0):
<roundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112b <roundUp+0x2b>
movslq -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113a <roundUp+0x3a>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x14(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUp>:
mov    %esi,%eax
cltd
idiv   %edi
add    %esi,%edi
sub    %edx,%edi
test   %edx,%edx
cmove  %esi,%edi
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @roundUp(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %1, i32 %6
%8 = sext i32 %7 to i64
ret i64 %8
}
unsigned long djb2_hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb2_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <djb2_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ fb(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(int argc, const char *argv[]) {
  unsigned int x;
  printf("Enter a number: ");
  scanf("%d", &x);
  fb(x);
  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)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <fb@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\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
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @fb(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @fb(i32 %7)
ret i32 0
}
const char *type_name(unsigned long t) {
  if (t)
    return "ULONG";
  else
    return "unsigned long";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <type_name+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <type_name+0x2e>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %rdi,%rdi
lea    0xefc(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ULONG\00"
@.str.1 = [14 x i8] c"unsigned long\00"
define i8* @type_name(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"ULONG\00"
@.str.1 = [14 x i8] c"unsigned long\00"
define i8* @type_name(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ multiply_array_number(double *, double *, double, int, int);
void multiply_array_number_inplace(double *out, double f, int ncol, int nlns) {
  multiply_array_number(out, out, f, ncol, nlns);
}


x86 assembly (clang, -O0):
<multiply_array_number_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <multiply_array_number@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_array_number_inplace>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <multiply_array_number@plt>

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

LLVM IR (-O2):
define void @multiply_array_number_inplace(double* %0, double %1, i32 %2, i32 %3) {
%5 = tail call i32 @multiply_array_number(double* %0, double* %0, double %1, i32 %2, i32 %3)
ret void
}
void pxa3xx_clear_reset_status(unsigned int mask) {}


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

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

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

LLVM IR (-O2):
define void @pxa3xx_clear_reset_status(i32 %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_witness_set_to_Laurent_system_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(807, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_witness_set_to_Laurent_system_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x327,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_witness_set_to_Laurent_system_container>:
mov    $0x327,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @standard_witness_set_to_Laurent_system_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 807, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @standard_witness_set_to_Laurent_system_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 807, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void berror(char *s) {
  fprintf(stderr, "internal error, %s\n", s);
  abort();
}


x86 assembly (clang, -O0):
<berror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<berror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"internal error, %s\0A\00"
define void @berror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"internal error, %s\0A\00"
define void @berror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int ABS(int x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <ABS+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ABS+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ABS>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void NetworkServerYearlyLoop() {}


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

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

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

LLVM IR (-O2):
define void @NetworkServerYearlyLoop() {
ret void
}
void copy(char from[], char to[]) {
  int i;
  for (i = 0; i < 9; ++i) {
    to[i] = from[i];
  }
  return;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    1141 <copy+0x41>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    0x2(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x3(%rdi),%al
mov    %al,0x3(%rsi)
mov    0x4(%rdi),%al
mov    %al,0x4(%rsi)
mov    0x5(%rdi),%al
mov    %al,0x5(%rsi)
mov    0x6(%rdi),%al
mov    %al,0x6(%rsi)
mov    0x7(%rdi),%al
mov    %al,0x7(%rsi)
mov    0x8(%rdi),%al
mov    %al,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %14, i8* %15
%16 = getelementptr inbounds i8, i8* %0, i64 5
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %17, i8* %18
%19 = getelementptr inbounds i8, i8* %0, i64 6
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %20, i8* %21
%22 = getelementptr inbounds i8, i8* %0, i64 7
%23 = load i8, i8* %22
%24 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %23, i8* %24
%25 = getelementptr inbounds i8, i8* %0, i64 8
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %1, i64 8
store i8 %26, i8* %27
ret void
}
int my_compute_power_rec(int nb, int p) {
  if (p == 0)
    return (1);
  else if (p < 0)
    return (0);
  else
    return (nb * my_compute_power_rec(nb, p - 1));
}


x86 assembly (clang, -O0):
<my_compute_power_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <my_compute_power_rec+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1169 <my_compute_power_rec+0x59>
cmpl   $0x0,-0xc(%rbp)
jge    114a <my_compute_power_rec+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1169 <my_compute_power_rec+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <my_compute_power_rec@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_compute_power_rec>:
mov    $0x1,%eax
test   %esi,%esi
je     1128 <my_compute_power_rec+0x28>
nopl   0x0(%rax)
test   %esi,%esi
js     1123 <my_compute_power_rec+0x23>
imul   %edi,%eax
add    $0xffffffff,%esi
jne    1110 <my_compute_power_rec+0x10>
mov    $0x1,%ecx
jmp    1125 <my_compute_power_rec+0x25>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_compute_power_rec(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %9, %8 ], [ %1, %2 ]
%6 = phi i32 [ %10, %8 ], [ 1, %2 ]
%7 = icmp slt i32 %5, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = add nsw i32 %5, -1
%10 = mul nsw i32 %6, %0
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %8
%13 = phi i32 [ %10, %8 ], [ %6, %4 ]
%14 = phi i32 [ 1, %8 ], [ 0, %4 ]
%15 = mul nuw nsw i32 %14, %13
br label %16
16: ; preds = %12, %2
%17 = phi i32 [ %15, %12 ], [ 1, %2 ]
ret i32 %17
}
int call_stdcall_fun(int (*f)(int, int, int)) {
  int a = 42;
  f(1, 2, 3);
  return a;
}


x86 assembly (clang, -O0):
<call_stdcall_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   *-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_stdcall_fun>:
push   %rax
mov    %rdi,%rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   *%rax
mov    $0x2a,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @call_stdcall_fun(i32 (i32, i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 1, i32 2, i32 3)
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_sysctl_tcp_abc(void) {
  record_linux_param_description("tcp_linux.c", "sysctl_tcp_abc",
                                 "whether we needs ABC or not");
}


x86 assembly (clang, -O0):
<module_param_desc_sysctl_tcp_abc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_sysctl_tcp_abc>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xef6(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tcp_linux.c\00"
@.str.1 = [15 x i8] c"sysctl_tcp_abc\00"
@.str.2 = [28 x i8] c"whether we needs ABC or not\00"
define void @module_param_desc_sysctl_tcp_abc() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"tcp_linux.c\00"
@.str.1 = [15 x i8] c"sysctl_tcp_abc\00"
@.str.2 = [28 x i8] c"whether we needs ABC or not\00"
define void @module_param_desc_sysctl_tcp_abc() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getNumber(double *);
double log10(double);
double logBase10(double a) {
  getNumber(&a);
  return (log10(a));
}


x86 assembly (clang, -O0):
<logBase10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logBase10>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1040 <log10@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @logBase10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @log10(double %4)
ret double %5
}

LLVM IR (-O2):
define double @logBase10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @log10(double %4)
ret double %5
}
void rop3_11_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_11_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_11_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
and    %sil,%cl
or     %dl,%cl
not    %cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_11_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = and i32 %32, %34
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = xor i32 %39, -1
%41 = and i32 %37, %40
%42 = or i32 %35, %41
%43 = load i8, i8* %6
%44 = zext i8 %43 to i32
%45 = load i8, i8* %5
%46 = zext i8 %45 to i32
%47 = xor i32 %46, -1
%48 = and i32 %44, %47
%49 = load i8*, i8** %4
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = and i32 %48, %51
%53 = or i32 %42, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_11_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %1
%7 = or i8 %6, %2
%8 = xor i8 %7, -1
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %11, %8
store i8 %12, i8* %0
ret void
}
void hcs08_enable_interrupt() { asm("cli"); }


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

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

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

LLVM IR (-O2):
define void @hcs08_enable_interrupt() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int main() {
  char *words = {"HI", "HIHI"};
  printf("%s", words[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xed2(%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    0xee8(%rip),%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}