xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x24_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x24_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x24_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x24_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x24_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int divide(int *, int /*<<< orphan*/, int, int);
bool sum_in_array(int *a, int n, int x) {
  bool result;
  result = divide(a, 0, n, x);
  return result;
}


x86 assembly (clang, -O0):
<sum_in_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %esi,%esi
call   1030 <divide@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_in_array>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <divide@plt>

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

LLVM IR (-O2):
define i32 @sum_in_array(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @divide(i32* %0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
int kill(pid, sig)
int pid;
int sig;
{
  if (pid == 1)
    _exit(sig);
  return 0;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1130 <kill+0x20>
mov    -0x8(%rbp),%edi
call   1030 <_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
cmp    $0x1,%edi
je     1118 <kill+0x8>
xor    %eax,%eax
ret
push   %rax
mov    %esi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @_exit(i32 %1)
unreachable
5: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AbEnd(char *, char const *, char const *);
void InvArg(const char *Opt, const char *Arg) {
  AbEnd("Invalid argument for %s: '%s'", Opt, Arg);
}


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

x86 assembly (clang, -O2):
<InvArg>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <AbEnd@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Invalid argument for %s: '%s'\00"
define void @InvArg(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 @AbEnd(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Invalid argument for %s: '%s'\00"
define void @InvArg(i8* %0, i8* %1) {
%3 = tail call i32 @AbEnd(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int strcpy(char *dest, char *src) {
  int i = 0;
  while (*src != '\0') {
    *dest++ = *src++;
    i++;
  }
  *dest = '\0';
  return (i);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <strcpy+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <strcpy+0x23>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
add    %rax,%rdi
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i32 @strcpy(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 = %11, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8*, i8** %3
store i8 0, i8* %20
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %6, i8* %9
%12 = add nuw nsw i32 %7, 1
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ %0, %2 ], [ %11, %5 ]
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
store i8 0, i8* %16
ret i32 %17
}
unsigned getval_281() { return 3284633928U; }


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

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

LLVM IR (-O0):
define i32 @getval_281() {
ret i32 -1010333368
}

LLVM IR (-O2):
define i32 @getval_281() {
ret i32 -1010333368
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char const *, int /*<<< orphan*/);
char *file_rc();
int rc_source(char const *);
int rc_read() {
  const char *fn = file_rc();
  if (!access(fn, F_OK))
    return rc_source(fn);
  return 1;
}


x86 assembly (clang, -O0):
<rc_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <file_rc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%eax
jne    116f <rc_read+0x3f>
mov    -0x10(%rbp),%rdi
call   1040 <rc_source@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <rc_read+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_read>:
push   %rbx
xor    %eax,%eax
call   1030 <file_rc@plt>
mov    %rax,%rbx
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <access@plt>
test   %eax,%eax
je     1157 <rc_read+0x27>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rc_source@plt>

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @rc_read() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @file_rc()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @rc_source(i8* %9)
store i32 %10, i32* %1
br label %12
11: ; preds = %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @rc_read() {
%1 = tail call i8* (...) @file_rc()
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %1, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @rc_source(i8* %1)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ 1, %0 ]
ret i32 %8
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void russian_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<russian_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @russian_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Type definitions */
struct ibv_device {
  int dummy;
};

/* Variables and functions */
struct ibv_device **_get_device_list(int *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_device **ibv_get_device_list(int *num_devices) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_device **result = _get_device_list(num_devices);
  dmtcp_plugin_enable_ckpt();
  return result;
}


x86 assembly (clang, -O0):
<ibv_get_device_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_get_device_list@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_get_device_list>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1030 <_get_device_list@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_device = type { i32 }
define %struct.ibv_device** @ibv_get_device_list(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.ibv_device**
store i32* %0, i32** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load i32*, i32** %2
%6 = call %struct.ibv_device** @_get_device_list(i32* %5)
store %struct.ibv_device** %6, %struct.ibv_device*** %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load %struct.ibv_device**, %struct.ibv_device*** %3
ret %struct.ibv_device** %8
}

LLVM IR (-O2):
%struct.ibv_device = type { i32 }
define %struct.ibv_device** @ibv_get_device_list(i32* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call %struct.ibv_device** @_get_device_list(i32* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_device** %3
}
/* Variables and functions */
scalar_t__ VIDEC_HEADER_GET_EVEN_KEYFRAME(void const *);
scalar_t__ VIDEC_HEADER_GET_ODD_KEYFRAME(void const *);
unsigned short VIDEC_HEADER_GET_LEN(const void *p) {
  if ((VIDEC_HEADER_GET_EVEN_KEYFRAME(p) || VIDEC_HEADER_GET_ODD_KEYFRAME(p))) {
    return 24;
  }
  return 16;
}


x86 assembly (clang, -O0):
<VIDEC_HEADER_GET_LEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <VIDEC_HEADER_GET_EVEN_KEYFRAME@plt>
cmp    $0x0,%rax
jne    1152 <VIDEC_HEADER_GET_LEN+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <VIDEC_HEADER_GET_ODD_KEYFRAME@plt>
cmp    $0x0,%rax
je     115d <VIDEC_HEADER_GET_LEN+0x3d>
movw   $0x18,-0x2(%rbp)
jmp    1163 <VIDEC_HEADER_GET_LEN+0x43>
movw   $0x10,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIDEC_HEADER_GET_LEN>:
push   %rbx
mov    %rdi,%rbx
call   1030 <VIDEC_HEADER_GET_EVEN_KEYFRAME@plt>
mov    %rax,%rcx
mov    $0x18,%ax
test   %rcx,%rcx
je     1137 <VIDEC_HEADER_GET_LEN+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <VIDEC_HEADER_GET_ODD_KEYFRAME@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x10(,%rcx,8),%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @VIDEC_HEADER_GET_LEN(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @VIDEC_HEADER_GET_EVEN_KEYFRAME(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @VIDEC_HEADER_GET_ODD_KEYFRAME(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 24, i16* %2
br label %13
12: ; preds = %7
store i16 16, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @VIDEC_HEADER_GET_LEN(i8* %0) {
%2 = tail call i64 @VIDEC_HEADER_GET_EVEN_KEYFRAME(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @VIDEC_HEADER_GET_ODD_KEYFRAME(i8* %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i16 16, i16 24
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 24, %1 ], [ %7, %4 ]
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_initializeList();
void test_circularDoubleLinkedList() { test_initializeList(); }


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

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

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

LLVM IR (-O2):
define void @test_circularDoubleLinkedList() {
%1 = tail call i32 (...) @test_initializeList()
ret void
}
/* Variables and functions */
double DSlater_3S_5S(double, double, double);
double DSlater_5S_3S(double rij, double xii, double xij) {
  return DSlater_3S_5S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_5S_3S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_3S_5S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_5S_3S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_3S_5S@plt>

LLVM IR (-O0):
define double @DSlater_5S_3S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_3S_5S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_5S_3S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_3S_5S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Dijkstra(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  Dijkstra(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <Dijkstra@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Dijkstra(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _pwmss_clk_enable(unsigned int);
scalar_t__ _pwmss_clk_status_get(unsigned int);
int /*<<< orphan*/ _pwmss_clk_status_set(unsigned int, int);
int pwmss_clk_enable(unsigned int device_id) {
  if (device_id > 2) {
    return -1;
  }
  if (_pwmss_clk_status_get(device_id) != 0) {
    return 1;
  }
  _pwmss_clk_enable(device_id);
  _pwmss_clk_status_set(device_id, 1);
  return 0;
}


x86 assembly (clang, -O0):
<pwmss_clk_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jbe    1151 <pwmss_clk_enable+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    118b <pwmss_clk_enable+0x5b>
mov    -0x8(%rbp),%edi
call   1040 <_pwmss_clk_status_get@plt>
cmp    $0x0,%rax
je     116f <pwmss_clk_enable+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    118b <pwmss_clk_enable+0x5b>
mov    -0x8(%rbp),%edi
call   1050 <_pwmss_clk_enable@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <_pwmss_clk_status_set@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmss_clk_enable>:
push   %rbx
mov    $0xffffffff,%eax
cmp    $0x2,%edi
ja     114f <pwmss_clk_enable+0x1f>
mov    %edi,%ebx
call   1040 <_pwmss_clk_status_get@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1151 <pwmss_clk_enable+0x21>
pop    %rbx
ret
mov    %ebx,%edi
call   1050 <_pwmss_clk_enable@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <_pwmss_clk_status_set@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pwmss_clk_enable(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @_pwmss_clk_status_get(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @_pwmss_clk_enable(i32 %0)
%8 = tail call i32 @_pwmss_clk_status_set(i32 %0, i32 1)
br label %9
9: ; preds = %3, %1, %6
%10 = phi i32 [ 0, %6 ], [ -1, %1 ], [ 1, %3 ]
ret i32 %10
}
int inreg(int channel, int reg) {
  int val;
  val = *((volatile unsigned char *)0xfffce800 + (channel * 0x0) + (reg * 0x1));
  return val;
}


x86 assembly (clang, -O0):
<inreg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x0,-0x4(%rbp),%eax
movslq %eax,%rcx
mov    $0xfffce800,%eax
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inreg>:
movslq %esi,%rax
mov    $0xfffce800,%ecx
movzbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @inreg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 0
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 4294764544 to i8*), i64 %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load volatile i8, i8* %13
%15 = zext i8 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @inreg(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* inttoptr (i64 4294764544 to i8*), i64 %3
%5 = load volatile i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
double foo(double);
void bar(double *f, int n) {
  int i;
  for (i = 0; i < n; i++)
    f[i] = foo(f[i]);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <bar+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   1030 <foo@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bar+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bar(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call double @foo(double %9)
store double %10, double* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
double core_mhz(int);
double mhz(int verbose) {
  double val = core_mhz(verbose);
  return val;
}


x86 assembly (clang, -O0):
<mhz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <core_mhz@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhz>:
jmp    1030 <core_mhz@plt>

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

LLVM IR (-O2):
define double @mhz(i32 %0) {
%2 = tail call double @core_mhz(i32 %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int encode_closing_tag(int /*<<< orphan*/ *, int);
int rp_ack_encode_apdu_object_property_end(uint8_t *apdu) {
  int apdu_len = 0;
  if (apdu) {
    apdu_len = encode_closing_tag(&apdu[0], 3);
  }
  return apdu_len;
}


x86 assembly (clang, -O0):
<rp_ack_encode_apdu_object_property_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <rp_ack_encode_apdu_object_property_end+0x2f>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <encode_closing_tag@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_ack_encode_apdu_object_property_end>:
test   %rdi,%rdi
je     111f <rp_ack_encode_apdu_object_property_end+0xf>
mov    $0x3,%esi
jmp    1030 <encode_closing_tag@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rp_ack_encode_apdu_object_property_end(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = call i32 @encode_closing_tag(i32* %8, i32 3)
store i32 %9, i32* %3
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @rp_ack_encode_apdu_object_property_end(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @encode_closing_tag(i32* %0, i32 3)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
char *strerror(int errnum) {
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (errnum > 0 && errnum < sys_nerr)
    return sys_errlist[errnum];
  return (char *)"Unknown error type";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113b <strerror+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jge    113b <strerror+0x3b>
movslq -0xc(%rbp),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
jle    1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [19 x i8] c"Unknown error type\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [19 x i8] c"Unknown error type\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
void XcmsCIELabQueryMaxLC() {}


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

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

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

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

/* Variables and functions */
int irc_input_data(struct t_gui_buffer *, char const *, int);
int irc_input_data_cb(void *data, struct t_gui_buffer *buffer,
                      const char *input_data) {
  (void)data;
  return irc_input_data(buffer, input_data, 1);
}


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

x86 assembly (clang, -O2):
<irc_input_data_cb>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <irc_input_data@plt>

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

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
define i32 @irc_input_data_cb(i8* nocapture readnone %0, %struct.t_gui_buffer* %1, i8* %2) {
%4 = tail call i32 @irc_input_data(%struct.t_gui_buffer* %1, i8* %2, i32 1)
ret i32 %4
}
int zenglrun_getHashCode(char *key) {
  int temp = 0;
  int i = 0;
  while (key[i] != '\0') {
    temp = ((temp << 4) | key[i]);
    ++i;
  }
  return temp;
}


x86 assembly (clang, -O0):
<zenglrun_getHashCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <zenglrun_getHashCode+0x50>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <zenglrun_getHashCode+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zenglrun_getHashCode>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <zenglrun_getHashCode+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x4,%eax
or     %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <zenglrun_getHashCode+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @zenglrun_getHashCode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl i32 %7, 4
%10 = or i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[], char *envp[]) {
  int k = 1;
  if (k == 0) {
    sleep(4);
    printf("Hello CHild \n");
  } else {
    printf("parent sleeping\n");
    sleep(1);
    printf("Hello Parent\n");
  }
}


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    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1166 <main+0x46>
mov    $0x4,%edi
call   1040 <sleep@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello CHild \0A\00"
@.str.1 = [17 x i8] c"parent sleeping\0A\00"
@.str.2 = [14 x i8] c"Hello Parent\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 1, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = call i32 @sleep(i32 4)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %18
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @sleep(i32 1)
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %14, %11
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@str = [16 x i8] c"parent sleeping\00"
@str.3 = [13 x i8] c"Hello Parent\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ blink_led(int, int, int);
int /*<<< orphan*/ check_packet_count(int);
int lux_uri_open(char *);
int main(void) {
  int fd = lux_uri_open("udp://127.0.0.1:1365");
  check_packet_count(fd);
  blink_led(fd, 0xFFFFFFFF, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <lux_uri_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <check_packet_count@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0xa,%edx
call   1030 <blink_led@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <lux_uri_open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <check_packet_count@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0xa,%edx
call   1030 <blink_led@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"udp://127.0.0.1:1365\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @lux_uri_open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @check_packet_count(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @blink_led(i32 %6, i32 -1, i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"udp://127.0.0.1:1365\00"
define i32 @main() {
%1 = tail call i32 @lux_uri_open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @check_packet_count(i32 %1)
%3 = tail call i32 @blink_led(i32 %1, i32 -1, i32 10)
ret i32 0
}
void plat_minimize(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_minimize() {
ret void
}
unsigned int buffer_findbyte(void *in, unsigned int count,
                             unsigned char value) {
  unsigned char *ip = in;
  unsigned int offset;
  for (offset = 0; offset < count && ip[offset] != value; offset++)
    ;
  return offset;
}


x86 assembly (clang, -O0):
<buffer_findbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jae    1147 <buffer_findbyte+0x47>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
movzbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1157 <buffer_findbyte+0x57>
jmp    116a <buffer_findbyte+0x6a>
jmp    115c <buffer_findbyte+0x5c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <buffer_findbyte+0x1f>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_findbyte>:
test   %esi,%esi
je     1121 <buffer_findbyte+0x21>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rdi,%rax,1)
je     1120 <buffer_findbyte+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <buffer_findbyte+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @buffer_findbyte(i8* nocapture %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_splice(struct list_head *, struct list_head *);
int /*<<< orphan*/ init_list_head(struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head *);
void list_splice_init(struct list_head *list, struct list_head *head) {
  if (!list_empty(list)) {
    __list_splice(list, head);
    init_list_head(list);
  }
}


x86 assembly (clang, -O0):
<list_splice_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
jne    1168 <list_splice_init+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__list_splice@plt>
mov    -0x8(%rbp),%rdi
call   1030 <init_list_head@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <list_empty@plt>
test   %eax,%eax
je     114b <list_splice_init+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <__list_splice@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <init_list_head@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @__list_splice(%struct.list_head* %9, %struct.list_head* %10)
%12 = load %struct.list_head*, %struct.list_head** %3
%13 = call i32 @init_list_head(%struct.list_head* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @__list_splice(%struct.list_head* %0, %struct.list_head* %1)
%7 = tail call i32 @init_list_head(%struct.list_head* %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_int16_t(int16_t *const dest, int16_t const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_int16_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
void vPortInitialiseBlocks(void) {}


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

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

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

LLVM IR (-O2):
define void @vPortInitialiseBlocks() {
ret void
}
/* Variables and functions */
double gsw_gibbs(int, int, int, double, double, double);
double gsw_alpha_wrt_t_exact(double sa, double t, double p) {
  int n0, n1;
  n0 = 0;
  n1 = 1;
  return (gsw_gibbs(n0, n1, n1, sa, t, p) / gsw_gibbs(n0, n0, n1, sa, t, p));
}


x86 assembly (clang, -O0):
<gsw_alpha_wrt_t_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_alpha_wrt_t_exact>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,0x20(%rsp)
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @gsw_alpha_wrt_t_exact(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store i32 0, i32* %7
store i32 1, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = load i32, i32* %8
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %6
%15 = call double @gsw_gibbs(i32 %9, i32 %10, i32 %11, double %12, double %13, double %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load double, double* %4
%20 = load double, double* %5
%21 = load double, double* %6
%22 = call double @gsw_gibbs(i32 %16, i32 %17, i32 %18, double %19, double %20, double %21)
%23 = fdiv double %15, %22
ret double %23
}

LLVM IR (-O2):
define double @gsw_alpha_wrt_t_exact(double %0, double %1, double %2) {
%4 = tail call double @gsw_gibbs(i32 0, i32 1, i32 1, double %0, double %1, double %2)
%5 = tail call double @gsw_gibbs(i32 0, i32 0, i32 1, double %0, double %1, double %2)
%6 = fdiv double %4, %5
ret double %6
}