xunge/DecIR huggingface dataset:
/* Type definitions */
struct pt_time_cal {
  int dummy;
};
struct pt_packet_tma {
  int dummy;
};
struct pt_config {
  int dummy;
};

/* Variables and functions */
int pt_tcal_update_tma(struct pt_time_cal *tcal,
                       const struct pt_packet_tma *packet,
                       const struct pt_config *config) {
  (void)tcal;
  (void)packet;
  (void)config;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pt_time_cal = type { i32 }
%struct.pt_packet_tma = type { i32 }
%struct.pt_config = type { i32 }
define i32 @pt_tcal_update_tma(%struct.pt_time_cal* %0, %struct.pt_packet_tma* %1, %struct.pt_config* %2) {
%4 = alloca %struct.pt_time_cal*
%5 = alloca %struct.pt_packet_tma*
%6 = alloca %struct.pt_config*
store %struct.pt_time_cal* %0, %struct.pt_time_cal** %4
store %struct.pt_packet_tma* %1, %struct.pt_packet_tma** %5
store %struct.pt_config* %2, %struct.pt_config** %6
%7 = load %struct.pt_time_cal*, %struct.pt_time_cal** %4
%8 = load %struct.pt_packet_tma*, %struct.pt_packet_tma** %5
%9 = load %struct.pt_config*, %struct.pt_config** %6
ret i32 0
}

LLVM IR (-O2):
%struct.pt_time_cal = type { i32 }
%struct.pt_packet_tma = type { i32 }
%struct.pt_config = type { i32 }
define i32 @pt_tcal_update_tma(%struct.pt_time_cal* nocapture readnone %0, %struct.pt_packet_tma* nocapture readnone %1, %struct.pt_config* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
int AF_INET;
char *inet_ntoa(int /*<<< orphan*/);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, ...);
void check_source(int data_len, struct sockaddr *sa_source, int sa_len) {
  if (0) {
    struct sockaddr_in *sa_in = (struct sockaddr_in *)sa_source;
    printf("packet of length %d received\n", data_len);
    if (sa_source->sa_family == AF_INET) {
      printf("Source: INET Port %d host %s\n", ntohs(sa_in->sin_port),
             inet_ntoa(sa_in->sin_addr));
    } else {
      printf("Source: Address family %d\n", sa_source->sa_family);
    }
  }
}


x86 assembly (clang, -O0):
<check_source>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
define void @check_source(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
define void @check_source(i32 %0, %struct.sockaddr* nocapture %1, i32 %2) {
ret void
}
int main() {
  int a, b, c;
  a = 12;
  b = a + 8;
  c = a - b + 4;
  if (a > c) {
    a = b * 4 + 5;
  } else {
    a = 5 + 6;
    b = c + 4 * a;
  }
  a = c + 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1144 <main+0x44>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x59>
movl   $0xb,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int Degree(unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
void DisplayHex(unsigned a[]) {
  int i;
  i = Degree(a);
  while (i >= 0)
    printf("%4.4x ", a[i--]);
  printf("\n");
}


x86 assembly (clang, -O0):
<DisplayHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Degree@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116a <DisplayHex+0x4a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1138 <DisplayHex+0x18>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayHex>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1050 <Degree@plt>
test   %eax,%eax
js     1164 <DisplayHex+0x34>
mov    %eax,%ebx
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1150 <DisplayHex+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%4.4x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @DisplayHex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @Degree(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, -1
store i32 %12, i32* %3
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %6
17: ; preds = %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%4.4x \00"
define void @DisplayHex(i32* %0) {
%2 = tail call i32 @Degree(i32* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1
%14 = tail call i32 @putchar(i32 10)
ret void
}
int is_temp(char *id) { return ((id[0] == 't') && (id[1] == '_')); }


x86 assembly (clang, -O0):
<is_temp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x74,%ecx
mov    %al,-0x9(%rbp)
jne    112e <is_temp+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_temp>:
xor    %eax,%eax
cmpb   $0x74,(%rdi)
jne    1110 <is_temp+0x10>
xor    %eax,%eax
cmpb   $0x5f,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_temp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 116
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_temp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 116
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 95
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ test37_a();
scalar_t__ test37_b();
int test37() {
  int identifier;
  if ((test37_a() && (identifier = 1)) || (test37_b() && (identifier = 2))) {
    return identifier;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test37>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test37_a@plt>
cmp    $0x0,%rax
je     114a <test37+0x2a>
movl   $0x1,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1171 <test37+0x51>
mov    $0x0,%al
call   1030 <test37_b@plt>
cmp    $0x0,%rax
je     117c <test37+0x5c>
movl   $0x2,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1171 <test37+0x51>
jmp    117c <test37+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <test37+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test37>:
push   %rax
xor    %eax,%eax
call   1040 <test37_a@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <test37+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <test37_b@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test37() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @test37_a()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %2
br i1 true, label %10, label %6
6: ; preds = %5, %0
%7 = call i64 (...) @test37_b()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
store i32 2, i32* %2
br i1 true, label %10, label %12
10: ; preds = %9, %5
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %13
12: ; preds = %9, %6
store i32 0, i32* %1
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @test37() {
%1 = tail call i64 (...) @test37_a()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @test37_b()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 2
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
unsigned long long int
unsignedlonglongint_ignoring_unsignedint(unsigned long long int x,
                                         unsigned int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglongint_ignoring_unsignedint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_unsignedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_string_field(char **s) {
  if (*s) {
    free(*s);
    *s = 0;
  }
}


x86 assembly (clang, -O0):
<free_string_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <free_string_field+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_string_field>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <free_string_field+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_string_field(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000014))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<SSIIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x14(%rcx)
ret

LLVM IR (-O0):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
int void_command(int argc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<void_command>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @void_command(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void test() {
  unsigned long long tmp_ULLi;
  unsigned int tmp_Ui;
  void *tmp_vp;
  tmp_ULLi = 0;
  tmp_Ui = 0;
  tmp_vp = 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i8*
store i64 0, i64* %1
store i32 0, i32* %2
store i8* null, i8** %3
ret void
}

LLVM IR (-O2):
define void @test() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int LOG_NDELAY;
int LOG_PERROR;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void log_open(char const *prog, int32_t log2stderr) {
  openlog(prog, LOG_PID | LOG_NDELAY | (log2stderr ? LOG_PERROR : 0), LOG_USER);
}


x86 assembly (clang, -O0):
<log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    0x2e88(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <log_open+0x49>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <log_open+0x53>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <log_open+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%eax
or     %eax,%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open>:
mov    %rsi,%rax
mov    0x2eb6(%rip),%rcx
mov    0x2e9f(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
xor    %ecx,%ecx
test   %rax,%rax
je     1135 <log_open+0x25>
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
or     %ecx,%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
define void @log_open(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @LOG_PID
%7 = load i32, i32* @LOG_NDELAY
%8 = or i32 %6, %7
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @LOG_PERROR
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 0, %13 ]
%16 = or i32 %8, %15
%17 = load i32, i32* @LOG_USER
%18 = call i32 @openlog(i8* %5, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
define void @log_open(i8* %0, i64 %1) {
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_NDELAY
%5 = or i32 %4, %3
%6 = icmp eq i64 %1, 0
%7 = load i32, i32* @LOG_PERROR
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %5, %8
%10 = load i32, i32* @LOG_USER
%11 = tail call i32 @openlog(i8* %0, i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getpt() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getpt>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__getpt() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getpt() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
long core___core__Byte___Object__object_id(unsigned char self) {
  long var;
  long var1;
  var1 = (long)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Byte___Object__object_id>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @core___core__Byte___Object__object_id(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i64
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @core___core__Byte___Object__object_id(i8 zeroext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void test_cleanup(void) { remove("tmp/transmute/a"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"tmp/transmute/a\00"
define void @test_cleanup() {
%1 = call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"tmp/transmute/a\00"
define void @test_cleanup() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ varDeclar();
int /*<<< orphan*/ varInit();
int main() {
  varDeclar();
  varInit();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @varDeclar()
%3 = call i32 (...) @varInit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @varDeclar()
%2 = tail call i32 (...) @varInit()
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_stat;
int syscall(int /*<<< orphan*/, char const *, struct stat *);
int stat(const char *path, struct stat *buf) {
  return syscall(SYS_stat, path, buf);
}


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

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@SYS_stat = global i32 0
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @SYS_stat
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @syscall(i32 %5, i8* %6, %struct.stat* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@SYS_stat = global i32 0
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* @SYS_stat
%4 = tail call i32 @syscall(i32 %3, i8* %0, %struct.stat* %1)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_vgaentry(char character, uint8_t color_mode) {
  uint16_t character16 = character;
  uint16_t color_mode16 = color_mode;
  return character16 | color_mode16 << 8;
}


x86 assembly (clang, -O0):
<get_vgaentry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vgaentry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_vgaentry(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_vgaentry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
void uint2_char(unsigned int i, unsigned char *p) {
  p[0] = (i >> 8) & 255;
  p[1] = (i)&255;
  return;
}


x86 assembly (clang, -O0):
<uint2_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint2_char>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

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

LLVM IR (-O2):
define void @uint2_char(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Plasma (C) 2004 Panayotis Katsaloulis "
                "http://www.panayotis.com under GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Plasma (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x4d,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x4d,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Plasma (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [77 x i8] c"Plasma (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(77) i8* @malloc(i64 77)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i64 77)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ConvertCharToStringStack(char *, char);
int IndexOf_internal(char *, char *, char const, char const);
int IndexOfChar_internal(char *input, char target, const char openSymbolWithin,
                         const char closeSymbolWithin) {
  char target2[2];
  ConvertCharToStringStack(target2, target);
  int output =
      IndexOf_internal(input, target2, openSymbolWithin, closeSymbolWithin);
  return output;
}


x86 assembly (clang, -O0):
<IndexOfChar_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
lea    -0xd(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <ConvertCharToStringStack@plt>
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
mov    -0xa(%rbp),%al
movsbl %al,%edx
movsbl -0xb(%rbp),%ecx
call   1030 <IndexOf_internal@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IndexOfChar_internal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rdi,%rbx
lea    0x6(%rsp),%r15
mov    %r15,%rdi
call   1040 <ConvertCharToStringStack@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <IndexOf_internal@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IndexOfChar_internal(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [2 x i8]
%10 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%12 = load i8, i8* %6
%13 = call i32 @ConvertCharToStringStack(i8* %11, i8 signext %12)
%14 = load i8*, i8** %5
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%16 = load i8, i8* %7
%17 = load i8, i8* %8
%18 = call i32 @IndexOf_internal(i8* %14, i8* %15, i8 signext %16, i8 signext %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @IndexOfChar_internal(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca [2 x i8]
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = call i32 @ConvertCharToStringStack(i8* %6, i8 signext %1)
%8 = call i32 @IndexOf_internal(i8* %0, i8* %6, i8 signext %2, i8 signext %3)
ret i32 %8
}
unsigned short get_cs(void) {
  unsigned short cs;
  asm volatile("mov %%cs, %0" : "=r"(cs));
  return cs;
}


x86 assembly (clang, -O0):
<get_cs>:
push   %rbp
mov    %rsp,%rbp
mov    %cs,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cs>:
mov    %cs,%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_cs() {
%1 = alloca i16
%2 = call i16 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @get_cs() {
%1 = tail call i16 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i16 %1
}
/* Variables and functions */
int rand();
int get_rand_int(int low_incl, int high_excl) {
  int r;
  int range;
  if (low_incl > high_excl)
    return 0;
  r = rand();
  range = high_excl - low_incl;
  return (r % range) + low_incl;
}


x86 assembly (clang, -O0):
<get_rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1136 <get_rand_int+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1156 <get_rand_int+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
add    -0x8(%rbp),%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
xor    %eax,%eax
sub    %edi,%ebp
jl     112b <get_rand_int+0x1b>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_rand_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = sub nsw i32 %1, %0
%7 = srem i32 %5, %6
%8 = add nsw i32 %7, %0
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
void g_date_add_years() {}


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

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

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

LLVM IR (-O2):
define void @g_date_add_years() {
ret void
}
unsigned int f10(unsigned int x, long int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f10(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %9, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f10(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 32, %3
%6 = lshr i32 %0, %5
%7 = or i32 %6, %4
ret i32 %7
}
void gd_null_pointer_function(void) {}


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

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

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

LLVM IR (-O2):
define void @gd_null_pointer_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dfs(char **);
int /*<<< orphan*/ init(char **);
void solveSudoku(char **board, int boardRowSize, int boardColSize) {
  init(board);
  dfs(board);
}


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

x86 assembly (clang, -O2):
<solveSudoku>:
push   %rbx
mov    %rdi,%rbx
call   1030 <init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dfs@plt>

LLVM IR (-O0):
define void @solveSudoku(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 = call i32 @init(i8** %7)
%9 = load i8**, i8*** %4
%10 = call i32 @dfs(i8** %9)
ret void
}

LLVM IR (-O2):
define void @solveSudoku(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @init(i8** %0)
%5 = tail call i32 @dfs(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cga_init();
int /*<<< orphan*/ serial_init();
void cons_init(void) {
  cga_init();
  serial_init();
}


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

x86 assembly (clang, -O2):
<cons_init>:
push   %rax
xor    %eax,%eax
call   1030 <cga_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <serial_init@plt>

LLVM IR (-O0):
define void @cons_init() {
%1 = call i32 (...) @cga_init()
%2 = call i32 (...) @serial_init()
ret void
}

LLVM IR (-O2):
define void @cons_init() {
%1 = tail call i32 (...) @cga_init()
%2 = tail call i32 (...) @serial_init()
ret void
}
int Mepg2FrameRateNomi_(unsigned char code) {
  switch (code & 0x0f) {
  case 1:
    return 24000;
  case 2:
    return 24;
  case 3:
    return 25;
  case 4:
    return 30000;
  case 5:
    return 30;
  case 6:
    return 50;
  case 7:
    return 60000;
  case 8:
    return 60;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Mepg2FrameRateNomi_>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1197 <Mepg2FrameRateNomi_+0x97>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5dc0,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x18,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x19,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x7530,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x1e,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x32,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0xea60,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x3c,-0x4(%rbp)
jmp    119e <Mepg2FrameRateNomi_+0x9e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mepg2FrameRateNomi_>:
and    $0xf,%edi
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     111a <Mepg2FrameRateNomi_+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @Mepg2FrameRateNomi_(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
]
7: ; preds = %1
store i32 24000, i32* %2
br label %16
8: ; preds = %1
store i32 24, i32* %2
br label %16
9: ; preds = %1
store i32 25, i32* %2
br label %16
10: ; preds = %1
store i32 30000, i32* %2
br label %16
11: ; preds = %1
store i32 30, i32* %2
br label %16
12: ; preds = %1
store i32 50, i32* %2
br label %16
13: ; preds = %1
store i32 60000, i32* %2
br label %16
14: ; preds = %1
store i32 60, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table.Mepg2FrameRateNomi_ = [8 x i32] [i32 24000, i32 24, i32 25, i32 30000, i32 30, i32 50, i32 60000, i32 60]
define i32 @Mepg2FrameRateNomi_(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i32
%4 = add nsw i32 %3, -1
%5 = icmp ult i32 %4, 8
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.Mepg2FrameRateNomi_, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void gpio1_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @gpio1_iomux_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long, long);
long i_fib(int n) {
  long a = 1, b = 1;
  long c;
  long counter;
  for (counter = 0; counter < n - 3; counter++) {
    printf(" a : %ld , b : %ld , c : %ld \n", a, b, c);
    c = a + b;
    a = b;
    b = c;
  }
  return c;
}


x86 assembly (clang, -O0):
<i_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jge    118e <i_fib+0x7e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1133 <i_fib+0x23>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c" a : %ld , b : %ld , c : %ld \0A\00"
define i64 @i_fib(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %2
store i64 1, i64* %3
store i64 1, i64* %4
store i64 0, i64* %6
br label %7
7: ; preds = %23, %1
%8 = load i64, i64* %6
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 3
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %8, %11
br i1 %12, label %13, label %26
13: ; preds = %7
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %15, i64 %16)
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = add nsw i64 %18, %19
store i64 %20, i64* %5
%21 = load i64, i64* %4
store i64 %21, i64* %3
%22 = load i64, i64* %5
store i64 %22, i64* %4
br label %23
23: ; preds = %13
%24 = load i64, i64* %6
%25 = add nsw i64 %24, 1
store i64 %25, i64* %6
br label %7
26: ; preds = %7
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
define i64 @i_fib(i32 %0) {
%2 = icmp slt i32 %0, 4
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_pty(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_pty>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_pty(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int config_WEBIF(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_WEBIF() {
ret i32 0
}
void g_signal_list_ids() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pdf_add_tree_element(struct pdf_name_tree *,
                                        struct pdf_obj *, struct pdf_obj *);
struct pdf_obj *pdf_new_integer(long);
void pdf_add_number_tree_element(struct pdf_name_tree *tree, long key,
                                 struct pdf_obj *val) {
  struct pdf_obj *key_obj = pdf_new_integer(key);
  pdf_add_tree_element(tree, key_obj, val);
}


x86 assembly (clang, -O0):
<pdf_add_number_tree_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pdf_new_integer@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <pdf_add_tree_element@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_add_number_tree_element>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <pdf_new_integer@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pdf_add_tree_element@plt>

LLVM IR (-O0):
%struct.pdf_name_tree = type { i32 }
%struct.pdf_obj = type { i32 }
define void @pdf_add_number_tree_element(%struct.pdf_name_tree* %0, i64 %1, %struct.pdf_obj* %2) {
%4 = alloca %struct.pdf_name_tree*
%5 = alloca i64
%6 = alloca %struct.pdf_obj*
%7 = alloca %struct.pdf_obj*
store %struct.pdf_name_tree* %0, %struct.pdf_name_tree** %4
store i64 %1, i64* %5
store %struct.pdf_obj* %2, %struct.pdf_obj** %6
%8 = load i64, i64* %5
%9 = call %struct.pdf_obj* @pdf_new_integer(i64 %8)
store %struct.pdf_obj* %9, %struct.pdf_obj** %7
%10 = load %struct.pdf_name_tree*, %struct.pdf_name_tree** %4
%11 = load %struct.pdf_obj*, %struct.pdf_obj** %7
%12 = load %struct.pdf_obj*, %struct.pdf_obj** %6
%13 = call i32 @pdf_add_tree_element(%struct.pdf_name_tree* %10, %struct.pdf_obj* %11, %struct.pdf_obj* %12)
ret void
}

LLVM IR (-O2):
%struct.pdf_name_tree = type { i32 }
%struct.pdf_obj = type { i32 }
define void @pdf_add_number_tree_element(%struct.pdf_name_tree* %0, i64 %1, %struct.pdf_obj* %2) {
%4 = tail call %struct.pdf_obj* @pdf_new_integer(i64 %1)
%5 = tail call i32 @pdf_add_tree_element(%struct.pdf_name_tree* %0, %struct.pdf_obj* %4, %struct.pdf_obj* %2)
ret void
}
fclose2(x) {
  x ? 1 : 2;
  x ?: 5;
  q();
}


x86 assembly (clang, -O0):
<fclose2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     112c <fclose2+0x1c>
jmp    1131 <fclose2+0x21>
jmp    1131 <fclose2+0x21>
mov    $0x0,%al
call   1030 <q@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fclose2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 2
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %10
%13 = phi i32 [ %8, %10 ], [ 5, %11 ]
%14 = call i32 (...) @q()
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fclose2(i32 %0) {
%2 = tail call i32 (...) @q()
ret i32 undef
}
void foo089(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo089(i32 %0) {
ret void
}
int rcu_lockdep_is_held_nocb(struct rcu_data *rdp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rcu_data = type opaque
define i32 @rcu_lockdep_is_held_nocb(%struct.rcu_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_string(char *);
gen_immediate_a() { output_string("\tla\t$v0, "); }


x86 assembly (clang, -O0):
<gen_immediate_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_string@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"\09la\09$v0, \00"
define i32 @gen_immediate_a() {
%1 = alloca i32
%2 = call i32 @output_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09la\09$v0, \00"
define i32 @gen_immediate_a() {
%1 = tail call i32 @output_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}