xunge/DecIR huggingface dataset:
int Ackerman(int m, int n) {
  if (m == 0)
    return n + 1;
  else if (n == 0)
    return Ackerman(m - 1, 1);
  else
    return Ackerman(m - 1, Ackerman(m, n - 1));
}


x86 assembly (clang, -O0):
<Ackerman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <Ackerman+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <Ackerman+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <Ackerman+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <Ackerman@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <Ackerman+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <Ackerman@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <Ackerman@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ackerman>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <Ackerman+0x2f>
mov    %edi,%ebx
jmp    112a <Ackerman+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <Ackerman+0x2f>
test   %eax,%eax
je     1120 <Ackerman+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <Ackerman@plt>
add    $0xffffffff,%ebx
jne    112a <Ackerman+0x1a>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Ackerman(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @Ackerman(i32 %9, i32 %16)
br label %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ts_packet_get_pcr_ex(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
uint64_t ts_packet_get_pcr(uint8_t *ts_packet) {
  uint64_t pcr_base;
  uint16_t pcr_ext;
  return ts_packet_get_pcr_ex(ts_packet, &pcr_base, &pcr_ext);
}


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

x86 assembly (clang, -O2):
<ts_packet_get_pcr>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <ts_packet_get_pcr_ex@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ts_packet_get_pcr(i32* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @ts_packet_get_pcr_ex(i32* %0, i32* %2, i32* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pfree(void *ap) { free(ap); }


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

x86 assembly (clang, -O2):
<pfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @pfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void os_start_sample(int x, int y, int z) {}


x86 assembly (clang, -O0):
<os_start_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @os_start_sample(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int strlen(char *);
int pit_arg_is_option(char **arg) {
  return *arg && (**arg == '-' || **arg == '/') && strlen(*arg) == 2;
}


x86 assembly (clang, -O0):
<pit_arg_is_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
je     116f <pit_arg_is_option+0x5f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     115a <pit_arg_is_option+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
jne    116f <pit_arg_is_option+0x5f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_arg_is_option>:
push   %rax
mov    (%rdi),%rdi
xor    %eax,%eax
test   %rdi,%rdi
je     1134 <pit_arg_is_option+0x24>
mov    (%rdi),%cl
or     $0x2,%cl
cmp    $0x2f,%cl
jne    1134 <pit_arg_is_option+0x24>
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pit_arg_is_option(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 %23
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %18, label %12
12: ; preds = %6
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 47
br i1 %17, label %18, label %23
18: ; preds = %12, %6
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = call i32 @strlen(i8* %20)
%22 = icmp eq i32 %21, 2
br label %23
23: ; preds = %18, %12, %1
%24 = phi i1 [ false, %12 ], [ false, %1 ], [ %22, %18 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @pit_arg_is_option(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i8, i8* %2
switch i8 %5, label %10 [
i8 45, label %6
i8 47, label %6
]
6: ; preds = %4, %4
%7 = tail call i32 @strlen(i8* %2)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6, %1
%11 = phi i32 [ 0, %1 ], [ %9, %6 ], [ 0, %4 ]
ret i32 %11
}
__attribute__((no, noclone)) int f1(long long d) {
  long long w = d / 0x1234567800000LL;
  return w;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x1234567800000,%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %rdi,%rax
movabs $0x38400001de20001,%rcx
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2a,%rdx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f1(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 320255972868096
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1(i64 %0) {
%2 = sdiv i64 %0, 320255972868096
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  printf("Hello world!\n");
  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>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str.1 = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
void inc(int *a) { (*a)++; }


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

x86 assembly (clang, -O2):
<inc>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @inc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @inc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void OneWireInit(uint32_t ui32Base, uint32_t ui32InitFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32InitFlags;
}


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

x86 assembly (clang, -O2):
<OneWireInit>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @OneWireInit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @OneWireInit(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
double KMtoMM(double KM) { return KM * 1000000; }


x86 assembly (clang, -O0):
<KMtoMM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<KMtoMM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KMtoMM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @KMtoMM(double %0) {
%2 = fmul double %0, 1.000000e+06
ret double %2
}
void __change_bit(long nr, volatile unsigned long *addr) {
  asm volatile("btc %1,%0" : "+m"(*(volatile long *)(addr)) : "Ir"(nr));
}


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

x86 assembly (clang, -O2):
<__change_bit>:
btc    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__change_bit(i64 %0, i64* %1) {
tail call void asm sideeffect "btc $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_ContentDirectory_GetSearchCapabilities(void *,
                                                                       char *);
int /*<<< orphan*/ printf(char *);
void UPnPContentDirectory_GetSearchCapabilities(void *upnptoken) {
  printf("Invoke: UPnPContentDirectory_GetSearchCapabilities();\r\n");
  UPnPResponse_ContentDirectory_GetSearchCapabilities(upnptoken,
                                                      "Sample String");
}


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

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

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

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [55 x i8] c"Invoke: UPnPContentDirectory_GetSearchCapabilities();\0D\00"
define void @UPnPContentDirectory_GetSearchCapabilities(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UPnPResponse_ContentDirectory_GetSearchCapabilities(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank1(int);
void vrc7setParamsA010(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank1(val << 10);
}


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

x86 assembly (clang, -O2):
<vrc7setParamsA010>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank1@plt>

LLVM IR (-O0):
define void @vrc7setParamsA010(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, 10
%8 = call i32 @chr1setBank1(i32 %7)
ret void
}

LLVM IR (-O2):
define void @vrc7setParamsA010(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank1(i32 %3)
ret void
}
/* Variables and functions */
void **_DtCvAddPtrToArray(void **, void *);
void **_DtHelpCeAddPtrToArray(void **array, void *ptr) {
  return (_DtCvAddPtrToArray(array, ptr));
}


x86 assembly (clang, -O0):
<_DtHelpCeAddPtrToArray>:
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 <_DtCvAddPtrToArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtHelpCeAddPtrToArray>:
jmp    1030 <_DtCvAddPtrToArray@plt>

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

LLVM IR (-O2):
define i8** @_DtHelpCeAddPtrToArray(i8** %0, i8* %1) {
%3 = tail call i8** @_DtCvAddPtrToArray(i8** %0, i8* %1)
ret i8** %3
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ do_operations();
int /*<<< orphan*/ parse_args1(int, char const **);
int /*<<< orphan*/ parse_args2(int, char const **);
int main(int argc, const char *argv[]) {
  parse_args1(argc, argv);
  parse_args2(argc, argv);
  do_operations();
  cleanup();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <parse_args1@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <parse_args2@plt>
xor    %eax,%eax
call   1040 <do_operations@plt>
xor    %eax,%eax
call   1060 <cleanup@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args1(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @parse_args2(i32 %9, i8** %10)
%12 = call i32 (...) @do_operations()
%13 = call i32 (...) @cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args1(i32 %0, i8** %1)
%4 = tail call i32 @parse_args2(i32 %0, i8** %1)
%5 = tail call i32 (...) @do_operations()
%6 = tail call i32 (...) @cleanup()
ret i32 0
}
void productArray(int *A, int N) {}


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

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

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

LLVM IR (-O2):
define void @productArray(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char stringvar[100];
  char *name = stringvar;
  printf("I am HAL, What is your name---> ");
  fgets(name, 100, stdin);
  printf("I can't open the pod bay doors, %s \n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    -0x78(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"I am HAL, What is your name---> \00"
@stdin = global i32 0
@.str.1 = [37 x i8] c"I can't open the pod bay doors, %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8* %4, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 100, i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"I am HAL, What is your name---> \00"
@stdin = global i32 0
@.str.1 = [37 x i8] c"I can't open the pod bay doors, %s \0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 100, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void ctest1(int *i, char *cData) { *i = 5; }


x86 assembly (clang, -O0):
<ctest1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest1>:
movl   $0x5,(%rdi)
ret

LLVM IR (-O0):
define void @ctest1(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
store i32 5, i32* %5
ret void
}

LLVM IR (-O2):
define void @ctest1(i32* nocapture writeonly %0, i8* nocapture readnone %1) {
store i32 5, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int i64range(int64_t x, int64_t lo, int64_t hi) {
  return (uint64_t)(x - lo) <= (uint64_t)(hi - lo);
}


x86 assembly (clang, -O0):
<i64range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i64range>:
xor    %eax,%eax
cmp    %rdx,%rdi
setle  %al
ret

LLVM IR (-O0):
define i32 @i64range(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = sub nsw i64 %10, %11
%13 = icmp sle i64 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @i64range(i64 %0, i64 %1, i64 %2) {
%4 = icmp sle i64 %0, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *base64_decode(size_t *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *base64_decode_cstr(size_t *len, const char *src) {
  return base64_decode(len, src, strlen(src));
}


x86 assembly (clang, -O0):
<base64_decode_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <base64_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <base64_decode@plt>

LLVM IR (-O0):
define i8* @base64_decode_cstr(i64* %0, i8* %1) {
%3 = alloca i64*
%4 = alloca i8*
store i64* %0, i64** %3
store i8* %1, i8** %4
%5 = load i64*, i64** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @base64_decode(i64* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @base64_decode_cstr(i64* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @base64_decode(i64* %0, i8* %1, i32 %3)
ret i8* %4
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *);
void tinyrl_crlf(struct tinyrl *this) { tinyrl_printf(this, "\n"); }


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

x86 assembly (clang, -O2):
<tinyrl_crlf>:
lea    0xee9(%rip),%rsi
jmp    1030 <tinyrl_printf@plt>

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @tinyrl_crlf(%struct.tinyrl* %0) {
%2 = alloca %struct.tinyrl*
store %struct.tinyrl* %0, %struct.tinyrl** %2
%3 = load %struct.tinyrl*, %struct.tinyrl** %2
%4 = call i32 @tinyrl_printf(%struct.tinyrl* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @tinyrl_crlf(%struct.tinyrl* %0) {
%2 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
    y = y + z;
    z = z + x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a();
int main() {
  for (;;) {
    a();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <a@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <a@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @a()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @a()
br label %1
}
int test_imm_C5uint8_mem(unsigned char *val) {
  return ((*val) & (0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xc5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C5uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 197
%7 = icmp ne i32 %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_C5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -59
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char const *, char *, int /*<<< orphan*/);
int type_is_normal_ipcp(const char *dif_type) {
  return strncmp(dif_type, "normal", strlen("normal")) == 0;
}


x86 assembly (clang, -O0):
<type_is_normal_ipcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_is_normal_ipcp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"normal\00"
define i32 @type_is_normal_ipcp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"normal\00"
define i32 @type_is_normal_ipcp(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_A0uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A0uint64_midword_mem>:
testb  $0xa0,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A0uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 160
%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_A0uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10485760
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct S_ELEMENT {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructors_ops(struct S_ELEMENT *const);
void destructors_ELEMENT(struct S_ELEMENT *const ELEMENT) {
  destructors_ops(ELEMENT);
}


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

x86 assembly (clang, -O2):
<destructors_ELEMENT>:
jmp    1030 <destructors_ops@plt>

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

LLVM IR (-O2):
%struct.S_ELEMENT = type { i32 }
define void @destructors_ELEMENT(%struct.S_ELEMENT* %0) {
%2 = tail call i32 @destructors_ops(%struct.S_ELEMENT* %0)
ret void
}
int valid_memblock(struct memblock *mb) {
  (void)mb;

  return 1;
}


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

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

LLVM IR (-O0):
%struct.memblock = type opaque
define i32 @valid_memblock(%struct.memblock* %0) {
%2 = alloca %struct.memblock*
store %struct.memblock* %0, %struct.memblock** %2
%3 = load %struct.memblock*, %struct.memblock** %2
ret i32 1
}

LLVM IR (-O2):
%struct.memblock = type opaque
define i32 @valid_memblock(%struct.memblock* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
char toupper(char);
int SetToUppercase(char *Text) {
  int i;
  for (i = 0; Text[i] != 0x00; i++) {
    Text[i] = toupper(Text[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<SetToUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <SetToUppercase+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <SetToUppercase+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetToUppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <SetToUppercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <SetToUppercase+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @SetToUppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @toupper(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int choice = 2;
  switch (choice) {
  case 1:
    printf("Choice equals 1\n");
    break;
  case 2:
    printf("Choice equals 2\n");
    break;
  default:
    printf("You chose something else\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     114b <main+0x3b>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     115c <main+0x4c>
jmp    116d <main+0x5d>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x69>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x69>
lea    0xeae(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Choice equals 1\0A\00"
@.str.1 = [17 x i8] c"Choice equals 2\0A\00"
@.str.2 = [26 x i8] c"You chose something else\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Choice equals 2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int sgn(double x) { return x < 0 ? -1 : x > 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1124 <sgn+0x24>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <sgn+0x3d>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ -1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @sgn(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int ns_name_unpack2(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                    int /*<<< orphan*/ const *, int /*<<< orphan*/ *, size_t,
                    int /*<<< orphan*/ *);
int ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
                   u_char *dst, size_t dstsiz) {
  return (ns_name_unpack2(msg, eom, src, dst, dstsiz, NULL));
}


x86 assembly (clang, -O0):
<ns_name_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <ns_name_unpack2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_name_unpack>:
xor    %r9d,%r9d
jmp    1030 <ns_name_unpack2@plt>

LLVM IR (-O0):
define i32 @ns_name_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i64 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i64
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i64 %4, i64* %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i64, i64* %10
%16 = call i32 @ns_name_unpack2(i32* %11, i32* %12, i32* %13, i32* %14, i64 %15, i32* null)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ns_name_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i64 %4) {
%6 = tail call i32 @ns_name_unpack2(i32* %0, i32* %1, i32* %2, i32* %3, i64 %4, i32* null)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *sixteen() {
  char *s = (char *)malloc(sizeof(char) * 7);
  strcpy(s, "Hello");
  return s;
}


x86 assembly (clang, -O0):
<sixteen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i8* @sixteen() {
%1 = tail call i64 @malloc(i32 7)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ rewind(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void limpOut(int backsteps) {
  while (backsteps != 0) {
    fputs("\033[A\033[2K", stdout);
    backsteps--;
  }
  rewind(stdout);
}


x86 assembly (clang, -O0):
<limpOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <limpOut+0x38>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <limpOut+0xb>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1030 <rewind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpOut>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1150 <limpOut+0x30>
mov    %edi,%ebx
mov    0x2eae(%rip),%r15
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%esi
mov    %r14,%rdi
call   1040 <fputs@plt>
add    $0xffffffff,%ebx
jne    1140 <limpOut+0x20>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <rewind@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[A\1B[2K\00"
@stdout = global i32 0
define void @limpOut(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* @stdout
%13 = call i32 @rewind(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[A\1B[2K\00"
@stdout = global i32 0
define void @limpOut(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %4, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = load i32, i32* @stdout
%11 = tail call i32 @rewind(i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dumpio_write_data(int /*<<< orphan*/, int /*<<< orphan*/,
                                     void *);
void dumpio_write_data_(int32_t *fid, int32_t *idxsize, void *data) {
  int32_t ierr;
  ierr = dumpio_write_data(*fid, *idxsize, data);
}


x86 assembly (clang, -O0):
<dumpio_write_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <dumpio_write_data@plt>
mov    %eax,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpio_write_data_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <dumpio_write_data@plt>

LLVM IR (-O0):
define void @dumpio_write_data_(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 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i8*, i8** %6
%13 = call i32 @dumpio_write_data(i32 %9, i32 %11, i8* %12)
store i32 %13, i32* %7
ret void
}

LLVM IR (-O2):
define void @dumpio_write_data_(i32* nocapture %0, i32* nocapture %1, i8* %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @dumpio_write_data(i32 %4, i32 %5, i8* %2)
ret void
}