xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ rename(char *, char *);
int main(void) {
  if (0 > rename("see.emily.play/gnome", "jugband.blues"))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <rename@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1151 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <main+0x4d>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef6(%rip),%rsi
call   1030 <rename@plt>
test   %rax,%rax
jns    1132 <main+0x22>
mov    0x2eb0(%rip),%rax
jmp    1139 <main+0x29>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [14 x i8] c"jugband.blues\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @rename(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp sgt i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [14 x i8] c"jugband.blues\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @rename(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
%3 = load i32, i32* @EXIT_FAILURE
%4 = load i32, i32* @EXIT_SUCCESS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ lBuff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char const *const, char *);
int tryCommand(char const *const aCommand) {
  char lBuff[1024];
  FILE *lIn;
  lIn = popen(aCommand, "r");
  if (fgets(lBuff, sizeof(lBuff), lIn) == NULL) {
    pclose(lIn);
    return 1;
  } else {
    pclose(lIn);
    return 0;
  }
}


x86 assembly (clang, -O0):
<tryCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1190 <tryCommand+0x60>
mov    -0x418(%rbp),%rdi
call   1030 <pclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <tryCommand+0x73>
mov    -0x418(%rbp),%rdi
call   1030 <pclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tryCommand>:
push   %rbp
push   %rbx
sub    $0x408,%rsp
lea    0xec0(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <pclose@plt>
mov    %ebp,%eax
add    $0x408,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @tryCommand(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
%5 = alloca i32*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @popen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = load i32*, i32** %5
%10 = call i32* @fgets(i8* %8, i32 1024, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32*, i32** %5
%14 = call i32 @pclose(i32* %13)
store i32 1, i32* %2
br label %18
15: ; preds = %1
%16 = load i32*, i32** %5
%17 = call i32 @pclose(i32* %16)
store i32 0, i32* %2
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @tryCommand(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32* @fgets(i8* %3, i32 1024, i32* %4)
%6 = icmp eq i32* %5, null
%7 = call i32 @pclose(i32* %4)
%8 = zext i1 %6 to i32
ret i32 %8
}
float max(float a, float b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
scalar_t__ adc_read();
int read_avg(int n) {
  int i;
  int sum;
  sum = 0;
  for (i = 0; i < n; i++) {
    sum += adc_read();
  }
  return sum / n;
}


x86 assembly (clang, -O0):
<read_avg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <read_avg+0x47>
mov    $0x0,%al
call   1030 <adc_read@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <read_avg+0x19>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_avg>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
test   %edi,%edi
jle    1130 <read_avg+0x20>
mov    %r14d,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <adc_read@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <read_avg+0x10>
jmp    1132 <read_avg+0x22>
xor    %ebp,%ebp
mov    %ebp,%eax
cltd
idiv   %r14d
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_avg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = call i64 (...) @adc_read()
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %4
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = sdiv i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @read_avg(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i64 (...) @adc_read()
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = sdiv i32 %12, %0
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ func();
int main() {
  func();
  func();
  func();
  func();
  func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = tail call i32 (...) @func()
%3 = tail call i32 (...) @func()
%4 = tail call i32 (...) @func()
%5 = tail call i32 (...) @func()
ret i32 0
}
void UNDEF_Routine(void) {}


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

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

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

LLVM IR (-O2):
define void @UNDEF_Routine() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calculette_1(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  calculette_1(host);
  exit(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)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <calculette_1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    0x8(%rsi),%rdi
call   1050 <calculette_1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s server_host\0A\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 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @calculette_1(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @calculette_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
int callbackPointerArgTest(int (*callback)(void *), void *arg) {
  return callback(arg);
}


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

x86 assembly (clang, -O2):
<callbackPointerArgTest>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @callbackPointerArgTest(i32 (i8*)* nocapture %0, i8* %1) {
%3 = tail call i32 %0(i8* %1)
ret i32 %3
}
/* Variables and functions */
double exp(long double);
long double sinhl(long double x) { return (exp(x) - exp(-x)) * 0.5; }


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x18(%rsp)
fldt   0x2c(%rsp)
fchs
fstpt  (%rsp)
call   1030 <exp@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xeb4(%rip),%xmm1
movsd  %xmm1,0x20(%rsp)
fldl   0x20(%rsp)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call double @exp(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = fneg x86_fp80 %5
%7 = call double @exp(x86_fp80 %6)
%8 = fsub double %4, %7
%9 = fmul double %8, 5.000000e-01
%10 = fpext double %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = tail call double @exp(x86_fp80 %0)
%3 = fneg x86_fp80 %0
%4 = tail call double @exp(x86_fp80 %3)
%5 = fsub double %2, %4
%6 = fmul double %5, 5.000000e-01
%7 = fpext double %6 to x86_fp80
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void abs_test(void) {
  assert(((1) > 0 ? (1) : -(1)) == 1);
  assert(((-1) > 0 ? (-1) : -(-1)) == 1);
}


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

x86 assembly (clang, -O2):
<abs_test>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @abs_test() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @abs_test() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vi3();
int /*<<< orphan*/ take_struct_vi3(int /*<<< orphan*/);
void test_struct_vi3() { take_struct_vi3(return_struct_vi3()); }


x86 assembly (clang, -O0):
<test_struct_vi3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_vi3@plt>
mov    %eax,%edi
call   1030 <take_struct_vi3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vi3>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_vi3@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_vi3@plt>

LLVM IR (-O0):
define void @test_struct_vi3() {
%1 = call i32 (...) @return_struct_vi3()
%2 = call i32 @take_struct_vi3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vi3() {
%1 = tail call i32 (...) @return_struct_vi3()
%2 = tail call i32 @take_struct_vi3(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int no;
  printf("请输入一个整数：");
  scanf("%d", &no);
  printf("您输入的是%d\n", no);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\E6\82\A8\E8\BE\93\E5\85\A5\E7\9A\84\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 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), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\E6\82\A8\E8\BE\93\E5\85\A5\E7\9A\84\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int time_t;
struct timespec {
  int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void Sleep(unsigned int ms) {
  struct timespec ts;
  ts.tv_sec = (time_t)ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
mov    %eax,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @Sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @Sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t MyWriteFile(int /*<<< orphan*/ *, void const *, size_t);
int MyWriteFileAndCheck(FILE *file, const void *data, size_t size) {
  return (MyWriteFile(file, data, size) == size);
}


x86 assembly (clang, -O0):
<MyWriteFileAndCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <MyWriteFile@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyWriteFileAndCheck>:
push   %rbx
mov    %rdx,%rbx
call   1030 <MyWriteFile@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @MyWriteFileAndCheck(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @MyWriteFile(i32* %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @MyWriteFileAndCheck(i32* %0, i8* %1, i64 %2) {
%4 = tail call i64 @MyWriteFile(i32* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned get_apic_id(unsigned long x) { return (((x) >> 24) & 0xFF); }


x86 assembly (clang, -O0):
<get_apic_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_apic_id>:
mov    %rdi,%rax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @get_apic_id(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_apic_id(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 24
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ xmemcpy(char *, char const *, size_t);
size_t xstrnlen(char const *, size_t);
char *xstrndup(const char *str, size_t n) {
  size_t len = xstrnlen(str, n);
  char *dup = (char *)malloc(sizeof(char) * (len + 1));
  xmemcpy(dup, str, len);
  dup[len] = 0;
  return dup;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <xstrnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <xmemcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <xstrnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <xmemcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @xstrnlen(i8* %7, i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = add i64 %10, 1
%12 = mul i64 1, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i32 @xmemcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %6
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 0, i8* %22
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i64 @xstrnlen(i8* %0, i64 %1)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @xmemcpy(i8* %7, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %7, i64 %3
store i8 0, i8* %9
ret i8* %7
}
/* Type definitions */
struct Value {
  int dummy;
};

/* Variables and functions */
struct Value *boolean(int);
struct Value *equal_boolean(int *a, int *b) {
  if (*a == *b)
    return boolean(1);
  return boolean(0);
}


x86 assembly (clang, -O0):
<equal_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1145 <equal_boolean+0x35>
mov    $0x1,%edi
call   1030 <boolean@plt>
mov    %rax,-0x8(%rbp)
jmp    1150 <equal_boolean+0x40>
xor    %edi,%edi
call   1030 <boolean@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_boolean>:
mov    (%rdi),%eax
xor    %edi,%edi
cmp    (%rsi),%eax
sete   %dil
jmp    1030 <boolean@plt>

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

LLVM IR (-O2):
%struct.Value = type { i32 }
define %struct.Value* @equal_boolean(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call %struct.Value* @boolean(i32 %6)
ret %struct.Value* %7
}
/* Variables and functions */
void *ba_alloc(size_t);
void *realloc(void *, size_t);
void *ba_resize(void *ptr, size_t size) {
  if (ptr == NULL)
    return ba_alloc(size);
  ptr = (void *)ptr - sizeof(size_t);
  ptr = realloc(ptr, size + sizeof(size_t));
  *((size_t *)ptr) = size;
  return (void *)ptr + sizeof(size_t);
}


x86 assembly (clang, -O0):
<ba_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <ba_resize+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <ba_alloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1185 <ba_resize+0x65>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ba_resize>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     113f <ba_resize+0x1f>
add    $0xfffffffffffffff8,%rdi
lea    0x8(%rbx),%rsi
call   1040 <realloc@plt>
mov    %rbx,(%rax)
add    $0x8,%rax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ba_alloc@plt>

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

LLVM IR (-O2):
define i8* @ba_resize(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @ba_alloc(i64 %1)
br label %12
6: ; preds = %2
%7 = getelementptr i8, i8* %0, i64 -8
%8 = add i64 %1, 8
%9 = tail call i8* @realloc(i8* %7, i64 %8)
%10 = bitcast i8* %9 to i64*
store i64 %1, i64* %10
%11 = getelementptr i8, i8* %9, i64 8
br label %12
12: ; preds = %6, %4
%13 = phi i8* [ %5, %4 ], [ %11, %6 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void gmpint_addz(mpz_t *rop, mpz_t *op, mpz_t *op2) {
  mpz_add(*rop, *op, *op2);
}


x86 assembly (clang, -O0):
<gmpint_addz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <mpz_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmpint_addz>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <mpz_add@plt>

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

LLVM IR (-O2):
define void @gmpint_addz(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @mpz_add(i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
double fabs(float);
float bounceVelocity(float elastic, float v) {
  if (fabs(v) <= 0.2)
    return 0.0;
  else
    return -elastic * v;
}


x86 assembly (clang, -O0):
<bounceVelocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     114e <bounceVelocity+0x3e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116a <bounceVelocity+0x5a>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounceVelocity>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movapd %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  0xed0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     113f <bounceVelocity+0x2f>
xorpd  %xmm0,%xmm0
add    $0x28,%rsp
ret
movaps 0x10(%rsp),%xmm0
xorps  0xec5(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @bounceVelocity(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = call double @fabs(float %6)
%8 = fcmp ole double %7, 2.000000e-01
br i1 %8, label %9, label %10
9: ; preds = %2
store float 0.000000e+00, float* %3
br label %15
10: ; preds = %2
%11 = load float, float* %4
%12 = fneg float %11
%13 = load float, float* %5
%14 = fmul float %12, %13
store float %14, float* %3
br label %15
15: ; preds = %10, %9
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @bounceVelocity(float %0, float %1) {
%3 = tail call double @fabs(float %1)
%4 = fcmp ugt double %3, 2.000000e-01
%5 = fneg float %0
%6 = fmul float %5, %1
%7 = select i1 %4, float %6, float 0.000000e+00
ret float %7
}
/* Variables and functions */
char *gets(char *);
int /*<<< orphan*/ printf(char *, char *);
void getsSample2() {
  char str[100];
  char *result;
  while ((result = gets(str)) != NULL) {
    printf("your enter is = %s\n", result);
  }
}


x86 assembly (clang, -O0):
<getsSample2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
je     1157 <getsSample2+0x37>
mov    -0x78(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <getsSample2+0xb>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsSample2>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1158 <getsSample2+0x38>
lea    0xec5(%rip),%r14
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
test   %rax,%rax
jne    1140 <getsSample2+0x20>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"your enter is = %s\0A\00"
define void @getsSample2() {
%1 = alloca [100 x i8]
%2 = alloca i8*
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i8* @gets(i8* %4)
store i8* %5, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"your enter is = %s\0A\00"
define void @getsSample2() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i8* @gets(i8* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = phi i8* [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* @gets(i8* %2)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int setenv(const char *name __attribute__((unused)),
           const char *value __attribute__((unused)),
           int overwrite __attribute__((unused))) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setenv(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 0
}
void my__builtin_va_start(__builtin_va_list arg0) { return; }


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

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

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @my__builtin_va_start(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @my__builtin_va_start(%struct.__va_list_tag* nocapture %0) {
ret void
}
int isblank(int c) { return ((c) == '\t' || (c) == ' '); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x9,%edi
sete   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = icmp eq i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int short safe_60(int short left, int right) {
  return right ? 0 : left >> right;
}


x86 assembly (clang, -O0):
<safe_60>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <safe_60+0x22>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <safe_60+0x2e>
movswl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_60>:
xor    %eax,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i16 @safe_60(i16 signext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i16 %0, i16 0
ret i16 %4
}
void glutMainLoop() {}


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

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

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

LLVM IR (-O2):
define void @glutMainLoop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void help(const char *progname) {
  fprintf(stderr,
          "Usage:\n"
          "\t%s [options] filename [args]\n"
          "Options:\n"
          "\t-V, --version     show version\n"
          "\t-h, --help        show this help\n",
          progname);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [113 x i8] c"Usage:\0A\09%s [options] filename [args]\0AOptions:\0A\09-V, --version show version\0A\09-h, --help show this help\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [113 x i8] c"Usage:\0A\09%s [options] filename [args]\0AOptions:\0A\09-V, --version show version\0A\09-h, --help show this help\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int R_gc_running() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @R_gc_running() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cat2(char *, char *);
char *cat4(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/, char *);
char *cat7(char *str1, char *str2, char *str3, char *str4, char *str5,
           char *str6, char *str7) {
  return cat4(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6), str7);
}


x86 assembly (clang, -O0):
<cat7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cat2@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <cat2@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <cat2@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
mov    0x10(%rbp),%rcx
call   1040 <cat4@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat7>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    0x40(%rsp),%r13
call   1030 <cat2@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <cat2@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <cat2@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
mov    %r13,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cat4@plt>

LLVM IR (-O0):
define i8* @cat7(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = call i32 @cat2(i8* %15, i8* %16)
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = call i32 @cat2(i8* %18, i8* %19)
%21 = load i8*, i8** %12
%22 = load i8*, i8** %13
%23 = call i32 @cat2(i8* %21, i8* %22)
%24 = load i8*, i8** %14
%25 = call i8* @cat4(i32 %17, i32 %20, i32 %23, i8* %24)
ret i8* %25
}

LLVM IR (-O2):
define i8* @cat7(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = tail call i32 @cat2(i8* %0, i8* %1)
%9 = tail call i32 @cat2(i8* %2, i8* %3)
%10 = tail call i32 @cat2(i8* %4, i8* %5)
%11 = tail call i8* @cat4(i32 %8, i32 %9, i32 %10, i8* %6)
ret i8* %11
}
/* Variables and functions */
int sourceA();
int sourceB();
int /*<<< orphan*/ two_arg_sink_caller_p(int, int);
int p_caller() {
  int a = sourceA();
  int b = sourceB();
  two_arg_sink_caller_p(a, b);
}


x86 assembly (clang, -O0):
<p_caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sourceA@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <sourceB@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <two_arg_sink_caller_p@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_caller>:
push   %rbx
xor    %eax,%eax
call   1040 <sourceA@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <sourceB@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <two_arg_sink_caller_p@plt>

LLVM IR (-O0):
define i32 @p_caller() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @sourceA()
store i32 %4, i32* %2
%5 = call i32 (...) @sourceB()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @two_arg_sink_caller_p(i32 %6, i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @p_caller() {
%1 = tail call i32 (...) @sourceA()
%2 = tail call i32 (...) @sourceB()
%3 = tail call i32 @two_arg_sink_caller_p(i32 %1, i32 %2)
ret i32 undef
}
int digitalReadDummy(struct wiringPiNodeStruct *node, int pin) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wiringPiNodeStruct = type opaque
define i32 @digitalReadDummy(%struct.wiringPiNodeStruct* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
void write2LE(FILE *fp, unsigned short val) {
  putc(val & 0xff, fp);
  putc(val >> 8, fp);
}


x86 assembly (clang, -O0):
<write2LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write2LE>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @write2LE(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %3
%10 = call i32 @putc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i16
%15 = load i32*, i32** %3
%16 = call i32 @putc(i16 zeroext %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @write2LE(i32* nocapture %0, i16 zeroext %1) {
%3 = and i16 %1, 255
%4 = tail call i32 @putc(i16 zeroext %3, i32* %0)
%5 = lshr i16 %1, 8
%6 = tail call i32 @putc(i16 zeroext %5, i32* %0)
ret void
}
/* Type definitions */
struct mt {
  int dummy;
};

/* Variables and functions */
double mt_genirand(struct mt *);
double mt_genrand(struct mt *self) {
  return mt_genirand(self) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<mt_genrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mt_genirand@plt>
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_genrand>:
push   %rax
call   1030 <mt_genirand@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.mt = type { i32 }
define double @mt_genrand(%struct.mt* %0) {
%2 = alloca %struct.mt*
store %struct.mt* %0, %struct.mt** %2
%3 = load %struct.mt*, %struct.mt** %2
%4 = call double @mt_genirand(%struct.mt* %3)
%5 = fmul double %4, 0x3DF0000000000000
ret double %5
}

LLVM IR (-O2):
%struct.mt = type { i32 }
define double @mt_genrand(%struct.mt* %0) {
%2 = tail call double @mt_genirand(%struct.mt* %0)
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}