xunge/DecIR huggingface dataset:
char ToUpper(char a) {
  if (97 <= a && a < 122)
    return (char)(a - 32);
  return a;
}


x86 assembly (clang, -O0):
<ToUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1137 <ToUpper+0x37>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jge    1137 <ToUpper+0x37>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    113d <ToUpper+0x3d>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x19,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @ToUpper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 97, %5
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @ToUpper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 25
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int gpio_read(int pi, unsigned gpio) {
  return pigpio_command(pi, 3, gpio, 0, 1);
}


x86 assembly (clang, -O0):
<gpio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x3,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_read>:
mov    %esi,%edx
mov    $0x3,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @gpio_read(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 = call i32 @pigpio_command(i32 %5, i32 3, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @gpio_read(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 3, i32 %1, i32 0, i32 1)
ret i32 %3
}
void invMixColumns(unsigned char *const block) {
  int i;
  unsigned char *temp = block;
  for (i = 0; i < 4; i++) {
    invMixColumn(temp);
    temp += 4;
  }
}


x86 assembly (clang, -O0):
<invMixColumns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    115a <invMixColumns+0x4a>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <invMixColumn@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <invMixColumns+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invMixColumns>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <invMixColumn@plt>
lea    0x4(%rbx),%rdi
xor    %eax,%eax
call   1030 <invMixColumn@plt>
lea    0x8(%rbx),%rdi
xor    %eax,%eax
call   1030 <invMixColumn@plt>
add    $0xc,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <invMixColumn@plt>

LLVM IR (-O0):
define void @invMixColumns(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
store i32 0, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @invMixColumn to i32 (i8*, ...)*)(i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 4
store i8* %13, i8** %4
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @invMixColumns(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @invMixColumn to i32 (i8*, ...)*)(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @invMixColumn to i32 (i8*, ...)*)(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @invMixColumn to i32 (i8*, ...)*)(i8* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 12
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @invMixColumn to i32 (i8*, ...)*)(i8* %7)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int fork();
int getpgid(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  pid_t pid;
  pid_t pgid = getpgid(0);
  setpgid(0, 0);
  kill(-1 * pgid, SIGKILL);
  while (1) {
    while ((pid = fork()) != -1) {
      if (pid == 0) {
        setpgid(0, 0);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <getpgid@plt>
mov    %eax,-0xc(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1050 <setpgid@plt>
imul   $0xffffffff,-0xc(%rbp),%edi
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
jmp    117c <main+0x3c>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     11a7 <main+0x67>
cmpl   $0x0,-0x8(%rbp)
jne    11a2 <main+0x62>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <setpgid@plt>
jmp    117c <main+0x3c>
jmp    1177 <main+0x37>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <getpgid@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <setpgid@plt>
neg    %ebx
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <kill@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
jne    1170 <main+0x30>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <setpgid@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@SIGKILL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @getpgid(i32 0)
store i32 %4, i32* %3
%5 = call i32 @setpgid(i32 0, i32 0)
%6 = load i32, i32* %3
%7 = mul nsw i32 -1, %6
%8 = load i32, i32* @SIGKILL
%9 = call i32 @kill(i32 %7, i32 %8)
br label %10
10: ; preds = %0, %20
br label %11
11: ; preds = %19, %10
%12 = call i32 (...) @fork()
store i32 %12, i32* %2
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @setpgid(i32 0, i32 0)
br label %19
19: ; preds = %17, %14
br label %11
20: ; preds = %11
br label %10
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define i32 @main() {
%1 = tail call i32 @getpgid(i32 0)
%2 = tail call i32 @setpgid(i32 0, i32 0)
%3 = sub nsw i32 0, %1
%4 = load i32, i32* @SIGKILL
%5 = tail call i32 @kill(i32 %3, i32 %4)
br label %6
6: ; preds = %11, %0
%7 = tail call i32 (...) @fork()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @setpgid(i32 0, i32 0)
br label %11
11: ; preds = %9, %6
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void closedirp(DIR **d) {
  if (*d)
    closedir(*d);
}


x86 assembly (clang, -O0):
<closedirp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <closedirp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedirp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <closedirp+0xd>
jmp    1030 <closedir@plt>
ret

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

LLVM IR (-O2):
define void @closedirp(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void inputb_report_driver_all(char *s, unsigned size) { *s = 0; }


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

x86 assembly (clang, -O2):
<inputb_report_driver_all>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @inputb_report_driver_all(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
store i8 0, i8* %5
ret void
}

LLVM IR (-O2):
define void @inputb_report_driver_all(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ sync_primitive();
void mmio_writew(uint16_t val, void *addr) {
  *(volatile uint16_t *)addr = val;
  sync_primitive();
}


x86 assembly (clang, -O0):
<mmio_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <sync_primitive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_writew>:
mov    %edi,(%rsi)
xor    %eax,%eax
jmp    1030 <sync_primitive@plt>

LLVM IR (-O0):
define void @mmio_writew(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
%8 = call i32 (...) @sync_primitive()
ret void
}

LLVM IR (-O2):
define void @mmio_writew(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
%4 = tail call i32 (...) @sync_primitive()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("Usage: iron [-hvsu] -p <password>\n"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: iron [-hvsu] -p <password>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"Usage: iron [-hvsu] -p <password>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert1();
int main(void) {
  assert1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @assert1()
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
int /*<<< orphan*/ sysbail(char *, unsigned long);
char *bstrdup(const char *s) {
  char *p;
  size_t len;
  len = strlen(s) + 1;
  p = malloc(len);
  if (p == NULL)
    sysbail("failed to strdup %lu bytes", (unsigned long)len);
  memcpy(p, s, len);
  return p;
}


x86 assembly (clang, -O0):
<bstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1186 <bstrdup+0x46>
mov    -0x18(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1060 <sysbail@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1172 <bstrdup+0x32>
lea    0xe96(%rip),%rdi
mov    %r15,%rsi
call   1060 <sysbail@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"failed to strdup %lu bytes\00"
define i8* @bstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i64, i64* %4
%15 = call i32 @sysbail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %1
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = load i64, i64* %4
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [27 x i8] c"failed to strdup %lu bytes\00"
define i8* @bstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @sysbail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int is_ht_workaround_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_ht_workaround_enabled() {
ret i32 0
}
/* Variables and functions */
scalar_t__ dlg_ok_buttoncode(int);
int dlg_prev_ok_buttonindex(int current, int extra) {
  int result = current - 1;
  if (result < extra) {
    for (result = 0; dlg_ok_buttoncode(result + 1) >= 0; ++result) {
      ;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<dlg_prev_ok_buttonindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1167 <dlg_prev_ok_buttonindex+0x57>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <dlg_ok_buttoncode@plt>
cmp    $0x0,%rax
jl     1162 <dlg_prev_ok_buttonindex+0x52>
jmp    1154 <dlg_prev_ok_buttonindex+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <dlg_prev_ok_buttonindex+0x2a>
jmp    1167 <dlg_prev_ok_buttonindex+0x57>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_prev_ok_buttonindex>:
push   %rbx
cmp    %esi,%edi
jle    111c <dlg_prev_ok_buttonindex+0xc>
mov    %edi,%ebx
add    $0xffffffff,%ebx
jmp    1140 <dlg_prev_ok_buttonindex+0x30>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x2(%rbx),%edi
call   1030 <dlg_ok_buttoncode@plt>
add    $0x1,%ebx
test   %rax,%rax
jns    1130 <dlg_prev_ok_buttonindex+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dlg_prev_ok_buttonindex(i32 %0, i32 %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
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %2
store i32 0, i32* %5
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i64 @dlg_ok_buttoncode(i32 %14)
%16 = icmp sge i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %12
br label %18
18: ; preds = %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %12
21: ; preds = %12
br label %22
22: ; preds = %21, %2
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @dlg_prev_ok_buttonindex(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = icmp sgt i32 %0, %1
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i64 @dlg_ok_buttoncode(i32 %7)
%9 = icmp sgt i64 %8, -1
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = phi i32 [ %3, %2 ], [ %6, %5 ]
ret i32 %11
}
void hostapd_ubus_free_bss(struct hostapd_data *hapd) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define void @hostapd_ubus_free_bss(%struct.hostapd_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exif_put_value(int const, int const, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/ *);
void exif_remove_tag(const int ifd_nr, const int tag_id) {
  exif_put_value(ifd_nr, tag_id, 1, 0, 0, NULL);
}


x86 assembly (clang, -O0):
<exif_remove_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
mov    %r8d,%ecx
call   1030 <exif_put_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exif_remove_tag>:
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <exif_put_value@plt>

LLVM IR (-O0):
define void @exif_remove_tag(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 = call i32 @exif_put_value(i32 %5, i32 %6, i32 1, i32 0, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @exif_remove_tag(i32 %0, i32 %1) {
%3 = tail call i32 @exif_put_value(i32 %0, i32 %1, i32 1, i32 0, i32 0, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ limits;

/* Variables and functions */
float *movArray(float *, int);
float *getOctaveLimits(void) {
  float limits[] = {11,  22,   44,   88,   177,   355,
                    710, 1420, 2840, 5680, 11360, 22720};
  return movArray(limits, sizeof(limits));
}


x86 assembly (clang, -O0):
<getOctaveLimits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x30,%esi
call   1030 <movArray@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOctaveLimits>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x30,%esi
call   1030 <movArray@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.getOctaveLimits.limits = [12 x float] [float 1.100000e+01, float 2.200000e+01, float 4.400000e+01, float 8.800000e+01, float 1.770000e+02, float 3.550000e+02, float 7.100000e+02, float 1.420000e+03, float 2.840000e+03, float 5.680000e+03, float 1.136000e+04, float 2.272000e+04]
define float* @getOctaveLimits() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call float* @movArray(float* %3, i32 48)
ret float* %4
}

LLVM IR (-O2):
@__const.getOctaveLimits.limits = [12 x float] [float 1.100000e+01, float 2.200000e+01, float 4.400000e+01, float 8.800000e+01, float 1.770000e+02, float 3.550000e+02, float 7.100000e+02, float 1.420000e+03, float 2.840000e+03, float 5.680000e+03, float 1.136000e+04, float 2.272000e+04]
define float* @getOctaveLimits() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call float* @movArray(float* %3, i32 48)
ret float* %4
}
unsigned long __attribute__((always_)) x86_pushf_cli(void) {
  unsigned long result;
  __asm__ volatile("pushf; cli; pop %0" : "=g"(result));
  return result;
}


x86 assembly (clang, -O0):
<x86_pushf_cli>:
push   %rbp
mov    %rsp,%rbp
pushf
cli
pop    -0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_pushf_cli>:
pushf
cli
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @x86_pushf_cli() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  char str[3] = "abc";
  int i;
  for (i = 0; i < 5; i++) {
    printf("str[%d]=%c\n", i, str[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    116a <main+0x5a>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
lea    0xeb1(%rip),%rdi
movsbl -0x7(%rbp,%rax,1),%edx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x62,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x63,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"str[%d]=%c\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 0, i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, i8 signext 98)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i8 signext 99)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i8 signext undef)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4, i8 signext undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_socket;
int /*<<< orphan*/ abort();
scalar_t__ foo();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  if (foo() <= 0)
    abort();
  syscall(SYS_socket, 0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
jg     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jle    1155 <main+0x25>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SYS_socket = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = load i32, i32* @SYS_socket
%8 = call i32 @syscall(i32 %7, i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@SYS_socket = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp slt i64 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = load i32, i32* @SYS_socket
%7 = tail call i32 @syscall(i32 %6, i32 0, i32 0, i32 0)
ret i32 0
}
int dog_init() { return (1 == 1); }


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

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

LLVM IR (-O0):
define i32 @dog_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @dog_init() {
ret i32 1
}
/* Type definitions */
struct drunkard {
  int dummy;
};

/* Variables and functions */
scalar_t__ drunkard_rng_chance(struct drunkard *, double);
int /*<<< orphan*/ drunkard_target_random_east_edge(struct drunkard *);
int /*<<< orphan*/ drunkard_target_random_west_edge(struct drunkard *);
void drunkard_target_random_westeast_edge(struct drunkard *drunk) {
  if (drunkard_rng_chance(drunk, 0.5))
    drunkard_target_random_west_edge(drunk);
  else
    drunkard_target_random_east_edge(drunk);
}


x86 assembly (clang, -O0):
<drunkard_target_random_westeast_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xeb8(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
cmp    $0x0,%rax
je     1165 <drunkard_target_random_westeast_edge+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <drunkard_target_random_west_edge@plt>
jmp    116e <drunkard_target_random_westeast_edge+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <drunkard_target_random_east_edge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drunkard_target_random_westeast_edge>:
push   %rbx
mov    %rdi,%rbx
movsd  0xec4(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114f <drunkard_target_random_westeast_edge+0x1f>
pop    %rbx
jmp    1030 <drunkard_target_random_west_edge@plt>
pop    %rbx
jmp    1050 <drunkard_target_random_east_edge@plt>

LLVM IR (-O0):
%struct.drunkard = type { i32 }
define void @drunkard_target_random_westeast_edge(%struct.drunkard* %0) {
%2 = alloca %struct.drunkard*
store %struct.drunkard* %0, %struct.drunkard** %2
%3 = load %struct.drunkard*, %struct.drunkard** %2
%4 = call i64 @drunkard_rng_chance(%struct.drunkard* %3, double 5.000000e-01)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.drunkard*, %struct.drunkard** %2
%8 = call i32 @drunkard_target_random_west_edge(%struct.drunkard* %7)
br label %12
9: ; preds = %1
%10 = load %struct.drunkard*, %struct.drunkard** %2
%11 = call i32 @drunkard_target_random_east_edge(%struct.drunkard* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
%struct.drunkard = type { i32 }
define void @drunkard_target_random_westeast_edge(%struct.drunkard* %0) {
%2 = tail call i64 @drunkard_rng_chance(%struct.drunkard* %0, double 5.000000e-01)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @drunkard_target_random_west_edge(%struct.drunkard* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @drunkard_target_random_east_edge(%struct.drunkard* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FirstReverse(int /*<<< orphan*/);
int /*<<< orphan*/ gets(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  FirstReverse(gets(stdin));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <gets@plt>
mov    %eax,%edi
call   1040 <FirstReverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <gets@plt>
mov    %eax,%edi
call   1040 <FirstReverse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @gets(i32 %2)
%4 = call i32 @FirstReverse(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @gets(i32 %1)
%3 = tail call i32 @FirstReverse(i32 %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int tv_sec;
  long long tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
long long get_user_time() {
  struct rusage rusage = {};
  getrusage(RUSAGE_SELF, &rusage);
  return rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec;
}


x86 assembly (clang, -O0):
<get_user_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1040 <getrusage@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_time>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i64 }
@RUSAGE_SELF = global i32 0
define i64 @get_user_time() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i64 }
@RUSAGE_SELF = global i32 0
define i64 @get_user_time() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %8
ret i64 %11
}
/* Type definitions */
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dns_dummy_cb(struct dns_ctx *ctx, void *result, void *data) {
  if (result)
    free(result);
  data = ctx = 0;
}


x86 assembly (clang, -O0):
<dns_dummy_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <dns_dummy_cb+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_dummy_cb>:
test   %rsi,%rsi
je     111d <dns_dummy_cb+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.dns_ctx = type { i32 }
define void @dns_dummy_cb(%struct.dns_ctx* %0, i8* %1, i8* %2) {
%4 = alloca %struct.dns_ctx*
%5 = alloca i8*
%6 = alloca i8*
store %struct.dns_ctx* %0, %struct.dns_ctx** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9, %3
store %struct.dns_ctx* null, %struct.dns_ctx** %4
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
%struct.dns_ctx = type { i32 }
define void @dns_dummy_cb(%struct.dns_ctx* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
unsigned sb_file_size(char const *filename) {
  FILE *f;
  unsigned size;
  f = fopen(filename, "rb");
  fseek(f, 0, SEEK_END);
  size = ftell(f);
  fclose(f);
  return size;
}


x86 assembly (clang, -O0):
<sb_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_file_size>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @sb_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @sb_file_size(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
ret i32 %5
}
void dlst_scr_init(void) {}


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

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

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

LLVM IR (-O2):
define void @dlst_scr_init() {
ret void
}
void foo758(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo758(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *dec2hex(int dec, char *buffer) {
  sprintf(buffer, "%X", dec);
  return buffer;
}


x86 assembly (clang, -O0):
<dec2hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2hex>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
define i8* @dec2hex(i32 %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %1
}
void av_fifo_size() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_size() {
ret void
}
void q() {
  int j;
  int a[100];
  for (j = 0; j < 100; j++)
    a[j] = j;
}


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1138 <q+0x38>
mov    -0x4(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <q+0x12>
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @q() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %9
store i32 %7, i32* %10
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @q() {
ret void
}
int my_ptr_strlen(char **tab) {
  int i;
  i = 0;
  while (tab[i++] != '\0')
    i = i + my_strlen(tab[i]);
  return (i);
}


x86 assembly (clang, -O0):
<my_ptr_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1168 <my_ptr_strlen+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <my_strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_ptr_strlen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ptr_strlen>:
push   %r14
push   %rbx
push   %rax
cmpq   $0x0,(%rdi)
je     1152 <my_ptr_strlen+0x42>
mov    %rdi,%r14
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %eax,%rbx
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <my_strlen@plt>
lea    (%rax,%rbx,1),%ecx
add    %ebx,%eax
add    $0x1,%eax
movslq %ecx,%rcx
cmpq   $0x0,(%r14,%rcx,8)
jne    1130 <my_ptr_strlen+0x20>
jmp    1157 <my_ptr_strlen+0x47>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @my_ptr_strlen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ 1, %1 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @my_strlen to i32 (i8*, ...)*)(i8* %8)
%10 = add nsw i32 %9, %5
%11 = add nsw i32 %10, 1
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8*, i8** %0, i64 %12
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 1, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ chkabs();
int /*<<< orphan*/ expres();
void absexpres(void) {
  expres();
  chkabs();
}


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

x86 assembly (clang, -O2):
<absexpres>:
push   %rax
xor    %eax,%eax
call   1040 <expres@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <chkabs@plt>

LLVM IR (-O0):
define void @absexpres() {
%1 = call i32 (...) @expres()
%2 = call i32 (...) @chkabs()
ret void
}

LLVM IR (-O2):
define void @absexpres() {
%1 = tail call i32 (...) @expres()
%2 = tail call i32 (...) @chkabs()
ret void
}
void __atomic_store_4(volatile void *atom, unsigned int value, int memorder) {
  *(volatile unsigned int *)atom = value;
}


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

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

LLVM IR (-O0):
define void @__atomic_store_4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store volatile i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @__atomic_store_4(i8* %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
void c2x(void) { emit("setc [__xflag]\n"); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"setc [__xflag]\0A\00"
define void @c2x() {
%1 = tail call i32 @emit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void foo(void *(*v_args)[]) {
  void ***p = (void ***)v_args;
  int i;
  for (i = 0; i < 3; i++)
    printf("%p\n", p[0][i]);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115e <foo+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <foo+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rsi
lea    0xedc(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    0x8(%rax),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    0x10(%rax),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @foo([0 x i8*]* nocapture %0) {
%2 = bitcast [0 x i8*]* %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
void sig_winch(int sig) {
  endwin();
  initscr();
  refresh();
}


x86 assembly (clang, -O0):
<sig_winch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <endwin@plt>
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_winch>:
push   %rax
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @sig_winch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 (...) @initscr()
%5 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @sig_winch(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @refresh()
ret void
}