xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t *wcscat(wchar_t *__restrict s1, const wchar_t *__restrict s2) {
  wchar_t *cp;
  cp = s1;
  while (*cp != L'\0')
    cp++;
  while ((*cp++ = *s2++) != L'\0')
    ;
  return (s1);
}


x86 assembly (clang, -O0):
<wcscat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1132 <wcscat+0x32>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <wcscat+0x14>
jmp    1137 <wcscat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1167 <wcscat+0x67>
jmp    1137 <wcscat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpl   $0x0,(%rcx)
lea    0x4(%rcx),%rcx
jne    1110 <wcscat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    (%rsi,%rdx,1),%edi
mov    %edi,-0x4(%rcx,%rdx,1)
add    $0x4,%rdx
test   %edi,%edi
jne    1120 <wcscat+0x20>
ret

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

LLVM IR (-O2):
define i32* @wcscat(i32* noalias returned %0, i32* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %7, %3 ]
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i32, i32* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i32* [ %11, %8 ], [ %1, %3 ]
%10 = phi i32* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i32, i32* %9, i64 1
%12 = load i32, i32* %9
%13 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %12, i32* %10
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i32* %0
}
void EC_GROUP_get_curve_name(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_curve_name() {
ret void
}
/* Variables and functions */
int rand();
int random_between(int min, int max) {
  if (max <= min)
    max = min + 1;
  return rand() % (max - min) + min;
}


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1133 <random_between+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x1(%rbx),%ebp
cmp    %edi,%esi
cmovg  %esi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebx,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @random_between(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = add nsw i32 %0, 1
%5 = select i1 %3, i32 %1, i32 %4
%6 = tail call i32 (...) @rand()
%7 = sub nsw i32 %5, %0
%8 = srem i32 %6, %7
%9 = add nsw i32 %8, %0
ret i32 %9
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sema_init(struct semaphore *, int);
void init_MUTEX(struct semaphore *sem) {
  sema_init(sem, 1);
  return;
}


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

x86 assembly (clang, -O2):
<init_MUTEX>:
mov    $0x1,%esi
jmp    1030 <sema_init@plt>

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @init_MUTEX(%struct.semaphore* %0) {
%2 = tail call i32 @sema_init(%struct.semaphore* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 21;
  while (a < 30001) {
    printf("%d\n", a);
    a = a + 42;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
cmpl   $0x7531,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2a,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffeb,%ebx
lea    0xee0(%rip),%r14
add    $0x2a,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x7507,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 21, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 30001
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 42
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 21, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 42
%5 = icmp ult i32 %2, 29959
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void __tiger__flush() { fflush(stdout); }


x86 assembly (clang, -O0):
<__tiger__flush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tiger__flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @__tiger__flush() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @__tiger__flush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
long unsigned int yystrlen(const char *yystr) {
  long unsigned int yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
    continue;
  return yylen;
}


x86 assembly (clang, -O0):
<yystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <yystrlen+0x38>
jmp    1127 <yystrlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <yystrlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yystrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <yystrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @yystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int test_imm_D0int16_reg(short val) {
  return ((val) & (-0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D0int16_reg>:
test   $0xff30,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D0int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -208
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D0int16_reg(i16 signext %0) {
%2 = and i16 %0, -208
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *procprt_S_e(struct tstat *curstat, int avgval, int nsecs) { return "E"; }


x86 assembly (clang, -O0):
<procprt_S_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [2 x i8] c"E\00"
define i8* @procprt_S_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [2 x i8] c"E\00"
define i8* @procprt_S_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int skip_ahead_multi(char const **);
int skip_ahead_until(const char *text) {
  const char *strings[2];
  strings[0] = text;
  strings[1] = NULL;
  return skip_ahead_multi(strings);
}


x86 assembly (clang, -O0):
<skip_ahead_until>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <skip_ahead_multi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ahead_until>:
sub    $0x18,%rsp
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <skip_ahead_multi@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @skip_ahead_until(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8*]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
store i8* %4, i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 1
store i8* null, i8** %6
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%8 = call i32 @skip_ahead_multi(i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @skip_ahead_until(i8* %0) {
%2 = alloca [2 x i8*]
%3 = bitcast [2 x i8*]* %2 to i8*
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* %0, i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* null, i8** %5
%6 = call i32 @skip_ahead_multi(i8** %4)
ret i32 %6
}
/* Variables and functions */
size_t KEY_POWER;
int KEY_VOLUMEUP;
int device_toggle_display(volatile char *key_pressed, int key_code) {
  return key_pressed[KEY_POWER] && key_code == KEY_VOLUMEUP;
}


x86 assembly (clang, -O0):
<device_toggle_display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ee2(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,1),%al
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     113f <device_toggle_display+0x3f>
mov    -0xc(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_toggle_display>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rdi,%rax,1)
setne  %al
mov    0x2eb8(%rip),%rcx
cmp    %esi,(%rcx)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
@KEY_POWER = global i64 0
@KEY_VOLUMEUP = global i32 0
define i32 @device_toggle_display(i8* %0, i32 %1) {
%3 = load i64, i64* @KEY_POWER
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load volatile i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = load i32, i32* @KEY_VOLUMEUP
%8 = icmp eq i32 %7, %1
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
void mr97311_setcolors(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @mr97311_setcolors(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Content-type: text/plain\n\n");
  printf("Hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Content-type: text/plain\0A\0A\00"
@.str.1 = [13 x i8] c"Hello world\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Content-type: text/plain\0A\00"
@str.2 = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ ilogbf(float);
float scalbf(float, float);
float significandf(float x) { return scalbf(x, (float)-ilogbf(x)); }


x86 assembly (clang, -O0):
<significandf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ilogbf@plt>
movss  -0x8(%rbp),%xmm0
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2ss %rax,%xmm1
call   1040 <scalbf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<significandf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <ilogbf@plt>
neg    %rax
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <scalbf@plt>

LLVM IR (-O0):
define float @significandf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i64 @ilogbf(float %4)
%6 = sub nsw i64 0, %5
%7 = sitofp i64 %6 to float
%8 = call float @scalbf(float %3, float %7)
ret float %8
}

LLVM IR (-O2):
define float @significandf(float %0) {
%2 = tail call i64 @ilogbf(float %0)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to float
%5 = tail call float @scalbf(float %0, float %4)
ret float %5
}
/* Variables and functions */
char *create_double_quote(char const *);
char *create_wpa_psk(const char *psk) { return create_double_quote(psk); }


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

x86 assembly (clang, -O2):
<create_wpa_psk>:
jmp    1030 <create_double_quote@plt>

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

LLVM IR (-O2):
define i8* @create_wpa_psk(i8* %0) {
%2 = tail call i8* @create_double_quote(i8* %0)
ret i8* %2
}
int my_atoi(char *str) {}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
char *strchr(char const *, char);
const char *NextPhoneme(const char *phonemes) {
  phonemes = strchr(phonemes, ',');
  if (phonemes) {
    ++phonemes;
  }
  return phonemes;
}


x86 assembly (clang, -O0):
<NextPhoneme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <NextPhoneme+0x35>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextPhoneme>:
push   %rax
mov    $0x2c,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @NextPhoneme(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ mem_free();
int /*<<< orphan*/ proc_free();
int /*<<< orphan*/ swapfile_free();
int /*<<< orphan*/ tlb_free();
void sim_free(void) {
  mem_free();
  swapfile_free();
  proc_free();
  tlb_free();
}


x86 assembly (clang, -O0):
<sim_free>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mem_free@plt>
mov    $0x0,%al
call   1050 <swapfile_free@plt>
mov    $0x0,%al
call   1030 <proc_free@plt>
mov    $0x0,%al
call   1060 <tlb_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_free>:
push   %rax
xor    %eax,%eax
call   1040 <mem_free@plt>
xor    %eax,%eax
call   1050 <swapfile_free@plt>
xor    %eax,%eax
call   1030 <proc_free@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <tlb_free@plt>

LLVM IR (-O0):
define void @sim_free() {
%1 = call i32 (...) @mem_free()
%2 = call i32 (...) @swapfile_free()
%3 = call i32 (...) @proc_free()
%4 = call i32 (...) @tlb_free()
ret void
}

LLVM IR (-O2):
define void @sim_free() {
%1 = tail call i32 (...) @mem_free()
%2 = tail call i32 (...) @swapfile_free()
%3 = tail call i32 (...) @proc_free()
%4 = tail call i32 (...) @tlb_free()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_dct4_1d_internal_c(int /*<<< orphan*/ *const,
                                          int /*<<< orphan*/ const, int const,
                                          int const, int /*<<< orphan*/);
void dav1d_inv_dct4_1d_c(int32_t *const c, const ptrdiff_t stride,
                         const int min, const int max) {
  inv_dct4_1d_internal_c(c, stride, min, max, 0);
}


x86 assembly (clang, -O0):
<dav1d_inv_dct4_1d_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <inv_dct4_1d_internal_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_inv_dct4_1d_c>:
xor    %r8d,%r8d
jmp    1030 <inv_dct4_1d_internal_c@plt>

LLVM IR (-O0):
define void @dav1d_inv_dct4_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @inv_dct4_1d_internal_c(i32* %9, i32 %10, i32 %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @dav1d_inv_dct4_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @inv_dct4_1d_internal_c(i32* %0, i32 %1, i32 %2, i32 %3, i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void set_XCreateWindowEvent_window(void *_p, unsigned long _v) {
  ((XCreateWindowEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCreateWindowEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ not_scary();
int /*<<< orphan*/ scary();
int /*<<< orphan*/ somewhat_scary();
int f(void) {
  scary();
  not_scary();
  somewhat_scary();
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <scary@plt>
mov    $0x0,%al
call   1030 <not_scary@plt>
mov    $0x0,%al
call   1040 <somewhat_scary@plt>
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1050 <scary@plt>
xor    %eax,%eax
call   1030 <not_scary@plt>
xor    %eax,%eax
call   1040 <somewhat_scary@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 (...) @scary()
%2 = call i32 (...) @not_scary()
%3 = call i32 (...) @somewhat_scary()
ret i32 3
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @scary()
%2 = tail call i32 (...) @not_scary()
%3 = tail call i32 (...) @somewhat_scary()
ret i32 3
}
int test_imm_08uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x08 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_08uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 8
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_08uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 34359738368
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void oom(void) {
  write(2, "Out of memory.\n", 15);
  exit(255);
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oom>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0xf,%edx
call   1030 <write@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
define void @oom() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory.\0A\00"
define void @oom() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = tail call i32 @exit(i32 255)
unreachable
}
int pft_file_open(struct file *filp, const struct cred *cred) { return 0; }


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

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

LLVM IR (-O0):
%struct.file = type opaque
%struct.cred = type opaque
define i32 @pft_file_open(%struct.file* %0, %struct.cred* %1) {
%3 = alloca %struct.file*
%4 = alloca %struct.cred*
store %struct.file* %0, %struct.file** %3
store %struct.cred* %1, %struct.cred** %4
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
%struct.cred = type opaque
define i32 @pft_file_open(%struct.file* nocapture readnone %0, %struct.cred* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double tan(double);
int main() {
  double param, result;
  param = 45.0;
  result = tan(param * 3.14159265 / 180.0);
  printf("The tangent of %f degrees is %f.\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The tangent of %f degrees is %f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 4.500000e+01, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 0x400921FB53C8D4F1
%6 = fdiv double %5, 1.800000e+02
%7 = call double @tan(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The tangent of %f degrees is %f.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double 4.500000e+01, double 0x3FEFFFFFFF094FAF)
ret i32 0
}
int do_897() { return 897; }


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

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

LLVM IR (-O0):
define i32 @do_897() {
ret i32 897
}

LLVM IR (-O2):
define i32 @do_897() {
ret i32 897
}
unsigned int wby_sha1_rol(unsigned int value, unsigned int bits) {
  return ((value) << bits) | (value >> (32 - bits));
}


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

x86 assembly (clang, -O2):
<wby_sha1_rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @wby_sha1_rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void handler(int signo __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
short smax(short a, short b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<smax>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <smax+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <smax+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<smax>:
mov    %esi,%eax
cmp    %ax,%di
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @smax(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @smax(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
void tempo() { delay_ms(5); }


x86 assembly (clang, -O0):
<tempo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempo>:
mov    $0x5,%edi
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @tempo() {
%1 = call i32 @delay_ms(i32 5)
ret void
}

LLVM IR (-O2):
define void @tempo() {
%1 = tail call i32 @delay_ms(i32 5)
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};

/* Variables and functions */
void *rb_find(struct rbtree *, void *);
void *rb_findi(struct rbtree *rb, int key) {
  return rb_find(rb, ((void *)(key)));
}


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

x86 assembly (clang, -O2):
<rb_findi>:
movslq %esi,%rsi
jmp    1030 <rb_find@plt>

LLVM IR (-O0):
%struct.rbtree = type { i32 }
define i8* @rb_findi(%struct.rbtree* %0, i32 %1) {
%3 = alloca %struct.rbtree*
%4 = alloca i32
store %struct.rbtree* %0, %struct.rbtree** %3
store i32 %1, i32* %4
%5 = load %struct.rbtree*, %struct.rbtree** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i8* @rb_find(%struct.rbtree* %5, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.rbtree = type { i32 }
define i8* @rb_findi(%struct.rbtree* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @rb_find(%struct.rbtree* %0, i8* %4)
ret i8* %5
}
int caccess_read_pointer_int(int *address) { return *address; }


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

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

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

LLVM IR (-O2):
define i32 @caccess_read_pointer_int(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printStairCase(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printStairCase(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <printStairCase@plt>
xor    %eax,%eax
pop    %rcx
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 @printStairCase(i32 %4)
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 @printStairCase(i32 %4)
ret i32 0
}
unsigned GetAlpha(const unsigned int color) {
  return ((color & 0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<GetAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAlpha>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @GetAlpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetAlpha(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
unsigned int Reverse4(volatile unsigned int x) {
  return ((x & 0x0000ff00) << 8) | ((x & 0x00ff0000) >> 8) |
         ((x & 0xff000000) >> 24) | ((x & 0x000000ff) << 24);
}


x86 assembly (clang, -O0):
<Reverse4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reverse4>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
mov    -0x4(%rsp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %eax,%ecx
mov    -0x4(%rsp),%edx
shr    $0x18,%edx
or     %ecx,%edx
mov    -0x4(%rsp),%eax
shl    $0x18,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @Reverse4(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = and i32 %3, 65280
%5 = shl i32 %4, 8
%6 = load volatile i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load volatile i32, i32* %2
%11 = and i32 %10, -16777216
%12 = lshr i32 %11, 24
%13 = or i32 %9, %12
%14 = load volatile i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @Reverse4(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 16711680
%6 = load volatile i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %8, %5
%10 = load volatile i32, i32* %2
%11 = lshr i32 %10, 24
%12 = or i32 %9, %11
%13 = load volatile i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int GetInput(char *);
int Sum(int, int);
int /*<<< orphan*/ printf(char *, int);
void CallSum() {
  int x = GetInput("Give First Number:"), y = GetInput("Give Second Number:");
  printf("The sum of the 2 numbers is: %d\n", Sum(x, y));
}


x86 assembly (clang, -O0):
<CallSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <GetInput@plt>
mov    %eax,-0x4(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <GetInput@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <Sum@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CallSum>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <GetInput@plt>
mov    %eax,%ebx
lea    0xecd(%rip),%rdi
call   1030 <GetInput@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <Sum@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Give First Number:\00"
@.str.1 = [20 x i8] c"Give Second Number:\00"
@.str.2 = [33 x i8] c"The sum of the 2 numbers is: %d\0A\00"
define void @CallSum() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @GetInput(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = call i32 @GetInput(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @Sum(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Give First Number:\00"
@.str.1 = [20 x i8] c"Give Second Number:\00"
@.str.2 = [33 x i8] c"The sum of the 2 numbers is: %d\0A\00"
define void @CallSum() {
%1 = tail call i32 @GetInput(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @GetInput(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @Sum(i32 %1, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_useGroff();
int /*<<< orphan*/ initColours();
int /*<<< orphan*/ startWorld();
int /*<<< orphan*/ twoDsim_drawCollisionFrames(int, int);
int /*<<< orphan*/ twoDsim_fps(double);
void _M2_circle_init(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {
  deviceIf_useGroff();
  twoDsim_drawCollisionFrames((1 == 1), (1 == 1));
  twoDsim_fps(80.0);
  initColours();
  startWorld();
}


x86 assembly (clang, -O0):
<_M2_circle_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <deviceIf_useGroff@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <twoDsim_drawCollisionFrames@plt>
movsd  0xe86(%rip),%xmm0
call   1060 <twoDsim_fps@plt>
mov    $0x0,%al
call   1050 <initColours@plt>
mov    $0x0,%al
call   1040 <startWorld@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_M2_circle_init>:
push   %rax
xor    %eax,%eax
call   1030 <deviceIf_useGroff@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <twoDsim_drawCollisionFrames@plt>
movsd  0xe91(%rip),%xmm0
call   1060 <twoDsim_fps@plt>
xor    %eax,%eax
call   1050 <initColours@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <startWorld@plt>

LLVM IR (-O0):
define void @_M2_circle_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @deviceIf_useGroff()
%6 = call i32 @twoDsim_drawCollisionFrames(i32 1, i32 1)
%7 = call i32 @twoDsim_fps(double 8.000000e+01)
%8 = call i32 (...) @initColours()
%9 = call i32 (...) @startWorld()
ret void
}

LLVM IR (-O2):
define void @_M2_circle_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @deviceIf_useGroff()
%4 = tail call i32 @twoDsim_drawCollisionFrames(i32 1, i32 1)
%5 = tail call i32 @twoDsim_fps(double 8.000000e+01)
%6 = tail call i32 (...) @initColours()
%7 = tail call i32 (...) @startWorld()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e(unsigned int);
void g(unsigned int x) { e(x); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <e@plt>

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

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 @e(i32 %0)
ret void
}
/* Type definitions */
typedef int size;

/* Variables and functions */
int /*<<< orphan*/ assert(int *);
scalar_t__ malloc(int);
void *refc_alloc(size_t size) {
  int *alloc = (int *)malloc(((size) + sizeof(int) * 1));
  assert(alloc);
  if (alloc) {
    alloc[0] = 1;
    void *handle = ((void *)(((int *)alloc) + 1));

    return handle;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<refc_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
je     1176 <refc_alloc+0x56>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <refc_alloc+0x5e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refc_alloc>:
push   %rbx
add    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1145 <refc_alloc+0x25>
movl   $0x1,(%rbx)
add    $0x4,%rbx
jmp    1147 <refc_alloc+0x27>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @refc_alloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 4
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @assert(i32* %5)
%7 = icmp eq i64 %4, 0
br i1 %7, label %11, label %8
8: ; preds = %1
store i32 1, i32* %5
%9 = getelementptr inbounds i32, i32* %5, i64 1
%10 = bitcast i32* %9 to i8*
br label %11
11: ; preds = %1, %8
%12 = phi i8* [ %10, %8 ], [ null, %1 ]
ret i8* %12
}