xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (!ret)
    die("Out of memory; realloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Out of memory; realloc failed\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"Out of memory; realloc failed\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/, int);
int ws_strtol(const char *ptr, int offset, int base) {
  return strtol(ptr + offset, 0, base);
}


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

x86 assembly (clang, -O2):
<ws_strtol>:
movslq %esi,%rax
add    %rax,%rdi
xor    %esi,%esi
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @ws_strtol(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i32, i32* %6
%12 = call i32 @strtol(i8* %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @ws_strtol(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strtol(i8* %5, i32 0, i32 %2)
ret i32 %6
}
void cprop_test6(int *data) {
  int j = 5;
  if (data[0])
    data[1] = j * 10;
  else
    data[2] = j * 15;
  data[3] = j * 21;
}


x86 assembly (clang, -O0):
<cprop_test6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     112c <cprop_test6+0x2c>
imul   $0xa,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1137 <cprop_test6+0x37>
imul   $0xf,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
imul   $0x15,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test6>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    $0x4b,%ecx
mov    $0x32,%edx
cmove  %ecx,%edx
mov    %edx,0x4(%rdi,%rax,4)
movl   $0x69,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_test6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 75, i32 50
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 105, i32* %7
ret void
}
int main(void) { '\0'; }


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_log(char *);
int /*<<< orphan*/ quit();
void sig_pipe(int dummy) {
  my_log("POLYGLOT *** SIGPIPE Received ***\n");
  quit();
}


x86 assembly (clang, -O0):
<sig_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <my_log@plt>
mov    $0x0,%al
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pipe>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <my_log@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <quit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"POLYGLOT *** SIGPIPE Received ***\0A\00"
define void @sig_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @my_log(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @quit()
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"POLYGLOT *** SIGPIPE Received ***\0A\00"
define void @sig_pipe(i32 %0) {
%2 = tail call i32 @my_log(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @quit()
ret void
}
int test_imm_21uint32_reg(unsigned int val) {
  return ((val) & (0x21 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_21uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x21,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_21uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 33
%5 = icmp ne i32 %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_21uint32_reg(i32 %0) {
%2 = and i32 %0, 33
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((const)) _Bool is_power_of_2(unsigned long n) {
  return (n != 0 && ((n & (n - 1)) == 0));
}


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1110 <is_power_of_2+0x10>
lea    -0x1(%rdi),%rax
test   %rax,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i1 @is_power_of_2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp eq i64 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
ret i1 %12
}

LLVM IR (-O2):
define zeroext i1 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
br label %6
6: ; preds = %3, %1
%7 = phi i1 [ false, %1 ], [ %5, %3 ]
ret i1 %7
}
void ezs_dac_init() {}


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

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

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

LLVM IR (-O2):
define void @ezs_dac_init() {
ret void
}
int equals(char *str1, char *str2) {
  while (*str1 == *str2) {
    str1++;
    str2++;
    if ((*str1 == '\0') && (*str2 == '\0'))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    116b <equals+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1166 <equals+0x66>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1166 <equals+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1172 <equals+0x72>
jmp    110c <equals+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    112b <equals+0x2b>
mov    $0x1,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%r8d
movzbl (%rsi,%rcx,1),%r9d
mov    %r8d,%edx
or     %r9b,%dl
je     112c <equals+0x2c>
add    $0x1,%rcx
cmp    %r9b,%r8b
je     1110 <equals+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equals(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2, %16
%7 = phi i8* [ %10, %16 ], [ %1, %2 ]
%8 = phi i8* [ %9, %16 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %18, label %16
16: ; preds = %6
%17 = icmp eq i8 %11, %13
br i1 %17, label %6, label %18
18: ; preds = %16, %6, %2
%19 = phi i32 [ 0, %2 ], [ 0, %16 ], [ 1, %6 ]
ret i32 %19
}
union tree_node *TREE_CHAIN(union tree_node *t) {}


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

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

LLVM IR (-O0):
%union.tree_node = type opaque
define %union.tree_node* @TREE_CHAIN(%union.tree_node* %0) {
%2 = alloca %union.tree_node*
%3 = alloca %union.tree_node*
store %union.tree_node* %0, %union.tree_node** %3
%4 = load %union.tree_node*, %union.tree_node** %2
ret %union.tree_node* %4
}

LLVM IR (-O2):
%union.tree_node = type opaque
define noalias %union.tree_node* @TREE_CHAIN(%union.tree_node* nocapture readnone %0) {
ret %union.tree_node* undef
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn63() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn63");
  return result;
}


x86 assembly (clang, -O0):
<fn63>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn63>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn63\00"
define i8* @fn63() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn63\00"
define i8* @fn63() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("alo mundo");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"alo mundo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"alo mundo\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main(void) {
  "x";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_73int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x73 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_73int64_highword_mem>:
testb  $0x73,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_73int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 493921239040
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int security_msg_queue_msgsnd(struct msg_queue *msq, struct msg_msg *msg,
                              int msgid, int msgflg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.msg_queue = type opaque
%struct.msg_msg = type opaque
define i32 @security_msg_queue_msgsnd(%struct.msg_queue* %0, %struct.msg_msg* %1, i32 %2, i32 %3) {
%5 = alloca %struct.msg_queue*
%6 = alloca %struct.msg_msg*
%7 = alloca i32
%8 = alloca i32
store %struct.msg_queue* %0, %struct.msg_queue** %5
store %struct.msg_msg* %1, %struct.msg_msg** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.msg_queue = type opaque
%struct.msg_msg = type opaque
define i32 @security_msg_queue_msgsnd(%struct.msg_queue* nocapture readnone %0, %struct.msg_msg* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
void rop3_55_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_55_0_0>:
or     (%rdi),%dl
and    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_55_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_55_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freelist_test_internal_popping();
int /*<<< orphan*/ freelist_test_internal_popping_and_pushing();
int /*<<< orphan*/ freelist_test_internal_pushing();
int /*<<< orphan*/ freelist_test_internal_rapid_popping_and_pushing();
int /*<<< orphan*/ printf(char *);
void test_lfds611_freelist(void) {
  printf("\n"
         "Freelist Tests\n"
         "==============\n");
  freelist_test_internal_popping();
  freelist_test_internal_pushing();
  freelist_test_internal_popping_and_pushing();
  freelist_test_internal_rapid_popping_and_pushing();
  return;
}


x86 assembly (clang, -O0):
<test_lfds611_freelist>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <freelist_test_internal_popping@plt>
mov    $0x0,%al
call   1040 <freelist_test_internal_pushing@plt>
mov    $0x0,%al
call   1050 <freelist_test_internal_popping_and_pushing@plt>
mov    $0x0,%al
call   1070 <freelist_test_internal_rapid_popping_and_pushing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lfds611_freelist>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <freelist_test_internal_popping@plt>
xor    %eax,%eax
call   1040 <freelist_test_internal_pushing@plt>
xor    %eax,%eax
call   1050 <freelist_test_internal_popping_and_pushing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <freelist_test_internal_rapid_popping_and_pushing@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AFreelist Tests\0A==============\0A\00"
define void @test_lfds611_freelist() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @freelist_test_internal_popping()
%3 = call i32 (...) @freelist_test_internal_pushing()
%4 = call i32 (...) @freelist_test_internal_popping_and_pushing()
%5 = call i32 (...) @freelist_test_internal_rapid_popping_and_pushing()
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"\0AFreelist Tests\0A==============\00"
define void @test_lfds611_freelist() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @freelist_test_internal_popping()
%3 = tail call i32 (...) @freelist_test_internal_pushing()
%4 = tail call i32 (...) @freelist_test_internal_popping_and_pushing()
%5 = tail call i32 (...) @freelist_test_internal_rapid_popping_and_pushing()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_min_spatial_segmentation_idc(uint8_t *p, uint8_t val) {
  p[13] = 0xf0 | val;
}


x86 assembly (clang, -O0):
<h265hvcc_set_min_spatial_segmentation_idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
or     $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_min_spatial_segmentation_idc>:
or     $0xf0,%esi
mov    %esi,0x34(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_min_spatial_segmentation_idc(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 = or i32 240, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 13
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_min_spatial_segmentation_idc(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 240
%4 = getelementptr inbounds i32, i32* %0, i64 13
store i32 %3, i32* %4
ret void
}
void ff_hevc_put_hevc_bi_w_pel_pixels8_10_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
void m3_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  chr8setBank0(val << 13);
}


x86 assembly (clang, -O0):
<m3_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xd,%edi
call   1030 <chr8setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3_setParams>:
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <chr8setBank0@plt>

LLVM IR (-O0):
define void @m3_setParams(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 = shl i32 %6, 13
%8 = call i32 @chr8setBank0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m3_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @chr8setBank0(i32 %3)
ret void
}
/* Variables and functions */
float strtod(char const *, char **);
float strtof(const char *str, char **endptr) { return (strtod(str, endptr)); }


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

x86 assembly (clang, -O2):
<strtof>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define float @strtof(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 float @strtod(i8* %5, i8** %6)
ret float %7
}

LLVM IR (-O2):
define float @strtof(i8* %0, i8** nocapture %1) {
%3 = tail call float @strtod(i8* %0, i8** %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void jent_zfree(void *ptr, unsigned int len) {
  memset(ptr, 0, len);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<jent_zfree>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @jent_zfree(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct ntfs_fnd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fnd_clear(struct ntfs_fnd *);
int /*<<< orphan*/ kfree(struct ntfs_fnd *);
void fnd_put(struct ntfs_fnd *fnd) {
  if (fnd) {
    fnd_clear(fnd);
    kfree(fnd);
  }
}


x86 assembly (clang, -O0):
<fnd_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <fnd_put+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <fnd_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnd_put>:
test   %rdi,%rdi
je     1137 <fnd_put+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <fnd_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <kfree@plt>
ret

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

LLVM IR (-O2):
%struct.ntfs_fnd = type { i32 }
define void @fnd_put(%struct.ntfs_fnd* %0) {
%2 = icmp eq %struct.ntfs_fnd* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @fnd_clear(%struct.ntfs_fnd* %0)
%5 = tail call i32 @kfree(%struct.ntfs_fnd* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int mpz_probab_prime_p(int /*<<< orphan*/, int);
int psp(mpz_t n) { return mpz_probab_prime_p(n, 1); }


x86 assembly (clang, -O0):
<psp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <mpz_probab_prime_p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psp>:
mov    $0x1,%esi
jmp    1030 <mpz_probab_prime_p@plt>

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

LLVM IR (-O2):
define i32 @psp(i32 %0) {
%2 = tail call i32 @mpz_probab_prime_p(i32 %0, i32 1)
ret i32 %2
}
void logit(int data_type, int display, const char *fmt, ...) {}


x86 assembly (clang, -O0):
<logit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @logit(i32 %0, i32 %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @logit(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *bar(int i) {
  char *s;
  s = (char *)malloc(50 * sizeof(char));
  sprintf(s, "sprintf %d", i);
  return s;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x32,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x32,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"sprintf %d\00"
define i8* @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 50)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"sprintf %d\00"
define i8* @bar(i32 %0) {
%2 = tail call i64 @malloc(i32 50)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
int main(void) {
  int num1 = 10;
  int num2 = 20;
  int **ptr1 = &num1;
  int *ptr2 = &num2;
  **ptr1 = 30;
  swapInPtr(&ptr1, &ptr2);
  printf("num1= %d, num2= %d\n", *ptr1, *ptr2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x1e,(%rax)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <swapInPtr@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0xa,(%rsp)
movl   $0x14,0x4(%rsp)
mov    %rsp,%rax
mov    %rax,0x10(%rsp)
lea    0x4(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    (%rsp),%rax
movl   $0x1e,(%rax)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <swapInPtr@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%rsi
mov    0x8(%rsp),%rax
mov    (%rax),%edx
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"num1= %d, num2= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32**
%4 = alloca i32*
%5 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%7 = bitcast i32*** %3 to i8*
%8 = bitcast i32*** %3 to i32**
store i32* %1, i32** %8
%9 = bitcast i32** %4 to i8*
store i32* %2, i32** %4
%10 = bitcast i32* %1 to i32**
%11 = load i32*, i32** %10
store i32 30, i32* %11
%12 = call i32 (i32***, i32**, ...) bitcast (i32 (...)* @swapInPtr to i32 (i32***, i32**, ...)*)(i32*** %3, i32** %4)
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %14, i32 %16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ParseRepeat();
void DoRepeat(void) { ParseRepeat(); }


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

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

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

LLVM IR (-O2):
define void @DoRepeat() {
%1 = tail call i32 (...) @ParseRepeat()
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int riva128_mmio_read_l(int, void *);
int /*<<< orphan*/ riva128_mmio_write_l(int, int, void *);
void riva128_mmio_write_w(uint32_t addr, uint16_t val, void *p) {
  uint32_t tmp;
  addr &= 0xffffff;
  tmp = riva128_mmio_read_l(addr, p);
  tmp &= ~(0xffff << ((addr & 2) << 4));
  tmp |= val << ((addr & 2) << 4);
  riva128_mmio_write_l(addr, tmp, p);
}


x86 assembly (clang, -O0):
<riva128_mmio_write_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <riva128_mmio_read_l@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shl    $0x4,%ecx
mov    $0xffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shl    $0x4,%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <riva128_mmio_write_l@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<riva128_mmio_write_w>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
and    $0xffffff,%ebx
mov    %ebx,%edi
mov    %rdx,%rsi
call   1030 <riva128_mmio_read_l@plt>
and    $0xffff0000,%eax
or     %eax,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <riva128_mmio_write_l@plt>

LLVM IR (-O0):
define void @riva128_mmio_write_w(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = and i32 %8, 16777215
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i8*, i8** %6
%12 = call i32 @riva128_mmio_read_l(i32 %10, i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = and i32 %13, 2
%15 = shl i32 %14, 4
%16 = shl i32 65535, %15
%17 = xor i32 %16, -1
%18 = load i32, i32* %7
%19 = and i32 %18, %17
store i32 %19, i32* %7
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = and i32 %21, 2
%23 = shl i32 %22, 4
%24 = shl i32 %20, %23
%25 = load i32, i32* %7
%26 = or i32 %25, %24
store i32 %26, i32* %7
%27 = load i32, i32* %4
%28 = load i32, i32* %7
%29 = load i8*, i8** %6
%30 = call i32 @riva128_mmio_write_l(i32 %27, i32 %28, i8* %29)
ret void
}

LLVM IR (-O2):
define void @riva128_mmio_write_w(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %0, 16777215
%5 = tail call i32 @riva128_mmio_read_l(i32 %4, i8* %2)
%6 = and i32 %5, -65536
%7 = or i32 %6, %1
%8 = tail call i32 @riva128_mmio_write_l(i32 %4, i32 %7, i8* %2)
ret void
}
/* Variables and functions */
int sleep(int);
void do_sleep(int seconds) {
  while (seconds > 0)
    seconds = sleep(seconds);
}


x86 assembly (clang, -O0):
<do_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1135 <do_sleep+0x25>
mov    -0x4(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x4(%rbp)
jmp    111b <do_sleep+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sleep>:
push   %rax
test   %edi,%edi
jle    112b <do_sleep+0x1b>
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <sleep@plt>
test   %eax,%eax
jg     1120 <do_sleep+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @do_sleep(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = tail call i32 @sleep(i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
double qcs_rande();
void qcs_fill_rande(int n, double *p) {
  int i;
  for (i = 0; i < n; i++)
    p[i] = qcs_rande();
}


x86 assembly (clang, -O0):
<qcs_fill_rande>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <qcs_fill_rande+0x44>
mov    $0x0,%al
call   1030 <qcs_rande@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <qcs_fill_rande+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcs_fill_rande>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <qcs_fill_rande+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <qcs_rande@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <qcs_fill_rande+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @qcs_fill_rande(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @qcs_rande()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XCirculateRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XCirculateRequestEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XCirculateRequestEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XCirculateRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XCirculateRequestEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XCirculateRequestEvent>:
test   %rdi,%rdi
je     112a <free_XCirculateRequestEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XCirculateRequestEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XCirculateRequestEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
unsigned dot_matrix_3x_generic_input_fmts(void) { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @dot_matrix_3x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @dot_matrix_3x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "VGM"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"VGM\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(void *, char const *);
scalar_t__ strlen(char const *);
void *xmalloc(scalar_t__);
char *xstrdup(const char *s) {
  void *ptr = xmalloc(strlen(s) + sizeof(char));
  strcpy(ptr, s);
  return (char *)ptr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ pc(char);
char *winend();
char *winstart();
void drawtext() {
  char *i;
  erase();
  move(0, 0);
  for (i = winstart(); i < winend(); i++)
    pc(*i);
}


x86 assembly (clang, -O0):
<drawtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <erase@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <winstart@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <winend@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jae    11af <drawtext+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <pc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <drawtext+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtext>:
push   %rbx
xor    %eax,%eax
call   1030 <erase@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <winstart@plt>
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <winend@plt>
cmp    %rax,%rbx
jae    118a <drawtext+0x3a>
movsbl (%rbx),%edi
call   1050 <pc@plt>
add    $0x1,%rbx
jmp    1170 <drawtext+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @drawtext() {
%1 = alloca i8*
%2 = call i32 (...) @erase()
%3 = call i32 @move(i32 0, i32 0)
%4 = call i8* (...) @winstart()
store i8* %4, i8** %1
br label %5
5: ; preds = %13, %0
%6 = load i8*, i8** %1
%7 = call i8* (...) @winend()
%8 = icmp ult i8* %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %1
%11 = load i8, i8* %10
%12 = call i32 @pc(i8 signext %11)
br label %13
13: ; preds = %9
%14 = load i8*, i8** %1
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %1
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @drawtext() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 @move(i32 0, i32 0)
%3 = tail call i8* (...) @winstart()
%4 = tail call i8* (...) @winend()
%5 = icmp ult i8* %3, %4
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = phi i8* [ %10, %6 ], [ %3, %0 ]
%8 = load i8, i8* %7
%9 = tail call i32 @pc(i8 signext %8)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = tail call i8* (...) @winend()
%12 = icmp ult i8* %10, %11
br i1 %12, label %6, label %13
13: ; preds = %6, %0
ret void
}