xunge/DecIR huggingface dataset:
/* Variables and functions */
double modipulate_global_get_volume();
double modipulategml_global_get_volume(void) {
  return modipulate_global_get_volume();
}


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

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

LLVM IR (-O0):
define double @modipulategml_global_get_volume() {
%1 = call double (...) @modipulate_global_get_volume()
ret double %1
}

LLVM IR (-O2):
define double @modipulategml_global_get_volume() {
%1 = tail call double (...) @modipulate_global_get_volume()
ret double %1
}
int update_count(int count, int val) {
  if ((3 <= val) && (val <= 6)) {
    count++;
  } else if (val == 10) {
    count--;
  }
  return count;
}


x86 assembly (clang, -O0):
<update_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jg     1130 <update_count+0x30>
cmpl   $0x6,-0x8(%rbp)
jg     1130 <update_count+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <update_count+0x48>
cmpl   $0xa,-0x8(%rbp)
jne    1143 <update_count+0x43>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <update_count+0x48>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_count>:
lea    -0x3(%rsi),%eax
xor    %ecx,%ecx
cmp    $0xa,%esi
sete   %cl
neg    %ecx
cmp    $0x4,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @update_count(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 sle i32 3, %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %20
13: ; preds = %7, %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @update_count(i32 %0, i32 %1) {
%3 = add i32 %1, -3
%4 = icmp ult i32 %3, 4
%5 = icmp eq i32 %1, 10
%6 = sext i1 %5 to i32
%7 = select i1 %4, i32 1, i32 %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
void *x2nrealloc_inline(void *, size_t *, size_t);
void *x2nrealloc(void *p, size_t *pn, size_t s) {
  return x2nrealloc_inline(p, pn, s);
}


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

x86 assembly (clang, -O2):
<x2nrealloc>:
jmp    1030 <x2nrealloc_inline@plt>

LLVM IR (-O0):
define i8* @x2nrealloc(i8* %0, i64* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64
store i8* %0, i8** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64*, i64** %5
%9 = load i64, i64* %6
%10 = call i8* @x2nrealloc_inline(i8* %7, i64* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @x2nrealloc(i8* %0, i64* %1, i64 %2) {
%4 = tail call i8* @x2nrealloc_inline(i8* %0, i64* %1, i64 %2)
ret i8* %4
}
void read_mesh_databases_coupling_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @read_mesh_databases_coupling_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wFilePrintString(int, char *);
int wPopNumber();
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFPuts() {
  int handle;
  char *text;
  text = wPopString();
  handle = wPopNumber();
  wFilePrintString(handle, text);
  free(text);
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasFPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1070 <wPopNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <wFilePrintString@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1060 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFPuts>:
push   %rbx
xor    %eax,%eax
call   1050 <wPopString@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <wPopNumber@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <wFilePrintString@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
pop    %rbx
jmp    1060 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasFPuts() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i32 (...) @wPopNumber()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i8*, i8** %2
%7 = call i32 @wFilePrintString(i32 %5, i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
define void @wBasFPuts() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 (...) @wPopNumber()
%3 = tail call i32 @wFilePrintString(i32 %2, i8* %1)
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @wPushNumber(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stgwrite(char *);
void endfunc(void) { stgwrite("\n"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @endfunc() {
%1 = tail call i32 @stgwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int DRV_U2DIAG_VALUE_CHECK(unsigned int DiagValue) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_U2DIAG_VALUE_CHECK(i32 %0) {
ret i32 0
}
/* Variables and functions */
int string_hash(char *, int);
unsigned hash(char *s) { return string_hash(s, 1009); }


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

x86 assembly (clang, -O2):
<hash>:
mov    $0x3f1,%esi
jmp    1030 <string_hash@plt>

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

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = tail call i32 @string_hash(i8* %0, i32 1009)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() {
  while (1)
    usleep(1000);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <usleep@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @usleep(i32 1000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ log1p(double);
int /*<<< orphan*/ log1pf(float);
int /*<<< orphan*/ log1pl(long double);
void uninitvar_log1p(void) {
  float f;
  (void)log1pf(f);
  double d;
  (void)log1p(d);
  long double ld;
  (void)log1pl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_log1p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <log1pf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <log1p@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <log1pl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_log1p>:
sub    $0x18,%rsp
call   1030 <log1pf@plt>
call   1050 <log1p@plt>
call   1040 <log1pl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_log1p() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @log1pf(float %4)
%6 = load double, double* %2
%7 = call i32 @log1p(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @log1pl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_log1p() {
%1 = tail call i32 @log1pf(float undef)
%2 = tail call i32 @log1p(double undef)
%3 = tail call i32 @log1pl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void here() { printf("I am here \n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"I am here \00"
define void @here() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int isNotEqual(int x, int y) { return 2; }


x86 assembly (clang, -O0):
<isNotEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isNotEqual(i32 %0, i32 %1) {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void LedDriver_StateOfLed(uint16_t *address, uint8_t NLed) {}


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

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

LLVM IR (-O0):
define void @LedDriver_StateOfLed(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 @LedDriver_StateOfLed(i32* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *__strptime_internal(char const *, char const *, struct tm *,
                          int /*<<< orphan*/ *);
char *strptime(const char *buf, const char *format, struct tm *tm) {
  return __strptime_internal(buf, format, tm, NULL);
}


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

x86 assembly (clang, -O2):
<strptime>:
xor    %ecx,%ecx
jmp    1030 <__strptime_internal@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.tm*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.tm* %2, %struct.tm** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i8* @__strptime_internal(i8* %7, i8* %8, %struct.tm* %9, i32* null)
ret i8* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i8* @__strptime_internal(i8* %0, i8* %1, %struct.tm* %2, i32* null)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ write_serial_byte(unsigned int);
void write_serial_long(unsigned int value) {
  write_serial_byte(value & 0xff);
  write_serial_byte((value >> 8) & 0xff);
  write_serial_byte((value >> 16) & 0xff);
  write_serial_byte((value >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<write_serial_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <write_serial_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
call   1030 <write_serial_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
call   1030 <write_serial_byte@plt>
mov    -0x4(%rbp),%edi
shr    $0x18,%edi
and    $0xff,%edi
call   1030 <write_serial_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial_long>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <write_serial_byte@plt>
movzbl %bh,%edi
call   1030 <write_serial_byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <write_serial_byte@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_serial_byte@plt>

LLVM IR (-O0):
define void @write_serial_long(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @write_serial_byte(i32 %4)
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @write_serial_byte(i32 %8)
%10 = load i32, i32* %2
%11 = lshr i32 %10, 16
%12 = and i32 %11, 255
%13 = call i32 @write_serial_byte(i32 %12)
%14 = load i32, i32* %2
%15 = lshr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @write_serial_byte(i32 %16)
ret void
}

LLVM IR (-O2):
define void @write_serial_long(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @write_serial_byte(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @write_serial_byte(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @write_serial_byte(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @write_serial_byte(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void main() {
  int a, b, c;
  double y;
  y = (3.8 * (b * b + a * c)) / (b * a);
  printf("%f\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xecc(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = sitofp i32 %11 to double
%13 = fmul double 3.800000e+00, %12
%14 = load i32, i32* %2
%15 = load i32, i32* %1
%16 = mul nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fdiv double %13, %17
store double %18, double* %4
%19 = load double, double* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %19)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x7FF8000000000000)
ret void
}
int ferror_file_func(void *opaque, void *stream) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ferror_file_func(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_min_to_all(int *target, int *source, int nreduce,
                                 int PE_start, int logPE_stride, int PE_size,
                                 int *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_min_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_min_to_all(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6, i64* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i64*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_min_to_all(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int intran(int *iseed) {
  int ret_val;
  *iseed = (*iseed * 9301 + 49297) % 233280;
  ret_val = *iseed * 2147483647 / 233280 + 1;
  return ret_val;
}


x86 assembly (clang, -O0):
<intran>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x2455,(%rax),%eax
add    $0xc091,%eax
mov    $0x38f40,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    -0x8(%rbp),%rax
imul   $0x7fffffff,(%rax),%eax
mov    $0x38f40,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intran>:
imul   $0x2455,(%rdi),%eax
mov    %eax,%ecx
add    $0xc091,%ecx
movslq %ecx,%rcx
imul   $0xffffffff8fd66c05,%rcx,%rdx
shr    $0x20,%rdx
add    %edx,%eax
add    $0xc091,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x11,%eax
add    %edx,%eax
imul   $0x38f40,%eax,%eax
sub    %eax,%ecx
mov    %ecx,(%rdi)
mov    %ecx,%eax
shl    $0x1f,%eax
sub    %ecx,%eax
cltq
imul   $0xffffffff8fd66c05,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
sar    $0x11,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @intran(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 9301
%7 = add nsw i32 %6, 49297
%8 = srem i32 %7, 233280
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, 2147483647
%13 = sdiv i32 %12, 233280
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @intran(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 9301
%4 = add nsw i32 %3, 49297
%5 = srem i32 %4, 233280
store i32 %5, i32* %0
%6 = mul nsw i32 %5, 2147483647
%7 = sdiv i32 %6, 233280
%8 = add nsw i32 %7, 1
ret i32 %8
}
/* Type definitions */
struct trb_table {
  int dummy;
};

/* Variables and functions */
void **trb_probe(struct trb_table *, void *);
void *trb_insert(struct trb_table *table, void *item) {
  void **p = trb_probe(table, item);
  return p == NULL || *p == item ? NULL : *p;
}


x86 assembly (clang, -O0):
<trb_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <trb_probe@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <trb_insert+0x3d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1158 <trb_insert+0x48>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1163 <trb_insert+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trb_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <trb_probe@plt>
test   %rax,%rax
je     112c <trb_insert+0x1c>
mov    (%rax),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
cmovne %rcx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.trb_table = type { i32 }
define i8* @trb_insert(%struct.trb_table* %0, i8* %1) {
%3 = alloca %struct.trb_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.trb_table* %0, %struct.trb_table** %3
store i8* %1, i8** %4
%6 = load %struct.trb_table*, %struct.trb_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @trb_probe(%struct.trb_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11, %2
br label %20
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
br label %20
20: ; preds = %17, %16
%21 = phi i8* [ null, %16 ], [ %19, %17 ]
ret i8* %21
}

LLVM IR (-O2):
%struct.trb_table = type { i32 }
define i8* @trb_insert(%struct.trb_table* %0, i8* %1) {
%3 = tail call i8** @trb_probe(%struct.trb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = select i1 %7, i8* null, i8* %6
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ null, %2 ], [ %8, %5 ]
ret i8* %10
}
double clamp(double x, double min, double max) {
  if (x < min)
    return min;
  if (x > max)
    return max;
  return x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <clamp+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int random_int();
int random_int_() { return random_int(); }


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

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

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

LLVM IR (-O2):
define i32 @random_int_() {
%1 = tail call i32 (...) @random_int()
ret i32 %1
}
int makeseed(void) {
  static unsigned int random_nextseed = 1489853723;
  random_nextseed = random_nextseed * 435898247 + 938284287;
  return (random_nextseed & 0x7fffffff);
}


x86 assembly (clang, -O0):
<makeseed>:
push   %rbp
mov    %rsp,%rbp
imul   $0x19fb4787,0x2f12(%rip),%eax
47 fb 19
add    $0x37ed14ff,%eax
mov    %eax,0x2f07(%rip)
mov    0x2f01(%rip),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeseed>:
imul   $0x19fb4787,0x2f16(%rip),%eax
47 fb 19
add    $0x37ed14ff,%eax
mov    %eax,0x2f0b(%rip)
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
@makeseed.random_nextseed = internal global i32 1489853723
define i32 @makeseed() {
%1 = load i32, i32* @makeseed.random_nextseed
%2 = mul i32 %1, 435898247
%3 = add i32 %2, 938284287
store i32 %3, i32* @makeseed.random_nextseed
%4 = load i32, i32* @makeseed.random_nextseed
%5 = and i32 %4, 2147483647
ret i32 %5
}

LLVM IR (-O2):
@makeseed.random_nextseed = internal unnamed_addr global i32 1489853723
define i32 @makeseed() {
%1 = load i32, i32* @makeseed.random_nextseed
%2 = mul i32 %1, 435898247
%3 = add i32 %2, 938284287
store i32 %3, i32* @makeseed.random_nextseed
%4 = and i32 %3, 2147483647
ret i32 %4
}
int logicNot(int x) {
  if (x == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<logicNot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <logicNot+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <logicNot+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicNot>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @logicNot(i32 %0) {
%2 = icmp ne i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void match(int n) {}


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

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

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

LLVM IR (-O2):
define void @match(i32 %0) {
ret void
}
/* Type definitions */
struct efd {
  int dummy;
};

/* Variables and functions */
int efd_unsignal2(struct efd *, int *, int);
int efd_unsignal(struct efd *self) {
  int rc;
  int signo = -1;
  rc = efd_unsignal2(self, &signo, 1);
  return signo;
}


x86 assembly (clang, -O0):
<efd_unsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <efd_unsignal2@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efd_unsignal>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <efd_unsignal2@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.efd = type { i32 }
define i32 @efd_unsignal(%struct.efd* %0) {
%2 = alloca %struct.efd*
%3 = alloca i32
%4 = alloca i32
store %struct.efd* %0, %struct.efd** %2
store i32 -1, i32* %4
%5 = load %struct.efd*, %struct.efd** %2
%6 = call i32 @efd_unsignal2(%struct.efd* %5, i32* %4, i32 1)
store i32 %6, i32* %3
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.efd = type { i32 }
define i32 @efd_unsignal(%struct.efd* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 -1, i32* %2
%4 = call i32 @efd_unsignal2(%struct.efd* %0, i32* %2, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_multprec_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(282, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11a,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_target_system>:
mov    $0x11a,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 282, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 282, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int bar(int);
int qqq(int a) {
  int result;
  result = bar(a);
  return result;
}


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

x86 assembly (clang, -O2):
<qqq>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @qqq(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ glAccum(unsigned int, float);
void Accum(unsigned int op, float v) { glAccum(op, v); }


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

x86 assembly (clang, -O2):
<Accum>:
jmp    1030 <glAccum@plt>

LLVM IR (-O0):
define void @Accum(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i32 @glAccum(i32 %5, float %6)
ret void
}

LLVM IR (-O2):
define void @Accum(i32 %0, float %1) {
%3 = tail call i32 @glAccum(i32 %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
void *s_realloc(void *ptr, size_t size) {
  if (!(ptr = realloc(ptr, size)))
    error(EXIT_FAILURE, errno, "realloc");
  return ptr;
}


x86 assembly (clang, -O0):
<s_realloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1169 <s_realloc+0x49>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdx
call   1040 <error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_realloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <s_realloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [8 x i8] c"realloc\00"
define noalias i8* @s_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_le16(int /*<<< orphan*/);
void cpu_to_le16w(uint16_t *p, uint16_t v) { *p = cpu_to_le16(v); }


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

x86 assembly (clang, -O2):
<cpu_to_le16w>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpu_to_le16w(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 = call i32 @cpu_to_le16(i32 %5)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @cpu_to_le16w(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @cpu_to_le16(i32 %1)
store i32 %3, i32* %0
ret void
}
void TIMEOUT(char *S) { ; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gendsrl32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tst_resm(int, char *);
void func_cnt(int rval) {
  if (rval == 5) {
    tst_resm(0, "number of sleeping processes is correct");
  } else {
    tst_resm(1, "number of sleeping processes is not correct");
  }
}


x86 assembly (clang, -O0):
<func_cnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1138 <func_cnt+0x28>
xor    %edi,%edi
lea    0xed2(%rip),%rsi
call   1030 <tst_resm@plt>
jmp    1149 <func_cnt+0x39>
mov    $0x1,%edi
lea    0xee4(%rip),%rsi
call   1030 <tst_resm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_cnt>:
cmp    $0x5,%edi
jne    1123 <func_cnt+0x13>
lea    0xee4(%rip),%rsi
xor    %edi,%edi
jmp    1030 <tst_resm@plt>
lea    0xefe(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <tst_resm@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"number of sleeping processes is correct\00"
@.str.1 = [44 x i8] c"number of sleeping processes is not correct\00"
define void @func_cnt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @tst_resm(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @tst_resm(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"number of sleeping processes is correct\00"
@.str.1 = [44 x i8] c"number of sleeping processes is not correct\00"
define void @func_cnt(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tst_resm(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @tst_resm(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
void foo(int x[16]) { printf("%zu\n", (sizeof(x) / sizeof(x[0]))); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
define void @foo(i32* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios *);
void closestdin(int *fd, struct termios *oldtio) {
  tcsetattr(*fd, TCSANOW, oldtio);
}


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

x86 assembly (clang, -O2):
<closestdin>:
mov    %rsi,%rdx
mov    (%rdi),%edi
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @closestdin(i32* %0, %struct.termios* %1) {
%3 = alloca i32*
%4 = alloca %struct.termios*
store i32* %0, i32** %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* @TCSANOW
%8 = load %struct.termios*, %struct.termios** %4
%9 = call i32 @tcsetattr(i32 %6, i32 %7, %struct.termios* %8)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @closestdin(i32* nocapture %0, %struct.termios* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* @TCSANOW
%5 = tail call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %1)
ret void
}
/* Variables and functions */
int open_listenfd(char *);
int /*<<< orphan*/ unix_error(char *);
int Open_listenfd(char *port) {
  int rc;
  if ((rc = open_listenfd(port)) < 0)
    unix_error("Open_listenfd error");
  return rc;
}


x86 assembly (clang, -O0):
<Open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <open_listenfd@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    114d <Open_listenfd+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_listenfd>:
push   %rbx
call   1040 <open_listenfd@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open_listenfd+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Open_listenfd error\00"
define i32 @Open_listenfd(i8* %0) {
%2 = tail call i32 @open_listenfd(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_sink_port_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_sink_port_by_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"NOT IMPLEMENTED:pa_context_set_sink_port_by_name\0A\00"
define i32 @pa_context_set_sink_port_by_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_context_set_sink_port_by_name\00"
define i32 @pa_context_set_sink_port_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void RTC_EveryYearHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @RTC_EveryYearHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void changeToX(const char *str) {
  printf("before change: %s\n", str);
  printf("after change: %s\n", str);
  str = "X";
}


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

x86 assembly (clang, -O2):
<changeToX>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"before change: %s\0A\00"
@.str.1 = [18 x i8] c"after change: %s\0A\00"
@.str.2 = [2 x i8] c"X\00"
define void @changeToX(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %2
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"before change: %s\0A\00"
@.str.1 = [18 x i8] c"after change: %s\0A\00"
define void @changeToX(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int character;
  character = getchar();
  putchar(character);
  getchar();
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @putchar(i32 %4)
%6 = call i32 (...) @getchar()
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @putchar(i32 %1)
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "usage: %s <filename> [-s <filename>]\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s <filename> [-s <filename>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s <filename> [-s <filename>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}