xunge/DecIR huggingface dataset:
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AddEvent(int /*<<< orphan*/, char *, char *, char *,
                            struct tm);
void QuickAddEvent(char *title, struct tm due) {
  AddEvent(0, "\0", title, "\0", due);
}


x86 assembly (clang, -O0):
<QuickAddEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %esi,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
xor    %edi,%edi
lea    0xed0(%rip),%rcx
mov    %rcx,%rsi
call   1030 <AddEvent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickAddEvent>:
mov    %esi,%r8d
mov    %rdi,%rdx
lea    0xee3(%rip),%rcx
xor    %edi,%edi
mov    %rcx,%rsi
jmp    1030 <AddEvent@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [2 x i8] zeroinitializer
define void @QuickAddEvent(i8* %0, i32 %1) {
%3 = alloca %struct.tm
%4 = alloca i8*
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 %1, i32* %5
store i8* %0, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @AddEvent(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define void @QuickAddEvent(i8* %0, i32 %1) {
%3 = tail call i32 @AddEvent(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int CL_GetPingQueueCount();
int LAN_GetPingQueueCount(void) { return (CL_GetPingQueueCount()); }


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

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

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

LLVM IR (-O2):
define i32 @LAN_GetPingQueueCount() {
%1 = tail call i32 (...) @CL_GetPingQueueCount()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ paresd(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  int x;
  scanf("%d", &x);
  printf("\t###Pares decrescente###\n");
  paresd(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xe95(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <paresd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xea3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
call   1040 <paresd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\09###Pares decrescente###\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @paresd(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"%d\00"
@str = [25 x i8] c"\09###Pares decrescente###\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = call i32 @paresd(i32 %7)
ret i32 0
}
double epsilon(void) {
  double epsilon;
  double temp;
  epsilon = 1.0;
  temp = epsilon + 1.0;
  while (temp > 1.0) {
    epsilon = epsilon / 2.0;
    temp = epsilon + 1.0;
  }
  return (epsilon * 2.0);
}


x86 assembly (clang, -O0):
<epsilon>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1167 <epsilon+0x67>
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xea8(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1123 <epsilon+0x23>
movsd  0xe99(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @epsilon() {
%1 = alloca double
%2 = alloca double
store double 1.000000e+00, double* %1
%3 = load double, double* %1
%4 = fadd double %3, 1.000000e+00
store double %4, double* %2
br label %5
5: ; preds = %8, %0
%6 = load double, double* %2
%7 = fcmp ogt double %6, 1.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load double, double* %1
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %1
%11 = load double, double* %1
%12 = fadd double %11, 1.000000e+00
store double %12, double* %2
br label %5
13: ; preds = %5
%14 = load double, double* %1
%15 = fmul double %14, 2.000000e+00
ret double %15
}

LLVM IR (-O2):
define double @epsilon() {
ret double 0x3CB0000000000000
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t TimerClockSourceGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000FC8))));
}


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

x86 assembly (clang, -O2):
<TimerClockSourceGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0xfc8(%rax),%rax
ret

LLVM IR (-O0):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 4040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 4040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ log_debug(char *, char const *);
void carbon_debug(const char *str) { log_debug("%s", str); }


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

x86 assembly (clang, -O2):
<carbon_debug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <log_debug@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @carbon_debug(i8* %0) {
%2 = tail call i32 @log_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int pow(float, int);
float outQuart(float t, float b, float c, float d) {
  return -c * (pow(t / d - 1, 4) - 1) + b;
}


x86 assembly (clang, -O0):
<outQuart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
subss  %xmm1,%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movss  -0x14(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outQuart>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
addss  0xed8(%rip),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @outQuart(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = load float, float* %5
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = fsub float %13, 1.000000e+00
%15 = call i32 @pow(float %14, i32 4)
%16 = sub nsw i32 %15, 1
%17 = sitofp i32 %16 to float
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float %10, float %17, float %18)
ret float %19
}

LLVM IR (-O2):
define float @outQuart(float %0, float %1, float %2, float %3) {
%5 = fneg float %2
%6 = fdiv float %0, %3
%7 = fadd float %6, -1.000000e+00
%8 = tail call i32 @pow(float %7, i32 4)
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to float
%11 = tail call float @llvm.fmuladd.f32(float %5, float %10, float %1)
ret float %11
}
void test_doZclOperation() {}


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

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

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

LLVM IR (-O2):
define void @test_doZclOperation() {
ret void
}
unsigned LZ4_create_size() { return (1 << 14); }


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

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

LLVM IR (-O0):
define i32 @LZ4_create_size() {
ret i32 16384
}

LLVM IR (-O2):
define i32 @LZ4_create_size() {
ret i32 16384
}
/* Type definitions */
struct firmware {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DE_ACT(char *);
int /*<<< orphan*/ release_firmware(struct firmware const *);
void free_firmware(const struct firmware *fw_entry) {
  release_firmware(fw_entry);
  DE_ACT(("firmware released\n"));
}


x86 assembly (clang, -O0):
<free_firmware>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <release_firmware@plt>
lea    0xec4(%rip),%rdi
call   1030 <DE_ACT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_firmware>:
push   %rax
call   1040 <release_firmware@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <DE_ACT@plt>

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

LLVM IR (-O2):
%struct.firmware = type { i32 }
@.str = [19 x i8] c"firmware released\0A\00"
define void @free_firmware(%struct.firmware* %0) {
%2 = tail call i32 @release_firmware(%struct.firmware* %0)
%3 = tail call i32 @DE_ACT(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ LSR8(int /*<<< orphan*/);
void Op5EM1X0(void) { LSR8(AbsoluteIndexedXX0(3)); }


x86 assembly (clang, -O0):
<Op5EM1X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
call   1040 <LSR8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op5EM1X0>:
push   %rax
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <LSR8@plt>

LLVM IR (-O0):
define void @Op5EM1X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 3)
%2 = call i32 @LSR8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op5EM1X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 3)
%2 = tail call i32 @LSR8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ init(char *);
scalar_t__ malloc(int);
int main(int argc, const char *argv[]) {
  char *p;
  init(p);
  p = (char *)malloc(42);
  if (argc > 0) {
    exit(1);
  } else {
    if (!p) {
      exit(2);
    }
  }
  p[0] = '\0';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116a <main+0x3a>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpq   $0x0,-0x18(%rbp)
jne    117f <main+0x4f>
mov    $0x2,%edi
call   1050 <exit@plt>
jmp    1184 <main+0x54>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
test   %ebx,%ebx
jg     1152 <main+0x22>
test   %rax,%rax
je     115c <main+0x2c>
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %5
%7 = call i32 @init(i8* %6)
%8 = call i64 @malloc(i32 42)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 @exit(i32 2)
unreachable
19: ; preds = %14
br label %20
20: ; preds = %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 0
store i8 0, i8* %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init(i8* undef)
%4 = tail call i64 @malloc(i32 42)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = icmp eq i64 %4, 0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @exit(i32 2)
unreachable
12: ; preds = %8
%13 = inttoptr i64 %4 to i8*
store i8 0, i8* %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void character2c(char c) { printf("'%c'\n", c); }


x86 assembly (clang, -O0):
<character2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<character2c>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"'%c'\0A\00"
define void @character2c(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_configure_fifo(unsigned short com) { outb((com + 2), 0b11000111); }


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

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

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

LLVM IR (-O2):
define void @serial_configure_fifo(i16 zeroext %0) {
%2 = add i16 %0, 2
%3 = tail call i32 @outb(i16 zeroext %2, i32 199)
ret void
}
/* Variables and functions */
int equal(int *, int *, int);
int /*<<< orphan*/ sort(int *, int);
int test_sort_ascending() {
  int array[] = {1, 2, 3, 4, 5};
  int expected[] = {2, 1, 4, 3, 5};
  sort(array, 5);
  return equal(expected, array, 5);
}


x86 assembly (clang, -O0):
<test_sort_ascending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sort_ascending>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeef(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_sort_ascending.array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.test_sort_ascending.expected = [5 x i32] [i32 2, i32 1, i32 4, i32 3, i32 5]
define i32 @test_sort_ascending() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = call i32 @equal(i32* %7, i32* %8, i32 5)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_sort_ascending.array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.test_sort_ascending.expected = [5 x i32] [i32 2, i32 1, i32 4, i32 3, i32 5]
define i32 @test_sort_ascending() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @equal(i32* %7, i32* %5, i32 5)
ret i32 %8
}
const char *proginfo_name(void) { return "hingescan"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"hingescan\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"hingescan\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
char *strsrch(s1, s2) const char *s1;
const char *s2;
{
  int ls1;
  ls1 = strlen(s1);
  return (strnsrch(s1, s2, ls1));
}


x86 assembly (clang, -O0):
<strsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <strnsrch@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strsrch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strnsrch to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* %10, i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @strsrch(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strnsrch to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int /*<<< orphan*/ b(int);
int /*<<< orphan*/ c(int);
int x();
int y();
void test() {
  int ar[x()][y()];
  a(sizeof ar);
  b(sizeof *ar);
  c(sizeof **ar);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1040 <x@plt>
mov    %eax,%eax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1070 <y@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,%ecx
mov    %rcx,-0x20(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
imul   %rcx,%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <a@plt>
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <b@plt>
mov    $0x4,%edi
call   1050 <c@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <x@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <y@plt>
mov    %eax,%ebp
imul   %eax,%ebx
shl    $0x2,%ebx
mov    %ebx,%edi
call   1060 <a@plt>
shl    $0x2,%ebp
mov    %ebp,%edi
call   1030 <b@plt>
mov    $0x4,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <c@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = call i32 (...) @x()
%5 = zext i32 %4 to i64
%6 = call i32 (...) @y()
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %1
%9 = mul nuw i64 %5, %7
%10 = alloca i32, i64 %9
store i64 %5, i64* %2
store i64 %7, i64* %3
%11 = mul nuw i64 %5, %7
%12 = mul nuw i64 4, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @a(i32 %13)
%15 = mul nuw i64 4, %7
%16 = trunc i64 %15 to i32
%17 = call i32 @b(i32 %16)
%18 = call i32 @c(i32 4)
%19 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @x()
%2 = tail call i32 (...) @y()
%3 = shl i32 %1, 2
%4 = mul i32 %3, %2
%5 = tail call i32 @a(i32 %4)
%6 = shl i32 %2, 2
%7 = tail call i32 @b(i32 %6)
%8 = tail call i32 @c(i32 4)
ret void
}
unsigned char set_bit(unsigned char c, int i) {
  unsigned char mask = 1 << i;
  return mask | c;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @set_bit(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
/* Type definitions */
struct json_writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_begin_string_no_check(struct json_writer *);
int /*<<< orphan*/ json_value_start(struct json_writer *);
void json_begin_string(struct json_writer *writer) {
  json_value_start(writer);
  json_begin_string_no_check(writer);
}


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

x86 assembly (clang, -O2):
<json_begin_string>:
push   %rbx
mov    %rdi,%rbx
call   1040 <json_value_start@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <json_begin_string_no_check@plt>

LLVM IR (-O0):
%struct.json_writer = type { i32 }
define void @json_begin_string(%struct.json_writer* %0) {
%2 = alloca %struct.json_writer*
store %struct.json_writer* %0, %struct.json_writer** %2
%3 = load %struct.json_writer*, %struct.json_writer** %2
%4 = call i32 @json_value_start(%struct.json_writer* %3)
%5 = load %struct.json_writer*, %struct.json_writer** %2
%6 = call i32 @json_begin_string_no_check(%struct.json_writer* %5)
ret void
}

LLVM IR (-O2):
%struct.json_writer = type { i32 }
define void @json_begin_string(%struct.json_writer* %0) {
%2 = tail call i32 @json_value_start(%struct.json_writer* %0)
%3 = tail call i32 @json_begin_string_no_check(%struct.json_writer* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_x_root(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->x_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_x_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonReleasedEvent_x_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TxPIDSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void TxPIDSettingsRequestUpdate() {
  UAVObjRequestUpdate(TxPIDSettingsHandle());
}


x86 assembly (clang, -O0):
<TxPIDSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TxPIDSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @TxPIDSettingsRequestUpdate() {
%1 = call i32 (...) @TxPIDSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TxPIDSettingsRequestUpdate() {
%1 = tail call i32 (...) @TxPIDSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
size_t plus_linear_min(int);
void plus_linear_min_Bad() {
  int a[19];
  a[plus_linear_min(9)] = 1;
}


x86 assembly (clang, -O0):
<plus_linear_min_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x9,%edi
call   1030 <plus_linear_min@plt>
movl   $0x1,-0x50(%rbp,%rax,4)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus_linear_min_Bad>:
mov    $0x9,%edi
jmp    1030 <plus_linear_min@plt>

LLVM IR (-O0):
define void @plus_linear_min_Bad() {
%1 = alloca [19 x i32]
%2 = call i64 @plus_linear_min(i32 9)
%3 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 %2
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @plus_linear_min_Bad() {
%1 = tail call i64 @plus_linear_min(i32 9)
ret void
}
int test_contains_comparator(void *A, void *B) {
  if (A == B) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_contains_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <test_contains_comparator+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <test_contains_comparator+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_contains_comparator>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @test_contains_comparator(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void dummy_func(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_func() {
ret void
}
/* Variables and functions */
int japi_getvalue(int);
int j_getvalue(int arg0) { return (japi_getvalue(arg0)); }


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

x86 assembly (clang, -O2):
<j_getvalue>:
jmp    1030 <japi_getvalue@plt>

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

LLVM IR (-O2):
define i32 @j_getvalue(i32 %0) {
%2 = tail call i32 @japi_getvalue(i32 %0)
ret i32 %2
}
void tegra_pm_init_suspend(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
void _copy_set(fd_set *destination, const fd_set *source) {
  if (source == NULL) {
    FD_ZERO(destination);
  } else {
    *destination = *source;
  }
}


x86 assembly (clang, -O0):
<_copy_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <_copy_set+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
jmp    1145 <_copy_set+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_copy_set>:
test   %rsi,%rsi
je     111a <_copy_set+0xa>
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret
jmp    1030 <FD_ZERO@plt>

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

LLVM IR (-O2):
define void @_copy_set(i32* %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @FD_ZERO(i32* %0)
br label %8
6: ; preds = %2
%7 = load i32, i32* %1
store i32 %7, i32* %0
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suspend();
void act_susp(void) { suspend(); }


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

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

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

LLVM IR (-O2):
define void @act_susp() {
%1 = tail call i32 (...) @suspend()
ret void
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int chdir(char *name) { return syscall(27, name, 0); }


x86 assembly (clang, -O0):
<chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1b,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir>:
mov    %rdi,%rsi
mov    $0x1b,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = tail call i32 @syscall(i32 27, i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void and_reg32_reg32(unsigned long reg1, unsigned long reg2) {
  put8(0x21);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<and_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x21,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
or     $0xc0,%rax
or     -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg32_reg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x21,%edi
call   1030 <put8@plt>
shl    $0x3,%r14d
or     %r14d,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @and_reg32_reg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 33)
%6 = load i64, i64* %4
%7 = shl i64 %6, 3
%8 = or i64 192, %7
%9 = load i64, i64* %3
%10 = or i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @and_reg32_reg32(i64 %0, i64 %1) {
%3 = tail call i32 @put8(i32 33)
%4 = shl i64 %1, 3
%5 = or i64 %4, %0
%6 = trunc i64 %5 to i32
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generateSubsets(int);
int /*<<< orphan*/ getchar();
int main() {
  generateSubsets(3);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <generateSubsets@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <generateSubsets@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @generateSubsets(i32 3)
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @generateSubsets(i32 3)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void X509_print(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_print() {
ret void
}
/* Variables and functions */
scalar_t__ __builtin___bnd_set_ptr_bounds(int *, int);
int test(int *p) {
  p = (int *)__builtin___bnd_set_ptr_bounds(p, sizeof(int));
  return *(p + 1);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <__builtin___bnd_set_ptr_bounds@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x4,%esi
call   1030 <__builtin___bnd_set_ptr_bounds@plt>
mov    0x4(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @__builtin___bnd_set_ptr_bounds(i32* %3, i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test(i32* %0) {
%2 = tail call i64 @__builtin___bnd_set_ptr_bounds(i32* %0, i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}
/* Type definitions */
struct msgu_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
size_t ep_buffer_copy(struct msgu_buffer *outbuf, struct msgu_buffer *inbuf,
                      size_t start) {
  printf("TODO: copy\n");
  return 0;
}


x86 assembly (clang, -O0):
<ep_buffer_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.msgu_buffer = type { i32 }
@.str = [12 x i8] c"TODO: copy\0A\00"
define i64 @ep_buffer_copy(%struct.msgu_buffer* %0, %struct.msgu_buffer* %1, i64 %2) {
%4 = alloca %struct.msgu_buffer*
%5 = alloca %struct.msgu_buffer*
%6 = alloca i64
store %struct.msgu_buffer* %0, %struct.msgu_buffer** %4
store %struct.msgu_buffer* %1, %struct.msgu_buffer** %5
store i64 %2, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
%struct.msgu_buffer = type { i32 }
@str = [11 x i8] c"TODO: copy\00"
define i64 @ep_buffer_copy(%struct.msgu_buffer* nocapture readnone %0, %struct.msgu_buffer* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i64 0
}
/* Type definitions */
struct btf_type {
  int /*<<< orphan*/ info;
};
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ BTF_INFO_VLEN(int /*<<< orphan*/);
__u16 btf_vlen(const struct btf_type *t) { return BTF_INFO_VLEN(t->info); }


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

x86 assembly (clang, -O2):
<btf_vlen>:
mov    (%rdi),%edi
jmp    1030 <BTF_INFO_VLEN@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_vlen(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @BTF_INFO_VLEN(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_vlen(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INFO_VLEN(i32 %3)
ret i32 %4
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
void usec_to_timeval(struct timeval *tv, const long usec) {
  tv->tv_sec = usec / 1000000L;
  tv->tv_usec = usec % 1000000L;
}


x86 assembly (clang, -O0):
<usec_to_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    -0x8(%rbp),%rax
mov    %rdx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec_to_timeval>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rax,%rdx
mov    %rdx,(%rdi)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rsi
mov    %rsi,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @usec_to_timeval(%struct.timeval* %0, i64 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 1000000
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 %6, i64* %8
%9 = load i64, i64* %4
%10 = srem i64 %9, 1000000
%11 = load %struct.timeval*, %struct.timeval** %3
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i64 %10, i64* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @usec_to_timeval(%struct.timeval* nocapture writeonly %0, i64 %1) {
%3 = sdiv i64 %1, 1000000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i64 %3, i64* %4
%5 = srem i64 %1, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i64 %5, i64* %6
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mach64_ext_outb(int, int, void *);
void mach64_ext_outw(uint16_t port, uint16_t val, void *p) {
  ;
  switch (port) {
  default:
    mach64_ext_outb(port, val, p);
    mach64_ext_outb(port + 1, val >> 8, p);
    break;
  }
}


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

x86 assembly (clang, -O2):
<mach64_ext_outw>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <mach64_ext_outb@plt>
add    $0x1,%ebx
sar    $0x8,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mach64_ext_outb@plt>

LLVM IR (-O0):
define void @mach64_ext_outw(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %8 [
]
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @mach64_ext_outb(i32 %9, i32 %10, i8* %11)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %5
%16 = ashr i32 %15, 8
%17 = load i8*, i8** %6
%18 = call i32 @mach64_ext_outb(i32 %14, i32 %16, i8* %17)
br label %19
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @mach64_ext_outw(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @mach64_ext_outb(i32 %0, i32 %1, i8* %2)
%5 = add nsw i32 %0, 1
%6 = ashr i32 %1, 8
%7 = tail call i32 @mach64_ext_outb(i32 %5, i32 %6, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(
      stderr,
      "Usage: gpchecksubwa [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l] [-f]\n");
  fprintf(stderr, "\t\t[-m maxwords] groupname [subname].\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf07(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: gpchecksubwa [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l] [-f]\0A\00"
@.str.1 = [38 x i8] c"\09\09[-m maxwords] groupname [subname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: gpchecksubwa [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l] [-f]\0A\00"
@.str.1 = [38 x i8] c"\09\09[-m maxwords] groupname [subname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int main(int argc, char *argv[]) {
#pragma omp parallel
  {}
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int HelpItem35(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem35() {
ret i32 0
}
void bitrate_mvr_log(char *mvr_logfile_buffer) {}


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

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

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

LLVM IR (-O2):
define void @bitrate_mvr_log(i8* nocapture %0) {
ret void
}