xunge/DecIR huggingface dataset:
/* Variables and functions */
int mpu_write_mem(int, int, unsigned char *);
int dmp_set_tap_time(unsigned short time) {
  unsigned short dmp_time;
  unsigned char tmp[2];
  dmp_time = time / (1000 / (200));
  tmp[0] = (unsigned char)(dmp_time >> 8);
  tmp[1] = (unsigned char)(dmp_time & 0xFF);
  return mpu_write_mem(478, 2, tmp);
}


x86 assembly (clang, -O0):
<dmp_set_tap_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdx
mov    $0x1de,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_set_tap_time>:
push   %rax
imul   $0xcccd,%edi,%eax
shr    $0x12,%eax
rol    $0x8,%ax
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x1de,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dmp_set_tap_time(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca [2 x i8]
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = sdiv i32 %6, 5
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %12, i8* %13
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %17, i8* %18
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%20 = call i32 @mpu_write_mem(i32 478, i32 2, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @dmp_set_tap_time(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = udiv i16 %0, 5
%5 = lshr i16 %4, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %3
%7 = trunc i16 %4 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @mpu_write_mem(i32 478, i32 2, i8* %3)
ret i32 %9
}
void RTFileAioCtxWakeup(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioCtxWakeup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strings_new(char *src) {
  char *ptr = NULL;
  if (src == NULL) {
    return NULL;
  }
  ptr = malloc(sizeof(char) * strlen(src));
  assert(ptr != NULL);
  strcpy(ptr, src);
  return ptr;
}


x86 assembly (clang, -O0):
<strings_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <strings_new+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    11ad <strings_new+0x6d>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_new>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1176 <strings_new+0x36>
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1178 <strings_new+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strings_new(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %10
10: ; preds = %1, %3
%11 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %11
}
void lpc_pin_init() {}


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

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

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

LLVM IR (-O2):
define void @lpc_pin_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char nome[10];
  gets(nome);
  int i;
  for (i = 0; nome[i] != '\0'; i++) {
    printf("%c", nome[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
call   1040 <gets@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1174 <main+0x54>
movslq -0x14(%rbp),%rax
lea    0xea4(%rip),%rdi
movsbl -0xe(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
call   1040 <gets@plt>
mov    0xe(%rsp),%al
test   %al,%al
je     1166 <main+0x46>
lea    0xf(%rsp),%rbx
lea    0xebb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %10, %6 ], [ 0, %0 ]
%8 = phi i8 [ %12, %6 ], [ %4, %0 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %0
ret i32 0
}
int prefilter(void *workspace, char *packet, int size) { return 2; }


x86 assembly (clang, -O0):
<prefilter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @prefilter(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 2
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  int i;
  long base = 42;
  for (i = 0; i < strlen(word); i++) {
    base += word[i] * (i + 1);
  }
  return base;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <hash+0x64>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <hash+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %14, %4 ], [ 42, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = add nuw nsw i64 %5, 1
%11 = mul i64 %10, %9
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = add nsw i64 %6, %13
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %10, %16
br i1 %17, label %4, label %18
18: ; preds = %4, %1
%19 = phi i64 [ 42, %1 ], [ %14, %4 ]
ret i64 %19
}
/* Variables and functions */
long double exp(double);
__attribute__((weak)) long double expl(long double x) { return exp((double)x); }


x86 assembly (clang, -O0):
<expl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define weak x86_fp80 @expl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @exp(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @expl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @exp(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("Value 8.0 ^ 3 = %lf\n", pow(8.0, 3));
  printf("Value 3.05 ^ 1.98 = %lf\n", pow(3.05, 1.98));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  0xed9(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea6(%rip),%xmm0
movsd  0xea6(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <pow@plt>
lea    0xee3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1040 <pow@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Value 8.0 ^ 3 = %lf\0A\00"
@.str.1 = [25 x i8] c"Value 3.05 ^ 1.98 = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pow(double 8.000000e+00, double 3.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @pow(double 3.050000e+00, double 1.980000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Value 8.0 ^ 3 = %lf\0A\00"
@.str.1 = [25 x i8] c"Value 3.05 ^ 1.98 = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @pow(double 8.000000e+00, double 3.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @pow(double 3.050000e+00, double 1.980000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int dlg_count_wchars(char const *);
int *dlg_index_columns(char const *);
int strlen(char const *);
int dlg_count_columns(const char *string) {
  int result = 0;
  int limit = dlg_count_wchars(string);
  if (limit > 0) {
    const int *cols = dlg_index_columns(string);
    result = cols[limit];
  } else {
    result = strlen(string);
  }
  return result;
}


x86 assembly (clang, -O0):
<dlg_count_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <dlg_count_wchars@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1179 <dlg_count_columns+0x49>
mov    -0x8(%rbp),%rdi
call   1030 <dlg_index_columns@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <dlg_count_columns+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_count_columns>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <dlg_count_wchars@plt>
test   %eax,%eax
jle    1155 <dlg_count_columns+0x25>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <dlg_index_columns@plt>
mov    %ebp,%ecx
mov    (%rax,%rcx,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strlen@plt>

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

LLVM IR (-O2):
define i32 @dlg_count_columns(i8* %0) {
%2 = tail call i32 @dlg_count_wchars(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32* @dlg_index_columns(i8* %0)
%6 = zext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = load i32, i32* %7
br label %11
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %0)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ %8, %4 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void err_no_file(char *str) {
  write(2, "msh: No such file or directory ", 32);
  write(2, str, ft_strlen(str));
  write(2, "\n", 1);
}


x86 assembly (clang, -O0):
<err_no_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xec8(%rip),%rsi
mov    $0x20,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xeb1(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_no_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x2,%edi
mov    $0x20,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <ft_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec8(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"msh: No such file or directory \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @err_no_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 32)
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @ft_strlen(i8* %5)
%7 = call i32 @write(i32 2, i8* %4, i32 %6)
%8 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"msh: No such file or directory \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @err_no_file(i8* %0) {
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 32)
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
bool nrf52_errata_210(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_210() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void scope2(void) {
  int a = 4;
  if (1) {
    int a = 0;
    printf("%i\n", a);
  }
  printf("%i\n", a);
}


x86 assembly (clang, -O0):
<scope2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scope2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @scope2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIA1_SetInterruptFlag(int /*<<< orphan*/);
void VIA1_iCA2_PulseNtfy(void) { VIA1_SetInterruptFlag(0); }


x86 assembly (clang, -O0):
<VIA1_iCA2_PulseNtfy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <VIA1_SetInterruptFlag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIA1_iCA2_PulseNtfy>:
xor    %edi,%edi
jmp    1030 <VIA1_SetInterruptFlag@plt>

LLVM IR (-O0):
define void @VIA1_iCA2_PulseNtfy() {
%1 = call i32 @VIA1_SetInterruptFlag(i32 0)
ret void
}

LLVM IR (-O2):
define void @VIA1_iCA2_PulseNtfy() {
%1 = tail call i32 @VIA1_SetInterruptFlag(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char const *);
int /*<<< orphan*/ clamp(int /*<<< orphan*/, int, int);
int16_t conv_word(const char *data) {
  return clamp(atoi(data), -0x7FFF, 0x7FFF);
}


x86 assembly (clang, -O0):
<conv_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
mov    $0xffff8001,%esi
mov    $0x7fff,%edx
call   1030 <clamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_word>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%edi
mov    $0xffff8001,%esi
mov    $0x7fff,%edx
pop    %rax
jmp    1030 <clamp@plt>

LLVM IR (-O0):
define i32 @conv_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @atoi(i8* %3)
%5 = call i32 @clamp(i32 %4, i32 -32767, i32 32767)
ret i32 %5
}

LLVM IR (-O2):
define i32 @conv_word(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @clamp(i32 %2, i32 -32767, i32 32767)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_current_time(struct timeval *t) { gettimeofday(t, NULL); }


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

x86 assembly (clang, -O2):
<get_current_time>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @get_current_time(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 10;
  int b = 11;
  int tmp;
  tmp = a;
  a = b;
  b = tmp;
  printf("a=%d, b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xb,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%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
mov    $0xb,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11, i32 10)
ret i32 0
}
void setval_424(unsigned *p) { *p = 2455290452U; }


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

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

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

LLVM IR (-O2):
define void @setval_424(i32* nocapture writeonly %0) {
store i32 -1839676844, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cls();
int /*<<< orphan*/ putbitstr(char *, int, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setcharattr(int);
int /*<<< orphan*/ setcursor(int, int);
void show_welcome(void) {
  setcharattr(0x1f);
  cls();
  putbitstr("SCOS", 12, 11, 12);
  setcursor(40, 23);
  puts("Author: Shen Chi      Ver 0.02");
  setcursor(1, 25);
  puts("Loading...\n\r");
}


x86 assembly (clang, -O0):
<show_welcome>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
call   1040 <setcharattr@plt>
mov    $0x0,%al
call   1050 <cls@plt>
lea    0xe94(%rip),%rdi
mov    $0xc,%ecx
mov    $0xb,%edx
mov    %ecx,%esi
call   1060 <putbitstr@plt>
mov    $0x28,%edi
mov    $0x17,%esi
call   1070 <setcursor@plt>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x19,%esi
call   1070 <setcursor@plt>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_welcome>:
push   %rax
mov    $0x1f,%edi
call   1040 <setcharattr@plt>
xor    %eax,%eax
call   1050 <cls@plt>
lea    0xe97(%rip),%rdi
mov    $0xc,%esi
mov    $0xb,%edx
mov    $0xc,%ecx
call   1060 <putbitstr@plt>
mov    $0x28,%edi
mov    $0x17,%esi
call   1070 <setcursor@plt>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x19,%esi
call   1070 <setcursor@plt>
lea    0xe76(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"SCOS\00"
@.str.1 = [31 x i8] c"Author: Shen Chi Ver 0.02\00"
@.str.2 = [13 x i8] c"Loading...\0A\0D\00"
define void @show_welcome() {
%1 = call i32 @setcharattr(i32 31)
%2 = call i32 (...) @cls()
%3 = call i32 @putbitstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12, i32 11, i32 12)
%4 = call i32 @setcursor(i32 40, i32 23)
%5 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @setcursor(i32 1, i32 25)
%7 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"SCOS\00"
@.str.1 = [31 x i8] c"Author: Shen Chi Ver 0.02\00"
@.str.2 = [13 x i8] c"Loading...\0A\0D\00"
define void @show_welcome() {
%1 = tail call i32 @setcharattr(i32 31)
%2 = tail call i32 (...) @cls()
%3 = tail call i32 @putbitstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12, i32 11, i32 12)
%4 = tail call i32 @setcursor(i32 40, i32 23)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @setcursor(i32 1, i32 25)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}
char *has_query_string(const char *uri) {
  while (*uri != 0) {
    if (*uri == '?')
      return (char *)uri;
    ++uri;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_query_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <has_query_string+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
jne    1135 <has_query_string+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <has_query_string+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <has_query_string+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_query_string>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <has_query_string+0x22>
cmp    $0x3f,%cl
je     1124 <has_query_string+0x24>
add    $0x1,%rax
jmp    1110 <has_query_string+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @has_query_string(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 63, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int utilIsLittleEndian() {
  const unsigned char s[4] = {1, 0, 0, 0};
  const int32_t *n = (int32_t *)&s;
  return (*n == 1);
}


x86 assembly (clang, -O0):
<utilIsLittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.utilIsLittleEndian.s = [4 x i8] c"\01\00\00\00"
define i32 @utilIsLittleEndian() {
%1 = alloca [4 x i8]
%2 = alloca i32*
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %1 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @utilIsLittleEndian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ print_usage();
int main(int argc, char *argv[]) {
  bool verbose = true;
  switch (argc) {
  case 9:
    verbose = false;
    break;
  case 10:
    verbose = true;
    break;
  default:
    print_usage();
    return -1;
  }
  verbose = ~verbose;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x9,%eax
je     1152 <main+0x42>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0xa,%eax
je     115e <main+0x4e>
jmp    116a <main+0x5a>
movl   $0x0,-0x14(%rbp)
jmp    117d <main+0x6d>
movl   $0x1,-0x14(%rbp)
jmp    117d <main+0x6d>
mov    $0x0,%al
call   1030 <print_usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <main+0x7d>
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x2,%edi
jb     112b <main+0x1b>
push   %rax
xor    %eax,%eax
call   1030 <print_usage@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %10 [
i32 9, label %8
i32 10, label %9
]
8: ; preds = %2
store i32 0, i32* %6
br label %12
9: ; preds = %2
store i32 1, i32* %6
br label %12
10: ; preds = %2
%11 = call i32 (...) @print_usage()
store i32 -1, i32* %3
br label %15
12: ; preds = %9, %8
%13 = load i32, i32* %6
%14 = xor i32 %13, -1
store i32 %14, i32* %6
store i32 0, i32* %3
br label %15
15: ; preds = %12, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @print_usage()
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
double asin(double x) { return 0; }


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

x86 assembly (clang, -O2):
<asin>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @asin(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int read_until_with_ignore(char *, int, char, int /*<<< orphan*/,
                           int /*<<< orphan*/, int);
int read_until(char *out, int outlen, char separator, int fd) {
  return read_until_with_ignore(out, outlen, separator, 0, 0, fd);
}


x86 assembly (clang, -O0):
<read_until>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xd(%rbp),%al
mov    -0x14(%rbp),%r9d
xor    %r8d,%r8d
movsbl %al,%edx
mov    %r8d,%ecx
call   1030 <read_until_with_ignore@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_until>:
mov    %ecx,%r9d
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <read_until_with_ignore@plt>

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

LLVM IR (-O2):
define i32 @read_until(i8* %0, i32 %1, i8 signext %2, i32 %3) {
%5 = tail call i32 @read_until_with_ignore(i8* %0, i32 %1, i8 signext %2, i32 0, i32 0, i32 %3)
ret i32 %5
}
char *utoa(unsigned int u, char *s, int size) {
  char *t;
  t = s + size;
  *--t = '\0';
  do
    *--t = (u % 10) + '0';
  while (u /= 10);
  return t;
}


x86 assembly (clang, -O0):
<utoa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,-0x1(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1130 <utoa+0x30>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa>:
movslq %edx,%rcx
lea    (%rsi,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
movb   $0x0,-0x1(%rsi,%rcx,1)
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
or     $0x30,%cl
mov    %cl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1120 <utoa+0x20>
ret

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

LLVM IR (-O2):
define i8* @utoa(i32 %0, i8* writeonly %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 0, i8* %6
br label %7
7: ; preds = %7, %3
%8 = phi i32 [ %0, %3 ], [ %14, %7 ]
%9 = phi i8* [ %6, %3 ], [ %13, %7 ]
%10 = urem i32 %8, 10
%11 = trunc i32 %10 to i8
%12 = or i8 %11, 48
%13 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 %12, i8* %13
%14 = udiv i32 %8, 10
%15 = icmp ult i32 %8, 10
br i1 %15, label %16, label %7
16: ; preds = %7
ret i8* %13
}
void null_pause(struct codec *c, int p) {}


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

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

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

LLVM IR (-O2):
%struct.codec = type opaque
define void @null_pause(%struct.codec* nocapture %0, i32 %1) {
ret void
}
char *strcpy(char *dst, const char *src) {
  char *cp = dst;
  while ((*cp++ = *src++) != '\0')
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ display(int, int, int **);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int matrix1[4][5] = {0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
                       10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
  printf("\nMatrix contains . . . \n");
  display(4, 5, matrix1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    0xef5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdx
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <display@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.matrix1 = [4 x [5 x i32]] [[5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4], [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9], [5 x i32] [i32 10, i32 11, i32 12, i32 13, i32 14], [5 x i32] [i32 15, i32 16, i32 17, i32 18, i32 19]]
@.str = [25 x i8] c"\0AMatrix contains . . . \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [4 x [5 x i32]]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %2, i64 0, i64 0
%6 = bitcast [5 x i32]* %5 to i32**
%7 = call i32 @display(i32 4, i32 5, i32** %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix1 = [4 x [5 x i32]] [[5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4], [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9], [5 x i32] [i32 10, i32 11, i32 12, i32 13, i32 14], [5 x i32] [i32 15, i32 16, i32 17, i32 18, i32 19]]
@str = [24 x i8] c"\0AMatrix contains . . . \00"
define i32 @main() {
%1 = alloca [4 x [5 x i32]]
%2 = bitcast [4 x [5 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = bitcast [4 x [5 x i32]]* %1 to i32**
%5 = call i32 @display(i32 4, i32 5, i32** %4)
ret i32 0
}
int main(void) {
  -1 << 5;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int OSProcessMsg() { ; }


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

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

LLVM IR (-O0):
define i32 @OSProcessMsg() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @OSProcessMsg() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XGraphicsExposeEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XGraphicsExposeEvent_display(void *_p, void *_v) {
  ((XGraphicsExposeEvent *)_p)->display = (Display *)_v;
}


x86 assembly (clang, -O0):
<set_XGraphicsExposeEvent_display>:
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_XGraphicsExposeEvent_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGraphicsExposeEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef scalar_t__ __v4hi;
typedef scalar_t__ __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_add_pi16(__m64 __m1, __m64 __m2) {
  return (__m64)((__v4hi)__m1 + (__v4hi)__m2);
}


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

x86 assembly (clang, -O2):
<_mm_add_pi16>:
lea    (%rdi,%rsi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @_mm_add_pi16(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exec_opts_add();
int /*<<< orphan*/ file_opts_add();
int /*<<< orphan*/ incoming_opts_add();
int /*<<< orphan*/ log_opts_add();
int /*<<< orphan*/ outgoing_opts_add();
int /*<<< orphan*/ server_opts_add();
int /*<<< orphan*/ stdinout_opts_add();
void adsbus_opts_add() {
  server_opts_add();
  log_opts_add();
  outgoing_opts_add();
  incoming_opts_add();
  exec_opts_add();
  file_opts_add();
  stdinout_opts_add();
}


x86 assembly (clang, -O0):
<adsbus_opts_add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <server_opts_add@plt>
mov    $0x0,%al
call   1060 <log_opts_add@plt>
mov    $0x0,%al
call   1040 <outgoing_opts_add@plt>
mov    $0x0,%al
call   1050 <incoming_opts_add@plt>
mov    $0x0,%al
call   1030 <exec_opts_add@plt>
mov    $0x0,%al
call   1070 <file_opts_add@plt>
mov    $0x0,%al
call   1080 <stdinout_opts_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adsbus_opts_add>:
push   %rax
xor    %eax,%eax
call   1090 <server_opts_add@plt>
xor    %eax,%eax
call   1060 <log_opts_add@plt>
xor    %eax,%eax
call   1040 <outgoing_opts_add@plt>
xor    %eax,%eax
call   1050 <incoming_opts_add@plt>
xor    %eax,%eax
call   1030 <exec_opts_add@plt>
xor    %eax,%eax
call   1070 <file_opts_add@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <stdinout_opts_add@plt>

LLVM IR (-O0):
define void @adsbus_opts_add() {
%1 = call i32 (...) @server_opts_add()
%2 = call i32 (...) @log_opts_add()
%3 = call i32 (...) @outgoing_opts_add()
%4 = call i32 (...) @incoming_opts_add()
%5 = call i32 (...) @exec_opts_add()
%6 = call i32 (...) @file_opts_add()
%7 = call i32 (...) @stdinout_opts_add()
ret void
}

LLVM IR (-O2):
define void @adsbus_opts_add() {
%1 = tail call i32 (...) @server_opts_add()
%2 = tail call i32 (...) @log_opts_add()
%3 = tail call i32 (...) @outgoing_opts_add()
%4 = tail call i32 (...) @incoming_opts_add()
%5 = tail call i32 (...) @exec_opts_add()
%6 = tail call i32 (...) @file_opts_add()
%7 = tail call i32 (...) @stdinout_opts_add()
ret void
}