xunge/DecIR huggingface dataset:
int f_3(int *Suma, int *Roznica) {
  int a, b;
  a = *Suma;
  b = *Roznica;
  *Suma = a + b;
  *Roznica = a - b;
  return (a * b);
}


x86 assembly (clang, -O0):
<f_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_3>:
mov    (%rdi),%ecx
mov    (%rsi),%eax
lea    (%rax,%rcx,1),%edx
mov    %edx,(%rdi)
mov    %ecx,%edx
sub    %eax,%edx
mov    %edx,(%rsi)
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f_3(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = load i32*, i32** %3
store i32 %13, i32* %14
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
%18 = load i32*, i32** %4
store i32 %17, i32* %18
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = mul nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @f_3(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = sub nsw i32 %3, %4
store i32 %6, i32* %1
%7 = mul nsw i32 %4, %3
ret i32 %7
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_inverse(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *psvec4i_inverse(struct vec4i *result,
                                                       struct vec4i *a) {
  vec4i_inverse((int32_t *)result, (int32_t *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec4i_inverse>:
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 <vec4i_inverse@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4i_inverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_inverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_inverse(%struct.vec4i* %0, %struct.vec4i* %1) {
%3 = alloca %struct.vec4i*
%4 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %3
store %struct.vec4i* %1, %struct.vec4i** %4
%5 = load %struct.vec4i*, %struct.vec4i** %3
%6 = bitcast %struct.vec4i* %5 to i32*
%7 = load %struct.vec4i*, %struct.vec4i** %4
%8 = bitcast %struct.vec4i* %7 to i32*
%9 = call i32 @vec4i_inverse(i32* %6, i32* %8)
%10 = load %struct.vec4i*, %struct.vec4i** %3
ret %struct.vec4i* %10
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_inverse(%struct.vec4i* returned %0, %struct.vec4i* %1) {
%3 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%5 = tail call i32 @vec4i_inverse(i32* %3, i32* %4)
ret %struct.vec4i* %0
}
void PWM_device_channel_init(unsigned int channel, unsigned short period,
                             unsigned short dutyCycle) {}


x86 assembly (clang, -O0):
<PWM_device_channel_init>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @PWM_device_channel_init(i32 %0, i16 zeroext %1, i16 zeroext %2) {
ret void
}
/* Variables and functions */
int days(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", days(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <days@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <days@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @days(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @days(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void preenche(int x[]) {
  int i, y;
  for (i = 0; i < 32; i++) {
    scanf("%d", &y);
    x[i] = y;
  }
}


x86 assembly (clang, -O0):
<preenche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1159 <preenche+0x49>
lea    0xecc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <preenche+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preenche>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
xor    %ebx,%ebx
lea    0xedc(%rip),%r14
lea    0x4(%rsp),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1130 <preenche+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @preenche(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %7, i32* %8
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 32
br i1 %10, label %11, label %4
11: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
int /*<<< orphan*/ window_land_should_close();
void window_land_close() {
  if (!window_land_should_close())
    RCT2_CALLPROC_EBPSAFE(0x006EE281);
}


x86 assembly (clang, -O0):
<window_land_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <window_land_should_close@plt>
cmp    $0x0,%eax
jne    113e <window_land_close+0x1e>
mov    $0x6ee281,%edi
call   1040 <RCT2_CALLPROC_EBPSAFE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_land_close>:
push   %rax
xor    %eax,%eax
call   1030 <window_land_should_close@plt>
test   %eax,%eax
je     112e <window_land_close+0xe>
pop    %rax
ret
mov    $0x6ee281,%edi
pop    %rax
jmp    1040 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_land_close() {
%1 = call i32 (...) @window_land_should_close()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 7266945)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @window_land_close() {
%1 = tail call i32 (...) @window_land_should_close()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 7266945)
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(struct tm *, struct tm *, int);
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) {
  struct tm *ts = NULL;
  ts = gmtime(timer);
  if (ts == NULL)
    return NULL;
  memcpy(result, ts, sizeof(struct tm));
  ts = result;
  return ts;
}


x86 assembly (clang, -O0):
<OPENSSL_gmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115d <OPENSSL_gmtime+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    117f <OPENSSL_gmtime+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPENSSL_gmtime>:
push   %rbx
mov    %rsi,%rbx
call   1040 <gmtime@plt>
test   %rax,%rax
je     1140 <OPENSSL_gmtime+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
jmp    1142 <OPENSSL_gmtime+0x22>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @OPENSSL_gmtime(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(%struct.tm* %1, %struct.tm* %3, i32 4)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printError(char *e) { fprintf(stderr, "ERROR: %s\n", e); }


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

x86 assembly (clang, -O2):
<printError>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @printError(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 ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @printError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void foo667() {}


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

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

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

LLVM IR (-O2):
define void @foo667() {
ret void
}
void printForward(unsigned int Address) {}


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

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

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

LLVM IR (-O2):
define void @printForward(i32 %0) {
ret void
}
__attribute__((weak)) void fbo_use(int i) {
  ;
  (void)sizeof(i);
}


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

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

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

LLVM IR (-O2):
define weak void @fbo_use(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_log_write_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_log@%p::genwrite (rtpp_log_write) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_log_write_fin>:
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   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_log_write_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_log@%p::genwrite (rtpp_log_write) is invoked after destruction\0A\00"
define void @rtpp_log_write_fin(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 ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_log@%p::genwrite (rtpp_log_write) is invoked after destruction\0A\00"
define void @rtpp_log_write_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PrintChristmasTree(int);
int main() {
  PrintChristmasTree(4);
  PrintChristmasTree(7);
  PrintChristmasTree(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <PrintChristmasTree@plt>
mov    $0x7,%edi
call   1030 <PrintChristmasTree@plt>
mov    $0xb,%edi
call   1030 <PrintChristmasTree@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PrintChristmasTree(i32 4)
%2 = tail call i32 @PrintChristmasTree(i32 7)
%3 = tail call i32 @PrintChristmasTree(i32 11)
ret i32 0
}
void d2i_X509(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509() {
ret void
}
double sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void g_string_append() {}


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

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

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

LLVM IR (-O2):
define void @g_string_append() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
void expecterr(char *msg, int res) {
  if (res == 0)
    printf("no error on %s\n", msg);
  else
    perror(msg);
}


x86 assembly (clang, -O0):
<expecterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114e <expecterr+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <expecterr+0x37>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expecterr>:
mov    %rdi,%rax
test   %esi,%esi
jne    1136 <expecterr+0x16>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
mov    %rax,%rdi
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"no error on %s\0A\00"
define void @expecterr(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @perror(i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"no error on %s\0A\00"
define void @expecterr(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
long int VALUE(char *s) {
  long int S;
  int i;
  i = 0;
  S = 0;
  while (*(s + i) != 'B') {
    S <<= 1;
    if (*(s + i) == '1')
      S++;
    i++;
  }
  return (S);
}


x86 assembly (clang, -O0):
<VALUE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x42,%eax
je     1167 <VALUE+0x67>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    1159 <VALUE+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <VALUE+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VALUE>:
mov    (%rdi),%cl
cmp    $0x42,%cl
jne    110a <VALUE+0xa>
xor    %eax,%eax
ret
add    $0x1,%rdi
xor    %eax,%eax
xor    %edx,%edx
cmp    $0x31,%cl
sete   %dl
lea    (%rdx,%rax,2),%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x42,%cl
jne    1110 <VALUE+0x10>
ret

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

LLVM IR (-O2):
define i64 @VALUE(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 66
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 1
%9 = icmp eq i8 %6, 49
%10 = zext i1 %9 to i64
%11 = or i64 %8, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 66
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %17
}
/* Type definitions */
typedef int GLint;

/* Variables and functions */
int /*<<< orphan*/ GL_VIEWPORT;
int /*<<< orphan*/ glGetIntegerv(int /*<<< orphan*/, int *);
void get_viewport_dimensions(int *width, int *height) {
  GLint viewport[4];
  glGetIntegerv(GL_VIEWPORT, viewport);
  *width = viewport[2];
  *height = viewport[3];
}


x86 assembly (clang, -O0):
<get_viewport_dimensions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <glGetIntegerv@plt>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_viewport_dimensions>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <glGetIntegerv@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@GL_VIEWPORT = global i32 0
define void @get_viewport_dimensions(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32, i32* @GL_VIEWPORT
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = call i32 @glGetIntegerv(i32 %6, i32* %7)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
store i32 %10, i32* %11
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
@GL_VIEWPORT = global i32 0
define void @get_viewport_dimensions(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = load i32, i32* @GL_VIEWPORT
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = call i32 @glGetIntegerv(i32 %5, i32* %6)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%9 = load i32, i32* %8
store i32 %9, i32* %0
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%11 = load i32, i32* %10
store i32 %11, i32* %1
ret void
}
void my_isr(int n) {}


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

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

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

LLVM IR (-O2):
define void @my_isr(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f34(unsigned long x,
                                               unsigned long y) {
  unsigned long r = x + y;
  if (r <= y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1141 <f34+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f34>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f34+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f34(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ule i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @f34(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void set_uint32(char *buf, const uint32_t val) {
  buf[0] = (val >> 0) & 0xFF;
  buf[1] = (val >> 8) & 0xFF;
  buf[2] = (val >> 16) & 0xFF;
  buf[3] = (val >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<set_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_uint32(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 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = ashr i32 %23, 24
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
ret void
}

LLVM IR (-O2):
define void @set_uint32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int fh_itch_main(int, char **, int);
int main(int argc, char **argv) { return fh_itch_main(argc, argv, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <fh_itch_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edx
jmp    1030 <fh_itch_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @fh_itch_main(i32 %0, i8** %1, i32 1)
ret i32 %3
}
void SSIDMAEnable(unsigned long ulBase, unsigned long ulDMAFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000024))) |= ulDMAFlags;
}


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

x86 assembly (clang, -O2):
<SSIDMAEnable>:
or     %rsi,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @SSIDMAEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 36
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
int compare(const void *a1, const void *a2) {
  return (*((int *)a1) - *((int *)a2));
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void exch(int *a, int *b) {
  *a = *a + *b;
  *b = *a - *b;
  *a = *a - *b;
}


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

x86 assembly (clang, -O2):
<exch>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @exch(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = sub nsw i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @exch(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
void network_release(void) {}


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

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

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

LLVM IR (-O2):
define void @network_release() {
ret void
}
/* Variables and functions */
int SV_FindIndex(char *, int, int, int);
int SV_ImageIndex(char *name) {
  return SV_FindIndex(name, ((32 + 256) + 256), 256, 1);
}


x86 assembly (clang, -O0):
<SV_ImageIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x220,%esi
mov    $0x100,%edx
mov    $0x1,%ecx
call   1030 <SV_FindIndex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_ImageIndex>:
mov    $0x220,%esi
mov    $0x100,%edx
mov    $0x1,%ecx
jmp    1030 <SV_FindIndex@plt>

LLVM IR (-O0):
define i32 @SV_ImageIndex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @SV_FindIndex(i8* %3, i32 544, i32 256, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @SV_ImageIndex(i8* %0) {
%2 = tail call i32 @SV_FindIndex(i8* %0, i32 544, i32 256, i32 1)
ret i32 %2
}
unsigned long _hashString(char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<_hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <_hashString+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_hashString+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <_hashString+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_hashString+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @_hashString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = load i64, i64* %3
%13 = shl i64 %12, 5
%14 = load i64, i64* %3
%15 = add i64 %13, %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = add i64 %15, %17
store i64 %18, i64* %3
br label %5
19: ; preds = %5
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @_hashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ nmn4_write_data();
void nmn4_write(void) { nmn4_write_data(); }


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

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

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

LLVM IR (-O2):
define void @nmn4_write() {
%1 = tail call i32 (...) @nmn4_write_data()
ret void
}
/* Variables and functions */
int cbreak();
int wrap_cbreak(void) { return cbreak(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_cbreak() {
%1 = tail call i32 (...) @cbreak()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rm_dup(char *, int);
int main(int argc, char **argv) {
  char s[] = "aaabbbccccddddssssaaabbbccc";
  rm_dup(s, 28);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x1c,%esi
call   1040 <rm_dup@plt>
lea    -0x30(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1c,%esi
call   1040 <rm_dup@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [28 x i8] c"aaabbbccccddddssssaaabbbccc\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [28 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [28 x i8]* %5 to i8*
%7 = getelementptr inbounds [28 x i8], [28 x i8]* %5, i64 0, i64 0
%8 = call i32 @rm_dup(i8* %7, i32 28)
%9 = getelementptr inbounds [28 x i8], [28 x i8]* %5, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [28 x i8] c"aaabbbccccddddssssaaabbbccc\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [28 x i8]
%4 = getelementptr inbounds [28 x i8], [28 x i8]* %3, i64 0, i64 0
%5 = call i32 @rm_dup(i8* %4, i32 28)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ntkresolv_safe_exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void version(void) {
  printf(
      "ntk-resolv version %s (Netsukuku tools)\n\n"
      "Copyright (C) 2006.\n"
      "This is free software.  You may redistribute copies of it under the "
      "terms of\n"
      "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
      "There is NO WARRANTY, to the extent permitted by law.\n\n"
      "Report bugs and ideas to <%s>.\n",
      "0.3.3", "efphe@netsukuku.org");
  ntkresolv_safe_exit(1);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xff6(%rip),%rsi
lea    0xff5(%rip),%rdx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <ntkresolv_safe_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xff9(%rip),%rsi
lea    0xff8(%rip),%rdx
call   1040 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ntkresolv_safe_exit@plt>

LLVM IR (-O0):
@.str = [296 x i8] c"ntk-resolv version %s (Netsukuku tools)\0A\0ACopyright (C) 2006.\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AReport bugs and ideas to <%s>.\0A\00"
@.str.1 = [6 x i8] c"0.3.3\00"
@.str.2 = [20 x i8] c"efphe@netsukuku.org\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([296 x i8], [296 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @ntkresolv_safe_exit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [296 x i8] c"ntk-resolv version %s (Netsukuku tools)\0A\0ACopyright (C) 2006.\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AReport bugs and ideas to <%s>.\0A\00"
@.str.1 = [6 x i8] c"0.3.3\00"
@.str.2 = [20 x i8] c"efphe@netsukuku.org\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([296 x i8], [296 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @ntkresolv_safe_exit(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recap();
int /*<<< orphan*/ test_jeu();
int /*<<< orphan*/ test_matrix();
int /*<<< orphan*/ test_util();
int main() {
  test_jeu();
  test_util();
  test_matrix();
  recap();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_jeu@plt>
xor    %eax,%eax
call   1060 <test_util@plt>
xor    %eax,%eax
call   1050 <test_matrix@plt>
xor    %eax,%eax
call   1040 <recap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_jeu()
%3 = call i32 (...) @test_util()
%4 = call i32 (...) @test_matrix()
%5 = call i32 (...) @recap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_jeu()
%2 = tail call i32 (...) @test_util()
%3 = tail call i32 (...) @test_matrix()
%4 = tail call i32 (...) @recap()
ret i32 0
}
/* Variables and functions */
char *str_legacy_to_utf8_internal(char const *, char const *, int);
char *str_legacy_to_utf8(const char *string, const char *legacy_encoding) {
  return str_legacy_to_utf8_internal(string, legacy_encoding, -1);
}


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

x86 assembly (clang, -O2):
<str_legacy_to_utf8>:
mov    $0xffffffff,%edx
jmp    1030 <str_legacy_to_utf8_internal@plt>

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

LLVM IR (-O2):
define i8* @str_legacy_to_utf8(i8* %0, i8* %1) {
%3 = tail call i8* @str_legacy_to_utf8_internal(i8* %0, i8* %1, i32 -1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/ *, int /*<<< orphan*/);
void write_unaligned(uint8_t *p, uint64_t x) { write((uint64_t *)(p + 1), x); }


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

x86 assembly (clang, -O2):
<write_unaligned>:
add    $0x4,%rdi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_unaligned(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = tail call i32 @write(i32* %3, i32 %1)
ret void
}
void foo745() {}


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

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

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

LLVM IR (-O2):
define void @foo745() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_xrl_atRi(char *str, unsigned char i) {
  sprintf(str, "XRL   A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<sprint_xrl_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_xrl_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"XRL A, @R%X \00"
define void @sprint_xrl_atRi(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"XRL A, @R%X \00"
define void @sprint_xrl_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int mem_unlock(pthread_mutex_t *lock, const char *info) {
  printf("unlock  : [%s]\n", info);
  return pthread_mutex_unlock(lock);
}


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

x86 assembly (clang, -O2):
<mem_unlock>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"unlock : [%s]\0A\00"
define i32 @mem_unlock(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32*, i32** %3
%8 = call i32 @pthread_mutex_unlock(i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"unlock : [%s]\0A\00"
define i32 @mem_unlock(i32* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 %4
}