xunge/DecIR huggingface dataset:
int STC3100_Read(unsigned char ByteCount, unsigned char RegisterAddr,
                 unsigned char *RxBuffer) {
  int Status = 1;
  int retry;
  if (RxBuffer == (void *)0)
    Status = 2;
  else {
    for (retry = 0; retry < 2; retry++) {
      if (Status != 0) {
      } else {
        break;
      }
    }
  }
  return Status;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1132 <STC3100_Read+0x32>
movl   $0x2,-0x14(%rbp)
jmp    116f <STC3100_Read+0x6f>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    116a <STC3100_Read+0x6a>
cmpl   $0x0,-0x14(%rbp)
je     1152 <STC3100_Read+0x52>
jmp    1157 <STC3100_Read+0x57>
jmp    116a <STC3100_Read+0x6a>
jmp    115c <STC3100_Read+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <STC3100_Read+0x39>
jmp    116f <STC3100_Read+0x6f>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x1,%rdx
mov    $0x1,%eax
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @STC3100_Read(i8 zeroext %0, i8 zeroext %1, i8* readnone %2) {
%4 = icmp eq i8* %2, null
%5 = select i1 %4, i32 2, i32 1
ret i32 %5
}
/* Variables and functions */
bool eq(int a, int b) { return a == b ? true : false; }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_F8int64_lowword_reg(long long val) {
  return ((val) & (0xF8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F8int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F8int64_lowword_reg>:
test   $0xf8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 248
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_F8int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 248
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void vis_json_preamble(void) {}


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

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

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

LLVM IR (-O2):
define void @vis_json_preamble() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t N(int num) { return (num & 0x3) << 2; }


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

x86 assembly (clang, -O2):
<N>:
lea    0x0(,%rdi,4),%eax
and    $0xc,%eax
ret

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

LLVM IR (-O2):
define i32 @N(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 12
ret i32 %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(void) {
  printf("Process %d started\n", getpid());
  printf("Press CTRL+C to stop us\n");
  while (1) {
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1164 <main+0x34>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [20 x i8] c"Process %d started\0A\00"
@.str.1 = [25 x i8] c"Press CTRL+C to stop us\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = call i32 @sleep(i32 1)
br label %5
}

LLVM IR (-O2):
@.str = [20 x i8] c"Process %d started\0A\00"
@str = [24 x i8] c"Press CTRL+C to stop us\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = tail call i32 @sleep(i32 1)
br label %4
}
/* Variables and functions */
size_t strlen(char *str) {
  size_t len = 0;
  while (str[len])
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int reset_prog_mode();
int wrap_reset_prog_mode(void) { return reset_prog_mode(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_reset_prog_mode() {
%1 = tail call i32 (...) @reset_prog_mode()
ret i32 %1
}
void qcom_smem_state_put(struct qcom_smem_state *state) {}


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

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

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

LLVM IR (-O2):
%struct.qcom_smem_state = type opaque
define void @qcom_smem_state_put(%struct.qcom_smem_state* nocapture %0) {
ret void
}
__typeof__(strncat(1, 1, "")) test_strncat_167(void) {
  return strncat(1, 1, "");
}


x86 assembly (clang, -O0):
<test_strncat_167>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %rsi,%rdi
call   1030 <strncat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncat_167>:
lea    0xee9(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <strncat@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_strncat_167() {
%1 = call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @test_strncat_167() {
%1 = tail call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ handle_52(int /*<<< orphan*/);
int gen_52(void) {
  handle_52(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_52() {
%1 = call i32 @handle_52(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_52() {
%1 = tail call i32 @handle_52(i32 0)
ret i32 0
}
int is_punct(char character) {
  int temp_ascii = (int)character;
  if ((temp_ascii == 33) || (temp_ascii == 44) || (temp_ascii == 46) ||
      (temp_ascii == 63)) {
    return 9;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_punct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x21,-0xc(%rbp)
je     1139 <is_punct+0x39>
cmpl   $0x2c,-0xc(%rbp)
je     1139 <is_punct+0x39>
cmpl   $0x2e,-0xc(%rbp)
je     1139 <is_punct+0x39>
cmpl   $0x3f,-0xc(%rbp)
jne    1145 <is_punct+0x45>
movl   $0x9,-0x4(%rbp)
jmp    114c <is_punct+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_punct>:
cmp    $0x3f,%dil
ja     1120 <is_punct+0x20>
mov    $0x9,%eax
movzbl %dil,%ecx
movabs $0x8000500200000000,%rdx
bt     %rcx,%rdx
jae    1120 <is_punct+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_punct(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 33
br i1 %8, label %18, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 44
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 46
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 63
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %9, %1
store i32 9, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_punct(i8 signext %0) {
switch i8 %0, label %2 [
i8 63, label %3
i8 46, label %3
i8 44, label %3
i8 33, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 9, %1 ], [ 9, %1 ], [ 9, %1 ], [ 9, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList(void *,
                                                                    char *);
int /*<<< orphan*/ printf(char *);
void UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList(
    void *upnptoken) {
  printf("Invoke: "
         "UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList();\r\n");
  UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList(
      upnptoken, "Sample String");
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf05(%rip),%rsi
call   1040 <UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [71 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList();\0D\00"
define void @UpnpRemoteIOClient_ChannelManager_GetRegisteredChannelList(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_RemoteIOClient_ChannelManager_GetRegisteredChannelList(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void SSMR3HandleRevision(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleRevision() {
ret void
}
const char *Show_Brief(void) { return "Convert To or From String"; }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Convert To or From String\00"
define i8* @Show_Brief() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"Convert To or From String\00"
define i8* @Show_Brief() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ SXNETID;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SXNETID_it;
void SXNETID_free(SXNETID *a) { ASN1_item_free((ASN1_VALUE *)a, &SXNETID_it); }


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

x86 assembly (clang, -O2):
<SXNETID_free>:
mov    0x2ec1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@SXNETID_it = global i32 0
define void @SXNETID_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @SXNETID_it)
ret void
}

LLVM IR (-O2):
@SXNETID_it = global i32 0
define void @SXNETID_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @SXNETID_it)
ret void
}
double received_value(double self, double neighbour) {
  double delta;
  delta = ((1 - neighbour) * self) / 4;
  return delta;
}


x86 assembly (clang, -O0):
<received_value>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<received_value>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @received_value(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fsub double 1.000000e+00, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fdiv double %9, 4.000000e+00
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @received_value(double %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = fmul double %3, %0
%5 = fmul double %4, 2.500000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void banner() {
  printf("---=== ARPsmash - BlackLight's ARP spoofer ===---\n"
         "-- copyleft 2008, by BlackLight\n"
         "-- Released under GNU GPL licence 3.0\n\n");
}


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

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

LLVM IR (-O0):
@.str = [122 x i8] c"---=== ARPsmash - BlackLight's ARP spoofer ===---\0A-- copyleft 2008, by BlackLight\0A-- Released under GNU GPL licence 3.0\0A\0A\00"
define void @banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [121 x i8] c"---=== ARPsmash - BlackLight's ARP spoofer ===---\0A-- copyleft 2008, by BlackLight\0A-- Released under GNU GPL licence 3.0\0A\00"
define void @banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ coalesce();
void *myalloc2(int);
void *myalloc(int size) {
  void *myalloc(int size);
  void *ptr = myalloc2(size);
  if (ptr == NULL) {
    coalesce();
    ptr = myalloc2(size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<myalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <myalloc2@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <myalloc+0x35>
mov    $0x0,%al
call   1030 <coalesce@plt>
mov    -0x4(%rbp),%edi
call   1040 <myalloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myalloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <myalloc2@plt>
test   %rax,%rax
je     112f <myalloc+0xf>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <coalesce@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <myalloc2@plt>

LLVM IR (-O0):
define i8* @myalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @myalloc2(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 (...) @coalesce()
%10 = load i32, i32* %2
%11 = call i8* @myalloc2(i32 %10)
store i8* %11, i8** %3
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @myalloc(i32 %0) {
%2 = tail call i8* @myalloc2(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @coalesce()
%6 = tail call i8* @myalloc2(i32 %0)
br label %7
7: ; preds = %4, %1
%8 = phi i8* [ %6, %4 ], [ %2, %1 ]
ret i8* %8
}
void ARGBExtractAlphaRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBExtractAlphaRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, char);
void serial_configure_fifo(unsigned short com, char config) {
  outb((com + 2), config);
}


x86 assembly (clang, -O0):
<serial_configure_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x2,%eax
movzwl %ax,%edi
movsbl -0x3(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_fifo>:
add    $0x2,%edi
movzwl %di,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_fifo(i16 zeroext %0, i8 signext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 2
%8 = trunc i32 %7 to i16
%9 = load i8, i8* %4
%10 = call i32 @outb(i16 zeroext %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @serial_configure_fifo(i16 zeroext %0, i8 signext %1) {
%3 = add i16 %0, 2
%4 = tail call i32 @outb(i16 zeroext %3, i8 signext %1)
ret void
}
/* Type definitions */
struct inode_type {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int32_t romfs_link_inode(struct inode_type *inode, const char *name) {
  return -30;
}


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

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

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

LLVM IR (-O2):
%struct.inode_type = type { i32 }
define i32 @romfs_link_inode(%struct.inode_type* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -30
}
void g_relation_select() {}


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

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

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

LLVM IR (-O2):
define void @g_relation_select() {
ret void
}
char *_sbrk_r(int incr) {
  register char *SP asm("sp");
  extern char _end;
  static char *heap_end;
  char *prev_heap_end;
  if (heap_end == 0) {
    heap_end = &_end;
  }
  prev_heap_end = heap_end;
  if (heap_end + incr > SP) {
    return 0;
  }
  heap_end += incr;
  return prev_heap_end;
}


x86 assembly (clang, -O0):
<_sbrk_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpq   $0x0,0x2f19(%rip)
jne    1123 <_sbrk_r+0x23>
mov    0x2ecc(%rip),%rax
mov    %rax,0x2f05(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ef3(%rip),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
cmp    -0x18(%rbp),%rax
jbe    1153 <_sbrk_r+0x53>
movq   $0x0,-0x8(%rbp)
jmp    1172 <_sbrk_r+0x72>
mov    -0xc(%rbp),%ecx
mov    0x2ecb(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ebe(%rip)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sbrk_r>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
jne    1113 <_sbrk_r+0x13>
mov    0x2ed5(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f08(%rip)
ret

LLVM IR (-O0):
@_sbrk_r.heap_end = internal global i8* null
@_end = external global i8
define i8* @_sbrk_r(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
%6 = load i8*, i8** @_sbrk_r.heap_end
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* @_end, i8** @_sbrk_r.heap_end
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** @_sbrk_r.heap_end
store i8* %10, i8** %5
%11 = load i8*, i8** @_sbrk_r.heap_end
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %4
%16 = icmp ugt i8* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %9
store i8* null, i8** %2
br label %24
18: ; preds = %9
%19 = load i32, i32* %3
%20 = load i8*, i8** @_sbrk_r.heap_end
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8* %22, i8** @_sbrk_r.heap_end
%23 = load i8*, i8** %5
store i8* %23, i8** %2
br label %24
24: ; preds = %18, %17
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
@_sbrk_r.heap_end = internal unnamed_addr global i8* null
@_end = external global i8
define i8* @_sbrk_r(i32 %0) {
%2 = load i8*, i8** @_sbrk_r.heap_end
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* @_end, i8* %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8* %6, i8** @_sbrk_r.heap_end
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("sparc"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"sparc\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_list();
int /*<<< orphan*/ populate();
int /*<<< orphan*/ print_node(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ random_element();
void test_random_element() {
  printf(
      "====================================================================\n");
  printf("TESTING RANDOM ELEMENT...\n");
  populate();
  print_node(random_element());
  free_list();
}


x86 assembly (clang, -O0):
<test_random_element>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <populate@plt>
mov    $0x0,%al
call   1040 <random_element@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
mov    $0x0,%al
call   1060 <free_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_random_element>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <populate@plt>
xor    %eax,%eax
call   1040 <random_element@plt>
mov    %eax,%edi
call   1070 <print_node@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <free_list@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"====================================================================\0A\00"
@.str.1 = [27 x i8] c"TESTING RANDOM ELEMENT...\0A\00"
define void @test_random_element() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @populate()
%4 = call i32 (...) @random_element()
%5 = call i32 @print_node(i32 %4)
%6 = call i32 (...) @free_list()
ret void
}

LLVM IR (-O2):
@str = [69 x i8] c"====================================================================\00"
@str.2 = [26 x i8] c"TESTING RANDOM ELEMENT...\00"
define void @test_random_element() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @populate()
%4 = tail call i32 (...) @random_element()
%5 = tail call i32 @print_node(i32 %4)
%6 = tail call i32 (...) @free_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chown(char *, int, int /*<<< orphan*/);
int main() {
  char fn[] = "./temp.file";
  chown(fn, 25, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x662e706d65742f2e,%rax
70 2e 66
mov    %rax,0x8(%rsp)
movl   $0x656c69,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x19,%esi
xor    %edx,%edx
call   1030 <chown@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.fn = [12 x i8] c"./temp.file\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @chown(i8* %4, i32 25, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.fn = [12 x i8] c"./temp.file\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @chown(i8* %2, i32 25, i32 0)
ret i32 0
}
void fc103(int n) {
  {
    typedef int(*b)[n];
  a : {
    typedef int(*c)[n];
    0;
  }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    goto a;
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc103>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc103+0x7>

x86 assembly (clang, -O2):
<fc103>:
jmp    1100 <fc103>

LLVM IR (-O0):
define void @fc103(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
br label %5
5: ; preds = %5, %1
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %5
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc103(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int isNumber(const char *str) {
  for (; *str; str += 1)
    if (*str < '0' || '9' < *str)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <isNumber+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1139 <isNumber+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x39,%eax
cmp    %ecx,%eax
jge    1145 <isNumber+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isNumber+0x62>
jmp    114a <isNumber+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isNumber+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <isNumber+0x23>
add    $0x1,%rdi
nop
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <isNumber+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isNumber+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -58
%11 = icmp ult i8 %10, -10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void rotr(int *a, int *b, int *c) {
  int s, y;
  s = *a;
  y = *b;
  *a = *c;
  *b = s;
  *c = y;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%r8d
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
store i32 %12, i32* %8
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %1
store i32 %5, i32* %2
ret void
}
int SIZE(int c) {
  if (c == 1)
    return 1;
  if (c == 2)
    return 1;
  if (c == 4 || c == 5 || c == 6)
    return 4;
  if (c == 3)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<SIZE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <SIZE+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    117a <SIZE+0x7a>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <SIZE+0x33>
movl   $0x1,-0x4(%rbp)
jmp    117a <SIZE+0x7a>
cmpl   $0x4,-0x8(%rbp)
je     1151 <SIZE+0x51>
cmpl   $0x5,-0x8(%rbp)
je     1151 <SIZE+0x51>
cmpl   $0x6,-0x8(%rbp)
jne    115d <SIZE+0x5d>
movl   $0x4,-0x4(%rbp)
jmp    117a <SIZE+0x7a>
cmpl   $0x3,-0x8(%rbp)
jne    1173 <SIZE+0x73>
movl   $0x0,-0x4(%rbp)
jmp    117a <SIZE+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIZE>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jb     1127 <SIZE+0x27>
add    $0xfffffffd,%edi
mov    $0xffffffff,%eax
cmp    $0x3,%edi
ja     1127 <SIZE+0x27>
movslq %edi,%rax
lea    0xedc(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.SIZE = [4 x i32] [i32 0, i32 4, i32 4, i32 4]
define i32 @SIZE(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i32 %0, -3
%6 = icmp ult i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.SIZE, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ], [ -1, %4 ]
ret i32 %12
}
void *atomic_compare_and_swap(void **ptr, void *oldval, void *newval) {
  newval = __sync_val_compare_and_swap(ptr, oldval, newval);
  return newval;
}


x86 assembly (clang, -O0):
<atomic_compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_compare_and_swap(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = bitcast i8** %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 0
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @atomic_compare_and_swap(i8** nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 0
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void trb_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<trb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <trb_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trb_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @trb_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @trb_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  int num = 5;
  float numTwo = 4.5;
  double numThree = 5.52;
  double test;
  printf("The first num is %d", num);
  printf("The not defined var is %f", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"The first num is %d\00"
@.str.1 = [26 x i8] c"The not defined var is %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i32 5, i32* %2
store float 4.500000e+00, float* %3
store double 5.520000e+00, double* %4
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load double, double* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"The first num is %d\00"
@.str.1 = [26 x i8] c"The not defined var is %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double undef)
ret i32 0
}
/* Variables and functions */
void *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int strlen(int /*<<< orphan*/);
int main() {
  void *t = malloc(0);
  printf("%x\n", t);
  printf("%d\n", strlen(0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <malloc@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <strlen@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i8* @malloc(i32 0)
%2 = ptrtoint i8* %1 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strlen(i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct virtual_machine_object {
  int dummy;
};
struct virtual_machine {
  int dummy;
};

/* Variables and functions */
struct virtual_machine_object *
virtual_machine_object_type_new_with_value_and_raw_name(
    struct virtual_machine *, int /*<<< orphan*/ const, int /*<<< orphan*/ *,
    int /*<<< orphan*/);
struct virtual_machine_object *
virtual_machine_object_type_new_with_value(struct virtual_machine *vm,
                                           const uint32_t value) {
  return virtual_machine_object_type_new_with_value_and_raw_name(vm, value,
                                                                 NULL, 0);
}


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

x86 assembly (clang, -O2):
<virtual_machine_object_type_new_with_value>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <virtual_machine_object_type_new_with_value_and_raw_name@plt>

LLVM IR (-O0):
%struct.virtual_machine_object = type { i32 }
%struct.virtual_machine = type { i32 }
define %struct.virtual_machine_object* @virtual_machine_object_type_new_with_value(%struct.virtual_machine* %0, i32 %1) {
%3 = alloca %struct.virtual_machine*
%4 = alloca i32
store %struct.virtual_machine* %0, %struct.virtual_machine** %3
store i32 %1, i32* %4
%5 = load %struct.virtual_machine*, %struct.virtual_machine** %3
%6 = load i32, i32* %4
%7 = call %struct.virtual_machine_object* @virtual_machine_object_type_new_with_value_and_raw_name(%struct.virtual_machine* %5, i32 %6, i32* null, i32 0)
ret %struct.virtual_machine_object* %7
}

LLVM IR (-O2):
%struct.virtual_machine_object = type { i32 }
%struct.virtual_machine = type { i32 }
define %struct.virtual_machine_object* @virtual_machine_object_type_new_with_value(%struct.virtual_machine* %0, i32 %1) {
%3 = tail call %struct.virtual_machine_object* @virtual_machine_object_type_new_with_value_and_raw_name(%struct.virtual_machine* %0, i32 %1, i32* null, i32 0)
ret %struct.virtual_machine_object* %3
}