xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("程序的进程id是：%d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\E7\A8\8B\E5\BA\8F\E7\9A\84\E8\BF\9B\E7\A8\8Bid\E6\98\AF\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"\E7\A8\8B\E5\BA\8F\E7\9A\84\E8\BF\9B\E7\A8\8Bid\E6\98\AF\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g(unsigned long, unsigned long, unsigned long);
void f1(unsigned long a, unsigned long b, unsigned long c, unsigned long i) {
  a += i;
  b += (a < i);
  c += (b == 0) && (a < i);
  g(a, b, c);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
jne    116c <f1+0x5c>
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
setb   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <g@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
add    %rcx,%rdi
setb   %al
adc    $0x0,%rsi
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    %rax,%rdx
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f1(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %5
%11 = add i64 %10, %9
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = load i64, i64* %8
%14 = icmp ult i64 %12, %13
%15 = zext i1 %14 to i32
%16 = sext i32 %15 to i64
%17 = load i64, i64* %6
%18 = add i64 %17, %16
store i64 %18, i64* %6
%19 = load i64, i64* %6
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %4
%22 = load i64, i64* %5
%23 = load i64, i64* %8
%24 = icmp ult i64 %22, %23
br label %25
25: ; preds = %21, %4
%26 = phi i1 [ false, %4 ], [ %24, %21 ]
%27 = zext i1 %26 to i32
%28 = sext i32 %27 to i64
%29 = load i64, i64* %7
%30 = add i64 %29, %28
store i64 %30, i64* %7
%31 = load i64, i64* %5
%32 = load i64, i64* %6
%33 = load i64, i64* %7
%34 = call i32 @g(i64 %31, i64 %32, i64 %33)
ret void
}

LLVM IR (-O2):
define void @f1(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %3, %0
%6 = icmp ult i64 %5, %3
%7 = zext i1 %6 to i64
%8 = add i64 %7, %1
%9 = icmp eq i64 %8, 0
%10 = and i1 %6, %9
%11 = zext i1 %10 to i64
%12 = add i64 %11, %2
%13 = tail call i32 @g(i64 %5, i64 %8, i64 %12)
ret void
}
/* Variables and functions */
void *TApplication_new(char *);
int /*<<< orphan*/ TApplication_run(void *, int /*<<< orphan*/);
int /*<<< orphan*/ TCanvas_draw(int /*<<< orphan*/);
int /*<<< orphan*/ TCanvas_new();
int main(int argc, char **argv) {
  void *app = TApplication_new("app");
  TCanvas_draw(TCanvas_new());
  TApplication_run(app, 0);
  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)
lea    0xea3(%rip),%rdi
call   1050 <TApplication_new@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <TCanvas_new@plt>
mov    %eax,%edi
call   1060 <TCanvas_draw@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1040 <TApplication_run@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1050 <TApplication_new@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <TCanvas_new@plt>
mov    %eax,%edi
call   1060 <TCanvas_draw@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <TApplication_run@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"app\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @TApplication_new(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = call i32 (...) @TCanvas_new()
%9 = call i32 @TCanvas_draw(i32 %8)
%10 = load i8*, i8** %6
%11 = call i32 @TApplication_run(i8* %10, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"app\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @TApplication_new(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @TCanvas_new()
%5 = tail call i32 @TCanvas_draw(i32 %4)
%6 = tail call i32 @TApplication_run(i8* %3, i32 0)
ret i32 0
}
/* Variables and functions */
char *freeipmi_strchr(const char *s, int c) {
  while (*s != '\0')
    if (*s == (char)c)
      return s;
    else
      s++;
  return (NULL);
}


x86 assembly (clang, -O0):
<freeipmi_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <freeipmi_strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <freeipmi_strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <freeipmi_strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <freeipmi_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <freeipmi_strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <freeipmi_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <freeipmi_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @freeipmi_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
/* Variables and functions */
scalar_t__ myGetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char line[999];
  while (myGetline(line, 999) > 0) {
    reverse(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e7,%esi
call   1050 <myGetline@plt>
cmp    $0x0,%rax
jle    1181 <main+0x51>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e7,%esi
call   1050 <myGetline@plt>
test   %rax,%rax
jle    1185 <main+0x55>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e7,%esi
call   1050 <myGetline@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [999 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [999 x i8], [999 x i8]* %2, i64 0, i64 0
%5 = call i64 @myGetline(i8* %4, i32 999)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [999 x i8], [999 x i8]* %2, i64 0, i64 0
%9 = call i32 @reverse(i8* %8)
%10 = getelementptr inbounds [999 x i8], [999 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [999 x i8]
%2 = getelementptr inbounds [999 x i8], [999 x i8]* %1, i64 0, i64 0
%3 = call i64 @myGetline(i8* %2, i32 999)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i64 @myGetline(i8* %2, i32 999)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ioperm(int, int, int);
int /*<<< orphan*/ outw(int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
__attribute__((noreturn)) void poweroff(void) {
  fflush(stdout);
  fflush(stderr);
  ioperm(0x604, 2, 1);
  outw(1 << 13, 0x604);
  sleep(30);
  fprintf(stderr, "\x1b[37m\x1b[41m\x1b[1mFailed to power off!!!\x1b[0m\n");
  exit(1);
}


x86 assembly (clang, -O0):
<poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x604,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <ioperm@plt>
mov    $0x2000,%edi
mov    $0x604,%esi
call   1060 <outw@plt>
mov    $0x1e,%edi
call   1080 <sleep@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe43(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<poweroff>:
push   %rbx
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e6a(%rip),%rbx
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x604,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <ioperm@plt>
mov    $0x2000,%edi
mov    $0x604,%esi
call   1060 <outw@plt>
mov    $0x1e,%edi
call   1080 <sleep@plt>
mov    (%rbx),%edi
lea    0xe4d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"\1B[37m\1B[41m\1B[1mFailed to power off!!!\1B[0m\0A\00"
define void @poweroff() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @ioperm(i32 1540, i32 2, i32 1)
%6 = call i32 @outw(i32 8192, i32 1540)
%7 = call i32 @sleep(i32 30)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"\1B[37m\1B[41m\1B[1mFailed to power off!!!\1B[0m\0A\00"
define void @poweroff() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @ioperm(i32 1540, i32 2, i32 1)
%6 = tail call i32 @outw(i32 8192, i32 1540)
%7 = tail call i32 @sleep(i32 30)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ xxswap8(float *, int, int);
void print_double(char *buf, char *c, int bigendian) {
  double *d;
  d = (double *)c;
  if (bigendian)
    xxswap8((float *)c, 1, 2);
  sprintf(buf, "%f", *d);
}


x86 assembly (clang, -O0):
<print_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1158 <print_double+0x38>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <xxswap8@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe95(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %edx,%edx
je     1140 <print_double+0x20>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <xxswap8@plt>
movsd  (%rbx),%xmm0
lea    0xeb5(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @print_double(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to double*
store double* %9, double** %7
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to float*
%15 = call i32 @xxswap8(float* %14, i32 1, i32 2)
br label %16
16: ; preds = %12, %3
%17 = load i8*, i8** %4
%18 = load double*, double** %7
%19 = load double, double* %18
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %19)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print_double(i8* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to float*
%7 = tail call i32 @xxswap8(float* %6, i32 1, i32 2)
br label %8
8: ; preds = %5, %3
%9 = bitcast i8* %1 to double*
%10 = load double, double* %9
%11 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %10)
ret void
}
int ObjCreateFlagToDbFileChar(int create_flag) {
  if (create_flag == 1)
    return ('=');
  else if (create_flag == 2)
    return ('*');
  else if (create_flag == 3)
    return ('-');
  else
    return ('?');
}


x86 assembly (clang, -O0):
<ObjCreateFlagToDbFileChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <ObjCreateFlagToDbFileChar+0x1d>
movl   $0x3d,-0x4(%rbp)
jmp    1150 <ObjCreateFlagToDbFileChar+0x50>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <ObjCreateFlagToDbFileChar+0x33>
movl   $0x2a,-0x4(%rbp)
jmp    1150 <ObjCreateFlagToDbFileChar+0x50>
cmpl   $0x3,-0x8(%rbp)
jne    1149 <ObjCreateFlagToDbFileChar+0x49>
movl   $0x2d,-0x4(%rbp)
jmp    1150 <ObjCreateFlagToDbFileChar+0x50>
movl   $0x3f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ObjCreateFlagToDbFileChar>:
add    $0xffffffff,%edi
mov    $0x3f,%eax
cmp    $0x2,%edi
ja     111a <ObjCreateFlagToDbFileChar+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ObjCreateFlagToDbFileChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 61, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 42, i32* %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 45, i32* %2
br label %16
15: ; preds = %11
store i32 63, i32* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table.ObjCreateFlagToDbFileChar = [3 x i32] [i32 61, i32 42, i32 45]
define i32 @ObjCreateFlagToDbFileChar(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.ObjCreateFlagToDbFileChar, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 63, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_init() {
  fprintf(stderr, "Starting VNA server.\n");
  system("/opt/redpitaya/www/apps/vna/start.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xed6(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xed9(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Starting VNA server.\0A\00"
@.str.1 = [37 x i8] c"/opt/redpitaya/www/apps/vna/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Starting VNA server.\0A\00"
@.str.1 = [37 x i8] c"/opt/redpitaya/www/apps/vna/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
__typeof__(stpncpy(1, 1, 1)) test_stpncpy_140(void) { return stpncpy(1, 1, 1); }


x86 assembly (clang, -O0):
<test_stpncpy_140>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <stpncpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stpncpy_140>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <stpncpy@plt>

LLVM IR (-O0):
define i8* @test_stpncpy_140() {
%1 = call i8* @stpncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_stpncpy_140() {
%1 = tail call i8* @stpncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
double itod(const uint64_t x) {
  union {
    uint64_t i;
    double d;
  } u;
  u.i = x;
  return u.d;
}


x86 assembly (clang, -O0):
<itod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<itod>:
mov    %edi,%eax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @itod(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @itod(i32 %0) {
%2 = zext i32 %0 to i64
%3 = bitcast i64 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void fig09_21() {
  char z[9];
  printf("%s", "Enter string: \n");
  scanf("%s[aeiou]", z);
  printf("The input was \"%s\"\n", z);
}


x86 assembly (clang, -O0):
<fig09_21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <printf@plt>
lea    -0x9(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x9(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_21>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x7(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [16 x i8] c"Enter string: \0A\00"
@.str.2 = [10 x i8] c"%s[aeiou]\00"
@.str.3 = [20 x i8] c"The input was \22%s\22\0A\00"
define void @fig09_21() {
%1 = alloca [9 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [16 x i8] c"Enter string: \0A\00"
@.str.2 = [10 x i8] c"%s[aeiou]\00"
@.str.3 = [20 x i8] c"The input was \22%s\22\0A\00"
define void @fig09_21() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2cmaster_SetStopBit(int /*<<< orphan*/);
void i2c0master_SetStopBit(void) { i2cmaster_SetStopBit(0); }


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

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

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

LLVM IR (-O2):
define void @i2c0master_SetStopBit() {
%1 = tail call i32 @i2cmaster_SetStopBit(i32 0)
ret void
}
t(int a) { return ((((a) > (1)) ? (a) : (1))); }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    111c <t+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <t+0x29>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <t+0x29>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
mov    $0x1,%eax
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
ret i32 %3
}
/* Variables and functions */
bool nrf53_errata_55(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_55() {
ret i32 0
}
void bwputs(char *string) {
  char c;
  while ((c = *string)) {
    while (*(((volatile unsigned int *)0x101f1000) + 0x06) & 0x20)
      ;
    *((volatile unsigned int *)0x101f1000) = c;
    string++;
  }
  return;
}


x86 assembly (clang, -O0):
<bwputs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1153 <bwputs+0x53>
jmp    111e <bwputs+0x1e>
mov    $0x101f1000,%eax
mov    0x18(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1137 <bwputs+0x37>
jmp    111e <bwputs+0x1e>
movsbl -0x9(%rbp),%ecx
mov    $0x101f1000,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <bwputs+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwputs>:
mov    (%rdi),%al
test   %al,%al
je     1133 <bwputs+0x33>
cs nopw 0x0(%rax,%rax,1)
testl  $0x20,0x101f1018
jne    1110 <bwputs+0x10>
movsbl %al,%eax
mov    %eax,0x101f1000
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <bwputs+0x10>
ret

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

LLVM IR (-O2):
define void @bwputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %14, %11 ], [ %2, %1 ]
%6 = phi i8* [ %13, %11 ], [ %0, %1 ]
br label %7
7: ; preds = %4, %7
%8 = load volatile i32, i32* inttoptr (i64 270471192 to i32*)
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7
%12 = sext i8 %5 to i32
store volatile i32 %12, i32* inttoptr (i64 270471168 to i32*)
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
ret void
}
/* Variables and functions */
scalar_t__ expm1(double);
float expm1f(float x) { return (float)expm1((double)x); }


x86 assembly (clang, -O0):
<expm1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <expm1@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1f>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <expm1@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @expm1f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @expm1(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @expm1f(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @expm1(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program) {
  printf("%s [server IP] [server port] [request flow size(KB)]\n", program);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"%s [server IP] [server port] [request flow size(KB)]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"%s [server IP] [server port] [request flow size(KB)]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ unlink(char const *);
void death(const char *msg, FILE *fdesc, const char *fname) {
  fprintf(stderr, msg);
  fclose(fdesc);
  unlink(fname);
  exit(1);
}


x86 assembly (clang, -O0):
<death>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<death>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @death(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %6
%13 = call i32 @unlink(i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @death(i8* %0, i32* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* %0)
%6 = tail call i32 @fclose(i32* %1)
%7 = tail call i32 @unlink(i8* %2)
%8 = tail call i32 @exit(i32 1)
unreachable
}
long int getDigitSum(long int N) {
  long int digitSum = 0;
  while (N) {
    digitSum += N % 10;
    N /= 10;
  }
  return digitSum;
}


x86 assembly (clang, -O0):
<getDigitSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <getDigitSum+0x48>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
add    -0x10(%rbp),%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <getDigitSum+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigitSum>:
test   %rdi,%rdi
je     1156 <getDigitSum+0x56>
mov    %rdi,%rsi
xor    %ecx,%ecx
movabs $0x6666666666666667,%r8
66 66 66
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rsi,%rdi
sub    %rax,%rdi
add    %rdi,%rcx
add    $0x9,%rsi
cmp    $0x12,%rsi
mov    %rdx,%rsi
ja     1120 <getDigitSum+0x20>
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @getDigitSum(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = srem i64 %5, 10
%7 = add nsw i64 %4, %6
%8 = sdiv i64 %5, 10
%9 = add i64 %5, 9
%10 = icmp ult i64 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %12
}
void vtmemset(loc, val, len) char *loc;
int val, len;
{
  while (len--)
    *loc++ = val;
}


x86 assembly (clang, -O0):
<vtmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     113d <vtmemset+0x3d>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110e <vtmemset+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtmemset>:
test   %edx,%edx
je     1120 <vtmemset+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @vtmemset(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
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
store i8 %13, i8* %14
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @vtmemset(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("%s -f datadev[:datadev:datadev] -b(ackup) -r(estore) -h(help)]\n",
         name);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"%s -f datadev[:datadev:datadev] -b(ackup) -r(estore) -h(help)]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [64 x i8] c"%s -f datadev[:datadev:datadev] -b(ackup) -r(estore) -h(help)]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int remote_vsend(int, char *, char *);
int remote_sig_xosd_show(char *text) {
  return remote_vsend(2, "xosd show ", text);
}


x86 assembly (clang, -O0):
<remote_sig_xosd_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <remote_vsend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_sig_xosd_show>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <remote_vsend@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"xosd show \00"
define i32 @remote_sig_xosd_show(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"xosd show \00"
define i32 @remote_sig_xosd_show(i8* %0) {
%2 = tail call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ar;

/* Variables and functions */
int f();
int g();
test() {
  short ar[f()][g()];
  return sizeof(ar) + sizeof(ar[0]);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %eax,%eax
mov    %al,-0x21(%rbp)
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x21(%rbp),%al
mov    %ecx,%ecx
mov    %rcx,-0x20(%rbp)
call   1040 <g@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
mov    %rsp,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rax,%rdx
imul   %rcx,%rdx
lea    0xf(%rdx,%rdx,1),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,%rsp
mov    %rax,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
imul   %rcx,%rax
shl    $0x1,%rax
shl    $0x1,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <g@plt>
imul   %eax,%ebx
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = call i32 (...) @f()
%5 = zext i32 %4 to i64
%6 = call i32 (...) @g()
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %1
%9 = mul nuw i64 %5, %7
%10 = alloca i16, i64 %9
store i64 %5, i64* %2
store i64 %7, i64* %3
%11 = mul nuw i64 %5, %7
%12 = mul nuw i64 2, %11
%13 = mul nsw i64 0, %7
%14 = getelementptr inbounds i16, i16* %10, i64 %13
%15 = mul nuw i64 2, %7
%16 = add i64 %12, %15
%17 = trunc i64 %16 to i32
%18 = load i8*, i8** %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
%3 = mul i32 %2, %1
%4 = add i32 %3, %2
%5 = shl i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int sqrt(int);
int fun(int n) {
  int m;
  m = sqrt(n);
  if (m * m == n)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1142 <fun+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <fun+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = mul nsw i32 %2, %2
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int close_4(int size) {
  int i = 4;
  while (i < size)
    i = i + 4;
  return i;
}


x86 assembly (clang, -O0):
<close_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <close_4+0x28>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <close_4+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_4>:
cmp    $0x5,%edi
mov    $0x4,%eax
cmovge %edi,%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @close_4(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 4)
%3 = add nuw i32 %2, 3
%4 = and i32 %3, -4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_AVTransport_SetPlayMode(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UpnpMediaRenderer_AVTransport_SetPlayMode(void *upnptoken,
                                               unsigned int InstanceID,
                                               char *NewPlayMode) {
  printf("Invoke: UpnpMediaRenderer_AVTransport_SetPlayMode(%u,%s);\r\n",
         InstanceID, NewPlayMode);
  UpnpResponse_MediaRenderer_AVTransport_SetPlayMode(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_SetPlayMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_MediaRenderer_AVTransport_SetPlayMode@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [60 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_SetPlayMode(%u,%s);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_SetPlayMode(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UpnpResponse_MediaRenderer_AVTransport_SetPlayMode(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_SetPlayMode(%u,%s);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_SetPlayMode(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_SetPlayMode(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ basename(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void pyi_path_basename(char *result, char *path) {
  char *base = NULL;
  base = (char *)basename(path);
  strcpy(result, path);
}


x86 assembly (clang, -O0):
<pyi_path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyi_path_basename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <basename@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @pyi_path_basename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @basename(i8* %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @pyi_path_basename(i8* %0, i8* %1) {
%3 = tail call i64 @basename(i8* %1)
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char nombre[256];
  printf("Escriba su nombre: ");
  scanf("%s", nombre);
  printf("Hola %s!\n", nombre);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Escriba su nombre: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"Hola %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Escriba su nombre: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"Hola %s!\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}