xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int b = 0, a = 0, p;
  scanf("%d", &a);
  scanf("%d", &b);
  b = b >> a;
  p = b & 1;
  printf("%d", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%cl
sar    %cl,%esi
mov    %esi,0x8(%rsp)
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = ashr i32 %7, %8
store i32 %9, i32* %1
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ loop(char **);
int /*<<< orphan*/ system(char *);
int main() {
  char c[3][3];
  loop(c);
  system("pause");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf(%rsp),%rdi
call   1030 <loop@plt>
lea    0xecb(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i8]]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %2, i64 0, i64 0
%4 = bitcast [3 x i8]* %3 to i8**
%5 = call i32 @loop(i8** %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [3 x [3 x i8]]
%2 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [3 x [3 x i8]]* %1 to i8**
%4 = call i32 @loop(i8** %3)
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1b() {
  Assert_real((isxdigit(27) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              140, ("isxdigit should be 0 for 0x1b"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x1b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x8c,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x8c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1b\00"
define void @t_isxdigit_0x1b() {
%1 = call i64 @isxdigit(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1b\00"
define void @t_isxdigit_0x1b() {
%1 = tail call i64 @isxdigit(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ array_sum();
int main(int argc, char **argv) {
  array_sum();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @array_sum()
ret i32 0
}
g(u, v, w, x, y, z) {
  if (u != 1)
    abort();
  if (v != 2)
    abort();
  if (w != 3)
    abort();
  if (x != 4)
    abort();
  if (y != 5)
    abort();
  if (z != 6)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     113b <g+0x2b>
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     114a <g+0x3a>
call   1030 <abort@plt>
cmpl   $0x3,-0x10(%rbp)
je     1159 <g+0x49>
call   1030 <abort@plt>
cmpl   $0x4,-0x14(%rbp)
je     1168 <g+0x58>
call   1030 <abort@plt>
cmpl   $0x5,-0x18(%rbp)
je     1177 <g+0x67>
call   1030 <abort@plt>
cmpl   $0x6,-0x1c(%rbp)
je     1186 <g+0x76>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
cmp    $0x1,%edi
jne    1133 <g+0x23>
cmp    $0x2,%esi
jne    1133 <g+0x23>
cmp    $0x3,%edx
jne    1133 <g+0x23>
cmp    $0x4,%ecx
jne    1133 <g+0x23>
cmp    $0x5,%r8d
jne    1133 <g+0x23>
cmp    $0x6,%r9d
jne    1133 <g+0x23>
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @g(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load i32, i32* %8
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %6
unreachable
17: ; preds = %6
%18 = load i32, i32* %9
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %21
20: ; preds = %17
unreachable
21: ; preds = %17
%22 = load i32, i32* %10
%23 = icmp ne i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %21
unreachable
25: ; preds = %21
%26 = load i32, i32* %11
%27 = icmp ne i32 %26, 4
br i1 %27, label %28, label %29
28: ; preds = %25
unreachable
29: ; preds = %25
%30 = load i32, i32* %12
%31 = icmp ne i32 %30, 5
br i1 %31, label %32, label %33
32: ; preds = %29
unreachable
33: ; preds = %29
%34 = load i32, i32* %13
%35 = icmp ne i32 %34, 6
br i1 %35, label %36, label %37
36: ; preds = %33
unreachable
37: ; preds = %33
%38 = load i32, i32* %7
ret i32 %38
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %0, 1
br i1 %7, label %9, label %8
8: ; preds = %6
tail call void @abort()
unreachable
9: ; preds = %6
%10 = icmp eq i32 %1, 2
br i1 %10, label %12, label %11
11: ; preds = %9
tail call void @abort()
unreachable
12: ; preds = %9
%13 = icmp eq i32 %2, 3
br i1 %13, label %15, label %14
14: ; preds = %12
tail call void @abort()
unreachable
15: ; preds = %12
%16 = icmp eq i32 %3, 4
br i1 %16, label %18, label %17
17: ; preds = %15
tail call void @abort()
unreachable
18: ; preds = %15
%19 = icmp eq i32 %4, 5
br i1 %19, label %21, label %20
20: ; preds = %18
tail call void @abort()
unreachable
21: ; preds = %18
%22 = icmp eq i32 %5, 6
br i1 %22, label %24, label %23
23: ; preds = %21
tail call void @abort()
unreachable
24: ; preds = %21
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "TILESET"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"TILESET\00"
define i32 @isSupported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
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):
@.str = [8 x i8] c"TILESET\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void gtk_entry_get_activates_default() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_activates_default() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ liballoc_memset(void *, int /*<<< orphan*/, int);
void *malloc(int);
void *calloc(uint64_t nobj, uint64_t size) {
  int real_size;
  void *p;
  real_size = nobj * size;
  p = malloc(real_size);
  liballoc_memset(p, 0, real_size);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <liballoc_memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <liballoc_memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i32, i32* %5
%14 = call i32 @liballoc_memset(i8* %12, i32 0, i32 %13)
%15 = load i8*, i8** %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @liballoc_memset(i8* %4, i32 0, i32 %3)
ret i8* %4
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
void *dict_iget(struct dict *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void *dict_get(struct dict *dict, char *key) {
  return dict_iget(dict, key, strlen(key));
}


x86 assembly (clang, -O0):
<dict_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <dict_iget@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dict_iget@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
define i8* @dict_get(%struct.dict* %0, i8* %1) {
%3 = alloca %struct.dict*
%4 = alloca i8*
store %struct.dict* %0, %struct.dict** %3
store i8* %1, i8** %4
%5 = load %struct.dict*, %struct.dict** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @dict_iget(%struct.dict* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.dict = type { i32 }
define i8* @dict_get(%struct.dict* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @dict_iget(%struct.dict* %0, i8* %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
char *my_strncat(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int ac, char **av) {
  printf("%s\n", my_strncat("papa", " dans maman", 14));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec7(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0xe,%edx
call   1040 <my_strncat@plt>
mov    %rax,%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0xe,%edx
call   1040 <my_strncat@plt>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"papa\00"
@.str.2 = [12 x i8] c" dans maman\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i8* @my_strncat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 14)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"papa\00"
@.str.2 = [12 x i8] c" dans maman\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @my_strncat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 14)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned gcd(unsigned a, unsigned b) {
  unsigned c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <gcd+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111e <gcd+0x1e>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ ADDFLAGS(int, int, int);
int fib() {
  int o0;
  int o1;
  int o1_1;
  int o2;
  int o2_1;
  int o3;
  if (o0 <= 1) {
  } else {
    o2 = 1;
    o3 = 1;
    if (o0 > 2) {
      o1 = o0 - 2;
      do {
        o1_1 = o1;
        o2_1 = o2;
        o2 = o2_1 + o3;
        o1 = o1_1 - 1;
        o3 = o2_1;
      } while (ADDFLAGS(o1_1, -1, o1_1 - 1));
    }
    o0 = o2;
  }
  return o0;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpl   $0x1,-0x4(%rbp)
jg     1127 <fib+0x17>
jmp    1194 <fib+0x84>
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    118e <fib+0x7e>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    $0xffffffff,%esi
call   1030 <ADDFLAGS@plt>
cmp    $0x0,%rax
jne    1148 <fib+0x38>
jmp    118e <fib+0x7e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fib() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* %1
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
br label %34
10: ; preds = %0
store i32 1, i32* %4
store i32 1, i32* %6
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %32
13: ; preds = %10
%14 = load i32, i32* %1
%15 = sub nsw i32 %14, 2
store i32 %15, i32* %2
br label %16
16: ; preds = %25, %13
%17 = load i32, i32* %2
store i32 %17, i32* %3
%18 = load i32, i32* %4
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %2
%24 = load i32, i32* %5
store i32 %24, i32* %6
br label %25
25: ; preds = %16
%26 = load i32, i32* %3
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 1
%29 = call i64 @ADDFLAGS(i32 %26, i32 -1, i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %16, label %31
31: ; preds = %25
br label %32
32: ; preds = %31, %10
%33 = load i32, i32* %4
store i32 %33, i32* %1
br label %34
34: ; preds = %32, %9
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
define i32 @fib() {
ret i32 undef
}
void mdp4_dtv_overlay_blt_start(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_dtv_overlay_blt_start(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
/* Variables and functions */
char const *GetResponseEx(int);
const char *GetResponse(void) { return GetResponseEx((1)); }


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

x86 assembly (clang, -O2):
<GetResponse>:
mov    $0x1,%edi
jmp    1030 <GetResponseEx@plt>

LLVM IR (-O0):
define i8* @GetResponse() {
%1 = call i8* @GetResponseEx(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @GetResponse() {
%1 = tail call i8* @GetResponseEx(i32 1)
ret i8* %1
}
/* Variables and functions */
char ToLower(char);
void ToLowerRead(char *r, int readLength) {
  int i;
  for (i = 0; i < readLength; i++) {
    r[i] = ToLower(r[i]);
  }
}


x86 assembly (clang, -O0):
<ToLowerRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ToLowerRead+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ToLower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ToLowerRead+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToLowerRead>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <ToLowerRead+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <ToLower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ToLowerRead+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ToLowerRead(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @ToLower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  char *line = NULL;
  size_t linesz = 0;
  fclose(stdin);
  return getline(&line, &linesz, stdin) != -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    0x2eab(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fclose@plt>
mov    (%rbx),%edx
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <getline@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
store i8* null, i8** %2
store i64 0, i64* %3
%4 = load i32, i32* @stdin
%5 = call i32 @fclose(i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @getline(i8** %2, i64* %3, i32 %6)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = tail call i32 @fclose(i32 %5)
%7 = load i32, i32* @stdin
%8 = call i32 @getline(i8** %1, i64* %2, i32 %7)
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int TCGETS;
int get_termios_get_ioctl(void) { return TCGETS; }


x86 assembly (clang, -O0):
<get_termios_get_ioctl>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_termios_get_ioctl>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TCGETS = global i32 0
define i32 @get_termios_get_ioctl() {
%1 = load i32, i32* @TCGETS
ret i32 %1
}

LLVM IR (-O2):
@TCGETS = global i32 0
define i32 @get_termios_get_ioctl() {
%1 = load i32, i32* @TCGETS
ret i32 %1
}
/* Variables and functions */
double sqrt(scalar_t__);
scalar_t__ square(int);
double distance_to_origin(int x, int y) { return sqrt(square(x) + square(y)); }


x86 assembly (clang, -O0):
<distance_to_origin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <square@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <square@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_to_origin>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <square@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <square@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance_to_origin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @square(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @square(i32 %7)
%9 = add nsw i64 %6, %8
%10 = call double @sqrt(i64 %9)
ret double %10
}

LLVM IR (-O2):
define double @distance_to_origin(i32 %0, i32 %1) {
%3 = tail call i64 @square(i32 %0)
%4 = tail call i64 @square(i32 %1)
%5 = add nsw i64 %4, %3
%6 = tail call double @sqrt(i64 %5)
ret double %6
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalpha(char);
int /*<<< orphan*/ printf(char *);
char tolower(char);
int playmore(void) {
  char yesno;
  printf("\nWould you like to play again? ");
  while (!isalpha(yesno = getchar()))
    ;
  if (tolower(yesno) != 'n')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<playmore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1060 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117b <playmore+0x3b>
jmp    1180 <playmore+0x40>
jmp    1154 <playmore+0x14>
movsbl -0x5(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
je     11a1 <playmore+0x61>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <playmore+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playmore>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1060 <isalpha@plt>
test   %eax,%eax
je     1150 <playmore+0x10>
mov    %ebx,%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x6e,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0AWould you like to play again? \00"
define i32 @playmore() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %9, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = call i32 @isalpha(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AWould you like to play again? \00"
define i32 @playmore() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isalpha(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %3)
%8 = icmp ne i8 %7, 110
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is output from my first program!\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 = [39 x i8] c"This is output from my first program!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"This is output from my first program!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int foo(int i) {
  switch (i) {
  default:
    if (i == 1)
      return 0;
    (void)1;
  case 0:
    return 2;
    (void)1;
  label:;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
je     1132 <foo+0x32>
jmp    1117 <foo+0x17>
cmpl   $0x1,-0x8(%rbp)
jne    112d <foo+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1139 <foo+0x39>
jmp    1132 <foo+0x32>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 0, label %10
]
5: ; preds = %1
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 0, i32* %2
br label %12
9: ; preds = %5
br label %10
10: ; preds = %1, %9
store i32 2, i32* %2
br label %12
11: ; No predecessors!
br label %12
12: ; preds = %8, %10, %11
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 0, i32 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
main() {
  char ch = 'c';
  char *p = &ch;
  ++p;
  printf("%p, %s\n", p, p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x63,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x63,0x7(%rsp)
lea    0x8(%rsp),%rdx
lea    0xede(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%p, %s\0A\00"
define i32 @main() {
%1 = alloca i8
store i8 99, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 1
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
ret i32 0
}
void printcall(struct tcb *tcp) {}


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define void @printcall(%struct.tcb* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int h0;
  int h1;
  int h2;
  int h3;
  int h4;
};
typedef TYPE_1__ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
int SHA1_Init(SHA_CTX *c) {
  memset(c, 0, sizeof(*c));
  c->h0 = 0x67452301UL;
  c->h1 = 0xefcdab89UL;
  c->h2 = 0x98badcfeUL;
  c->h3 = 0x10325476UL;
  c->h4 = 0xc3d2e1f0UL;
  return 1;
}


x86 assembly (clang, -O0):
<SHA1_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movl   $0x67452301,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xefcdab89,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x98badcfe,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10325476,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc3d2e1f0,0x10(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA1_Init>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
movaps 0xed9(%rip),%xmm0
movups %xmm0,(%rbx)
movl   $0xc3d2e1f0,0x10(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
define i32 @SHA1_Init(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
store i32 1732584193, i32* %6
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 1
store i32 -271733879, i32* %8
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 2
store i32 -1732584194, i32* %10
%11 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%12 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 3
store i32 271733878, i32* %12
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 4
store i32 -1009589776, i32* %14
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
define i32 @SHA1_Init(%struct.TYPE_4__* %0) {
%2 = tail call i32 @memset(%struct.TYPE_4__* %0, i32 0, i32 20)
%3 = bitcast %struct.TYPE_4__* %0 to <4 x i32>*
store <4 x i32> <i32 1732584193, i32 -271733879, i32 -1732584194, i32 271733878>, <4 x i32>* %3
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 4
store i32 -1009589776, i32* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ regfree(void *);
void releaseRegex(void *data) { regfree(data); }


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

x86 assembly (clang, -O2):
<releaseRegex>:
jmp    1030 <regfree@plt>

LLVM IR (-O0):
define void @releaseRegex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @regfree(i8* %3)
ret void
}

LLVM IR (-O2):
define void @releaseRegex(i8* %0) {
%2 = tail call i32 @regfree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func4() { printf("This is func4\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"This is func4\0A\00"
define void @func4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"This is func4\00"
define void @func4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_rounding(int rounding) {
  switch (rounding) {}
  printf(".\n");
}


x86 assembly (clang, -O0):
<print_rounding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c".\00"
define void @print_rounding(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int system(char *);
int try_create(const char *iface) {
  char buffer[256];
  snprintf(buffer, sizeof(buffer), "ip link add dev %s type vcan", iface);
  buffer[sizeof(buffer) - 1] = '\0';
  return system(buffer);
}


x86 assembly (clang, -O0):
<try_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_create>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
movb   $0x0,0xff(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"ip link add dev %s type vcan\00"
define i32 @try_create(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 255
store i8 0, i8* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [29 x i8] c"ip link add dev %s type vcan\00"
define i32 @try_create(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 255
store i8 0, i8* %5
%6 = call i32 @system(i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sr_puthandle(void *handle) { free(handle); }


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

x86 assembly (clang, -O2):
<sr_puthandle>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sr_puthandle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @sr_puthandle(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < 1000; i++) {
    printf("Child: %d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1157 <main+0x47>
mov    -0x14(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Child: %d\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 = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Child: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
int main(int argc, char *argv[]) {
  unsigned int x = 0x0000FFFF;
  unsigned int y = 0xFF00FF00;
  unsigned int z = 0;
  z = ~x;
  z = x & y;
  z = x | y;
  z = x ^ y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffff,-0x14(%rbp)
movl   $0xff00ff00,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 65535, i32* %6
store i32 -16711936, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
store i32 %10, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = and i32 %11, %12
store i32 %13, i32* %8
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = or i32 %14, %15
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = xor i32 %17, %18
store i32 %19, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}