xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_response(char *);
int main(int argc, char *argv[]) {
  int res;
  res = get_response("Do you want another transaction");
  return res;
}


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    0xed3(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %6
%8 = load i32, i32* %6
ret i32 %8
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
char *BigFactorial(char *num1, char *num2) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @BigFactorial(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @BigFactorial(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void fixstr(char *s) {
  for (; *s; s++) {
    if (*s == ',') {
      *s = '.';
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<fixstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <fixstr+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1131 <fixstr+0x31>
mov    -0x8(%rbp),%rax
movb   $0x2e,(%rax)
jmp    1136 <fixstr+0x36>
jmp    1136 <fixstr+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <fixstr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixstr>:
jmp    1117 <fixstr+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2e,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2c,%al
je     1110 <fixstr+0x10>
test   %al,%al
jne    1113 <fixstr+0x13>
ret

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

LLVM IR (-O2):
define void @fixstr(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 44, label %5
]
5: ; preds = %2
store i8 46, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
void WebPInitAlphaProcessingNEON(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitAlphaProcessingNEON() {
ret void
}
double FTtoIN(double FT) { return FT * 12; }


x86 assembly (clang, -O0):
<FTtoIN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FTtoIN>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @FTtoIN(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.200000e+01
ret double %4
}

LLVM IR (-O2):
define double @FTtoIN(double %0) {
%2 = fmul double %0, 1.200000e+01
ret double %2
}
int cdiEncodeTime(int hour, int minute, int second) {
  int time;
  time = hour * 10000 + minute * 100 + second;
  return (time);
}


x86 assembly (clang, -O0):
<cdiEncodeTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x2710,-0x4(%rbp),%eax
imul   $0x64,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiEncodeTime>:
imul   $0x2710,%edi,%ecx
imul   $0x64,%esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cdiEncodeTime(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 10000
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 100
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @cdiEncodeTime(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 10000
%5 = mul nsw i32 %1, 100
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
char *single_subgrid(char ***g, int slice, int index, int pos) {
  return g[(slice / 3) * 3 + pos / 3][(slice % 3) * 3 + pos % 3] + index;
}


x86 assembly (clang, -O0):
<single_subgrid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%ecx
mov    -0x14(%rbp),%eax
mov    $0x3,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x28(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%edx,%ecx
mov    -0x14(%rbp),%eax
mov    $0x3,%esi
cltd
idiv   %esi
mov    -0x20(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_subgrid>:
movslq %esi,%r8
imul   $0x55555556,%r8,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    (%rsi,%rsi,2),%r9d
sub    %r9d,%r8d
movslq %ecx,%rcx
imul   $0x55555556,%rcx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
add    %esi,%r9d
movslq %r9d,%rax
mov    (%rdi,%rax,8),%rdi
lea    (%r8,%r8,2),%eax
lea    (%rsi,%rsi,2),%esi
sub    %esi,%ecx
add    %eax,%ecx
movslq %ecx,%rcx
movslq %edx,%rax
add    (%rdi,%rcx,8),%rax
ret

LLVM IR (-O0):
define i8* @single_subgrid(i8*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8*** %0, i8**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8***, i8**** %5
%10 = load i32, i32* %6
%11 = sdiv i32 %10, 3
%12 = mul nsw i32 %11, 3
%13 = load i32, i32* %8
%14 = sdiv i32 %13, 3
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8**, i8*** %9, i64 %16
%18 = load i8**, i8*** %17
%19 = load i32, i32* %6
%20 = srem i32 %19, 3
%21 = mul nsw i32 %20, 3
%22 = load i32, i32* %8
%23 = srem i32 %22, 3
%24 = add nsw i32 %21, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %18, i64 %25
%27 = load i8*, i8** %26
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
ret i8* %30
}

LLVM IR (-O2):
define i8* @single_subgrid(i8*** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = srem i32 %1, 3
%6 = sub i32 %1, %5
%7 = sdiv i32 %3, 3
%8 = add nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8**, i8*** %0, i64 %9
%11 = load i8**, i8*** %10
%12 = mul nsw i32 %5, 3
%13 = srem i32 %3, 3
%14 = add nsw i32 %13, %12
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %11, i64 %15
%17 = load i8*, i8** %16
%18 = sext i32 %2 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ count_4();
char getchar();
int main() {
  count_4();
  while (getchar() != '\n')
    continue;
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <count_4@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114e <main+0x2e>
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <count_4@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @count_4()
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @count_4()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call signext i8 (...) @getchar()
ret i32 0
}
/* Type definitions */
struct cdb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cdb_init(struct cdb *, int);
int /*<<< orphan*/ close(int);
int open_read(char *);
int dbl_init(void) {
  extern struct cdb bl;
  int fd = open_read("dnsbl.cdb");
  if (fd == -1)
    return 0;
  cdb_init(&bl, fd);
  close(fd);
  return 1;
}


x86 assembly (clang, -O0):
<dbl_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <open_read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    115d <dbl_init+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    117b <dbl_init+0x4b>
mov    -0x8(%rbp),%esi
mov    0x2e81(%rip),%rdi
call   1030 <cdb_init@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_init>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <open_read@plt>
cmp    $0xffffffff,%eax
je     1160 <dbl_init+0x30>
mov    %eax,%ebx
mov    0x2e9d(%rip),%rdi
mov    %eax,%esi
call   1030 <cdb_init@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cdb = type { i32 }
@.str = [10 x i8] c"dnsbl.cdb\00"
@bl = external global %struct.cdb
define i32 @dbl_init() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @open_read(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @cdb_init(%struct.cdb* @bl, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
store i32 1, i32* %1
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.cdb = type { i32 }
@.str = [10 x i8] c"dnsbl.cdb\00"
@bl = external global %struct.cdb
define i32 @dbl_init() {
%1 = tail call i32 @open_read(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @cdb_init(%struct.cdb* @bl, i32 %1)
%5 = tail call i32 @close(i32 %1)
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtcp_xr_set_ssrc_sender(uint8_t *p_rtcp_xr, const uint8_t pi_ssrc[4]) {
  p_rtcp_xr[4] = pi_ssrc[0];
  p_rtcp_xr[5] = pi_ssrc[1];
  p_rtcp_xr[6] = pi_ssrc[2];
  p_rtcp_xr[7] = pi_ssrc[3];
}


x86 assembly (clang, -O0):
<rtcp_xr_set_ssrc_sender>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcp_xr_set_ssrc_sender>:
mov    (%rsi),%eax
mov    %eax,0x10(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x14(%rdi)
mov    0x8(%rsi),%eax
mov    %eax,0x18(%rdi)
mov    0xc(%rsi),%eax
mov    %eax,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @rtcp_xr_set_ssrc_sender(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32 %7, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 %12, i32* %14
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 6
store i32 %17, i32* %19
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32, i32* %21
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 7
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @rtcp_xr_set_ssrc_sender(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %1, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %1, i64 3
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %12, i32* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocator_free(int *, int /*<<< orphan*/);
void _ensure_allocator_free_copes_with_null_allocator(void) {
  int x = 0;
  allocator_free(&x, 0);
}


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

x86 assembly (clang, -O2):
<_ensure_allocator_free_copes_with_null_allocator>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <allocator_free@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @_ensure_allocator_free_copes_with_null_allocator() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @allocator_free(i32* %1, i32 0)
ret void
}
/* Variables and functions */
int strlen(char *);
int check_format(char *str) {
  if (strlen(str) == 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    113a <check_format+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <check_format+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_format>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_format(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("Arg %d is %s\n", i, argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Arg %d is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _alloc_failed();
void *malloc(size_t);
void *checked_malloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL && size > 0)
    _alloc_failed();
  return mem;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <checked_malloc+0x36>
cmpq   $0x0,-0x8(%rbp)
jbe    1156 <checked_malloc+0x36>
mov    $0x0,%al
call   1040 <_alloc_failed@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <checked_malloc+0x20>
test   %r14,%r14
jne    1140 <checked_malloc+0x20>
xor    %eax,%eax
call   1040 <_alloc_failed@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @_alloc_failed()
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @_alloc_failed()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_strings(char *p[], int n) {
  int count;
  printf("The words in alphabetical order: \n");
  for (count = 0; count < n; count++)
    printf("%s\n", p[count]);
}


x86 assembly (clang, -O0):
<print_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <print_strings+0x58>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <print_strings+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_strings>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    1142 <print_strings+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <print_strings+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [34 x i8] c"The words in alphabetical order: \00"
define void @print_strings(i8** nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short y;
};
struct TYPE_4__ {
  TYPE_1__ max_logical_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_logical_extent_y(void *_p, short _v) {
  ((XFontSetExtents *)_p)->max_logical_extent.y = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_logical_extent_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_logical_extent_y>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XFontSetExtents_max_logical_extent_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
void update_entry(void *old_memory, void *new_memory, int new_size) {}


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

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

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

LLVM IR (-O2):
define void @update_entry(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
void av_frame_make_writable() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_make_writable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_initial_tok_table();
int /*<<< orphan*/ insert_real_symbols_in_table();
int /*<<< orphan*/ optimize_result();
void optimize_token_table(void) {
  build_initial_tok_table();
  insert_real_symbols_in_table();
  optimize_result();
}


x86 assembly (clang, -O0):
<optimize_token_table>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <build_initial_tok_table@plt>
mov    $0x0,%al
call   1050 <insert_real_symbols_in_table@plt>
mov    $0x0,%al
call   1040 <optimize_result@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimize_token_table>:
push   %rax
xor    %eax,%eax
call   1030 <build_initial_tok_table@plt>
xor    %eax,%eax
call   1050 <insert_real_symbols_in_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <optimize_result@plt>

LLVM IR (-O0):
define void @optimize_token_table() {
%1 = call i32 (...) @build_initial_tok_table()
%2 = call i32 (...) @insert_real_symbols_in_table()
%3 = call i32 (...) @optimize_result()
ret void
}

LLVM IR (-O2):
define void @optimize_token_table() {
%1 = tail call i32 (...) @build_initial_tok_table()
%2 = tail call i32 (...) @insert_real_symbols_in_table()
%3 = tail call i32 (...) @optimize_result()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, size_t);
void uninivar_strncat(char *Ct, char *S, size_t N) {
  char *ct;
  char *s;
  size_t n;
  (void)strncat(ct, s, n);
  (void)strncat(ct, S, N);
  (void)strncat(Ct, s, N);
  (void)strncat(Ct, S, n);
  (void)strncat(Ct, S, N);
}


x86 assembly (clang, -O0):
<uninivar_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strncat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strncat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define void @uninivar_strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = load i64, i64* %9
%13 = call i32 @strncat(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %7
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @strncat(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %4
%19 = load i8*, i8** %8
%20 = load i64, i64* %6
%21 = call i32 @strncat(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = load i64, i64* %9
%25 = call i32 @strncat(i8* %22, i8* %23, i64 %24)
%26 = load i8*, i8** %4
%27 = load i8*, i8** %5
%28 = load i64, i64* %6
%29 = call i32 @strncat(i8* %26, i8* %27, i64 %28)
ret void
}

LLVM IR (-O2):
define void @uninivar_strncat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncat(i8* undef, i8* undef, i64 undef)
%5 = tail call i32 @strncat(i8* undef, i8* %1, i64 %2)
%6 = tail call i32 @strncat(i8* %0, i8* undef, i64 %2)
%7 = tail call i32 @strncat(i8* %0, i8* %1, i64 undef)
%8 = tail call i32 @strncat(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ readsplit(char **, int /*<<< orphan*/ *, char *);
void load_conky(char **a) {
  FILE *conky = popen("conky", "r");
  readsplit(a, conky, "|");
  pclose(conky);
}


x86 assembly (clang, -O0):
<load_conky>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdx
call   1030 <readsplit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_conky>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0xeb4(%rip),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <readsplit@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pclose@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"conky\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"|\00"
define void @load_conky(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
store i8** %0, i8*** %2
%4 = call i32* @popen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8**, i8*** %2
%6 = load i32*, i32** %3
%7 = call i32 @readsplit(i8** %5, i32* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @pclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"conky\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"|\00"
define void @load_conky(i8** %0) {
%2 = tail call i32* @popen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @readsplit(i8** %0, i32* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @pclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0, char *msg) {
  printf("%s\n\n", msg);
  printf("Usage:\n\n%s x y\n lock part of file from position x (inclusiv) to "
         "position y (exclusive), sleep 10 sec\n\n",
         argv0);
  printf("%s x y sleeptime\n lock part of file from position x (inclusiv) to "
         "position y (exclusive), sleep sleeptime sec\n",
         argv0);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0A\0A\00"
@.str.1 = [103 x i8] c"Usage:\0A\0A%s x y\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep 10 sec\0A\0A\00"
@.str.2 = [111 x i8] c"%s x y sleeptime\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep sleeptime sec\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0A\00"
@.str.1 = [103 x i8] c"Usage:\0A\0A%s x y\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep 10 sec\0A\0A\00"
@.str.2 = [111 x i8] c"%s x y sleeptime\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep sleeptime sec\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
char *getsn(char *buf, int len) {
  char *c;
  fgets(buf, len, stdin);
  c = strchr(buf, '\n');
  if (c)
    *c = 0;
}


x86 assembly (clang, -O0):
<getsn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1168 <getsn+0x48>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsn>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1147 <getsn+0x27>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @getsn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %7, i32 %8, i32 %9)
%11 = load i8*, i8** %4
%12 = call i8* @strchr(i8* %11, i8 signext 10)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8 0, i8* %16
br label %17
17: ; preds = %15, %2
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@stdin = global i32 0
define noalias i8* @getsn(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32 %3)
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
store i8 0, i8* %5
br label %8
8: ; preds = %7, %2
ret i8* undef
}
/* Variables and functions */
scalar_t__ ceil(double);
int iceil(double a) { return (int)ceil(a); }


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

x86 assembly (clang, -O2):
<iceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @iceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @ceil(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @iceil(double %0) {
%2 = tail call i64 @ceil(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
bool is_digit(char ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: sign privkey file ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: sign privkey file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: sign privkey file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gen_lohi_caps(int /*<<< orphan*/ *, int);
void gen_my_bound(FILE *outfile, int lohi, int dim) {
  fprintf(outfile, "_DIST_MY");
  gen_lohi_caps(outfile, lohi);
  fprintf(outfile, "(_DefaultDistribution, %d)", dim);
}


x86 assembly (clang, -O0):
<gen_my_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <gen_lohi_caps@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_my_bound>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xebd(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <gen_lohi_caps@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"_DIST_MY\00"
@.str.1 = [27 x i8] c"(_DefaultDistribution, %d)\00"
define void @gen_my_bound(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 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 @gen_lohi_caps(i32* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"_DIST_MY\00"
@.str.1 = [27 x i8] c"(_DefaultDistribution, %d)\00"
define void @gen_my_bound(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
%5 = tail call i32 @gen_lohi_caps(i32* %0, i32 %1)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
float computeLeft(float theta, float alpha) { return theta + alpha; }


x86 assembly (clang, -O0):
<computeLeft>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeLeft>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @computeLeft(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @computeLeft(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
void _elf_read_program(int fd, const struct elf_header32 *header,
                       void **out_program) {}


x86 assembly (clang, -O0):
<_elf_read_program>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.elf_header32 = type opaque
define void @_elf_read_program(i32 %0, %struct.elf_header32* %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.elf_header32*
%6 = alloca i8**
store i32 %0, i32* %4
store %struct.elf_header32* %1, %struct.elf_header32** %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
%struct.elf_header32 = type opaque
define void @_elf_read_program(i32 %0, %struct.elf_header32* nocapture %1, i8** nocapture %2) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Product = %d\n", (atoi(argv[1]) * atoi(argv[2])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x14(%rbp),%esi
imul   %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
imul   %eax,%ebp
lea    0xebc(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Product = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = mul nsw i32 %8, %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola Mundo");
  printf("¿Como estas?");
  printf("¿Cuantos años tienes?");
  printf("Se me acaban las ideas");
  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>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%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 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Hola Mundo\00"
@.str.1 = [14 x i8] c"\C2\BFComo estas?\00"
@.str.2 = [24 x i8] c"\C2\BFCuantos a\C3\B1os tienes?\00"
@.str.3 = [23 x i8] c"Se me acaban las ideas\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hola Mundo\00"
@.str.1 = [14 x i8] c"\C2\BFComo estas?\00"
@.str.2 = [24 x i8] c"\C2\BFCuantos a\C3\B1os tienes?\00"
@.str.3 = [23 x i8] c"Se me acaban las ideas\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}